Home » KivaKit

Tag Archives: KivaKit

Kernel – Message Formatting and Template Expansions

java-interview-questions-answers

Kernel – Message Formatting and Template Expansions    The module kivakit-kernel supports a simple variable substitution syntax. This syntax can be used when formatting messages, or when substituting variables into templates. Formatting a Message Basic message formatting is achieved with the Message.format() method: var formatted = Message.format("Hello my name is $", name); The symbol $ is an expansion marker, and ...

Read More »

KivaKit and AWS Lambda

java-interview-questions-answers

KivaKit 1.2 adds seamless support for AWS Lambda. Lambdas for REST and GRPC can be added to a KivaKit Microservice without alteration (which will make this a short article). Creating a Lambda We have already seen a KivaKit request handler for REST in the Microservices article. We will simply reuse this code as our Lambda request handler. As a reminder ...

Read More »

KivaKit Clustering

java-interview-questions-answers

KivaKit Clustering   KivaKit provides built-in support for clustering of microservices using Apache Zookeeper. It supplies a cluster model that is updated as members join and leave the cluster, and an implementation of the SettingsStore interface that stores settings in Zookeeper. Joining and Leaving a KivaKit Microservice Cluster To use KivaKit in a cluster, Apache Zookeeper must be running according ...

Read More »

KivaKit XML Streaming

java-interview-questions-answers

KivaKit XML Streaming   Since Java 1.6 in 2006, Java has had a built-in XML streaming API in the package javax.xml.stream. This API is known as StAX (Streaming API for XML), and it is a very efficient “pull parser”, allowing clients to iterate through the sequence of elements in an XML document. Other approaches to working with XML are event-handling ...

Read More »

KivaKit Microservices

java-interview-questions-answers

KivaKit Microservices   KivaKit is designed to make coding microservices faster and easier. In this blog post, we will examine the kivakit-microservice module. As of this date, this module is only available for early access via SNAPSHOT builds and by building KivaKit. The final release of KivaKit 1.1 will include this module and should happen by the end of October, ...

Read More »

Signaling and waiting for concurrent state changes

java-interview-questions-answers

Java’s concurrency library (java.util.concurrent) provides a mutual-exclusion (mutex) Lock called ReentrantLock. This lock maintains a queue of threads that are waiting to own the lock, allowing access to a protected resource. A thread can be added to the lock’s wait queue by calling lock(). When the lock() method returns, the thread will own the lock. Once the thread obtains the ...

Read More »

Kivakit Build

java-interview-questions-answers

A poor man’s multiple-repository build system Refactoring feature branches across multiple repositories A common use case when working with multiple, dependent repositories is to use git flow to create multiple feature branches: kivakit [feature/simplify-log-api] kivakit-extensions [feature/simplify-log-api] If project(s) in kivakit-extensions here depend on projects in kivakit, refactoring code in kivakit can propagate code changes to kivakit-extensions. Then both feature branches ...

Read More »

KivaKit deployments

java-interview-questions-answers

KivaKit applications can be configured using the settings api, but there is an easier way to configure an application for deployment built right into Application. By default, Application looks for the switch -deployment=[deployment-name]. If the switch is present and deployment settings can be found, KivaKit will load all of the settings objects in the named deployment into the global settings ...

Read More »

KivaKit resources

java-interview-questions-answers

A resource is a stream of data that can be opened, read from or written to, and then closed. KivaKit provides a resource mini-framework that allows easy and consistent access to many types of resources, and it makes it easy to create new resources. Examples of KivaKit resources include: FilesSocketsZip or JAR file entriesS3 objectsPackage resourcesHDFS filesHTTP responsesInput streamsOutput streams ...

Read More »