In short, Kafka is a horizontally scalable streaming platform.
In other words, Kafka is a message broker which can be run on multiple servers as a cluster.
Different data streams are called topics.
Producers can place messages on a topic whereas consumers can subscribe to topics.
Topics can be configured for single- and multiple delivery of messages.
Consumers can be grouped in so called consumer-groups, which makes it possible for multiple consumers to act as one when it comes to single-delivery.
Normally when using swagger, you generate a swagger.yaml file for your API.
But what if you already have a swagger.yaml file and you want to generate the API interface and models, like you would also do with a webservice using a WSDL file?
To achieve this, swagger has a great tool: swagger-codegen.
The tool has a CLI and a maven plugin, but no gradle plugin. So how do we use it with gradle?
Continue reading →
Defining tables in Asciidoctor is very easy. The start and end of the table are defined by |===.
But if we want to add a new table to a table cell we cannot use the same syntax.
To define a nested table we must replace the | separator with !.
So instead of |=== to indicate the table boundaries we use !===.
Also the cell separators are now ! instead of |.
Finally we must make sure the table cell or column supports Asciidoc markup, so the table is properly created.
We must configure the cell or column with a so the nested table is created.
In the following example Asciidoctor markup we have a simple table with a nested table in the second column and row.
Notice we can still apply all table configuration to the nested table as well:
Continue reading →
Gradle has incremental build support to speed up our builds.
This means Gradle checks input and output for a task and if something changed the task is executed, otherwise the task is skipped.
In previous posts we learned how to add incremental build support to our tasks with annotations and inputs and outputs property of a task.
When we have a task that has an output file for an input file, like with transformations, we can have a more efficient task using an incremental task action.
With an incremental task action we have extra information on the files that are handled by the task.
We can have different actions based on if an input file is out of date or removed.
This way we can handle only the input files that have changed or removed with incremental builds, instead of all the input files.
To create an incremental task action we must have a task action method (annotated with @TaskAction) that has a single argument of type IncrementalTaskInputs.
The IncrementalTaskInputs class has the method outOfDate and removed.
These methods take an action, that can be implemented with a closure, with an instance of InputFileDetails as argument.
We can get to the input file via this instance and use that for our task logic.
When an input file is out of date, because the file contents has changed or the output file has been removed, the action we defined for the outOfDate method is invoked.
If the input file is removed the action for the method removed is invoked.
Continue reading →