demos/kafka/wordcount
2 years agosplitter: 1.0.0-spring-ingetration - fixed the ordering of the messages splitter-spring-integration
Kai Moritz [Wed, 20 Jul 2022 19:02:42 +0000 (21:02 +0200)]
splitter: 1.0.0-spring-ingetration - fixed the ordering of the messages

* Added a `ChannelInterceptor` to the `KafkaSubscribableChannel`, that
  adds the value of the `key`-Header as Header `kafka_messageKey`).
* This fixes the ordering, because now, all words, that are split of from
  a recording of a user are send with the same key.

2 years agosplitter: 1.0.0-spring-ingetration - test case for the order of messages
Kai Moritz [Wed, 20 Jul 2022 18:34:19 +0000 (20:34 +0200)]
splitter: 1.0.0-spring-ingetration - test case for the order of messages

* Refined the tests, to show the disturbed order of the received messages.
* Sending more words.
* Added a new test, that sends recordings for several users.

2 years agosplitter: 1.0.0-spring-ingetration - added an interceptor for logging
Kai Moritz [Mon, 18 Jul 2022 20:48:26 +0000 (22:48 +0200)]
splitter: 1.0.0-spring-ingetration - added an interceptor for logging

* Added a global interceptor, that uses `WireTap` to copy the messages
  to a special channel for logging, named `messageLog`.
* Added a `LoggingHandler`, that logs the messages, that are accumulated
  in the new channel `messageLog`.

2 years agosplitter: 1.0.0-spring-ingetration - kafka-backed channels
Kai Moritz [Mon, 18 Jul 2022 16:09:41 +0000 (18:09 +0200)]
splitter: 1.0.0-spring-ingetration - kafka-backed channels

* This configuration uses `SubscribableKafkaChannel` to configure
  kafka-backed channels for the message-channels `recordings` and `words`.
* Since the header `kafka_messageKey` is not set, the messages are send
  with `null`-keys. Hence, the order of the messages will be lost for
  topics with more than one partition.

2 years agosplitter: 1.0.0-spring-ingetration - extract the key on the inbound channel
Kai Moritz [Mon, 18 Jul 2022 19:20:10 +0000 (21:20 +0200)]
splitter: 1.0.0-spring-ingetration - extract the key on the inbound channel

* The key of the Kafka-Message is extracted on the inbound channel with
  a `HeaderEnricher`.
* This way, the key is propagated to dreived messages automatically.

2 years agosplitter: 1.0.0-spring-ingetration - message-driven channel-adapter
Kai Moritz [Sun, 17 Jul 2022 17:03:18 +0000 (19:03 +0200)]
splitter: 1.0.0-spring-ingetration - message-driven channel-adapter

* Instead of the `@InboundChannelAdapter`-annotation, a
  `KafkaMessageDrivenChannelAdapter` can be instanciated.
* The adapter takes a `AbstractMessageListenerContainer` as constructor
  argument.
* The output-channel must be set explicitly on the created instance.
* This approach is advantageous, if technical details are important,
  because the used `MessageListenerContainer` can be configured explicitly.

2 years agosplitter: 1.0.0-spring-ingetration - using a `message-key-expression`
Kai Moritz [Sun, 17 Jul 2022 15:11:03 +0000 (17:11 +0200)]
splitter: 1.0.0-spring-ingetration - using a `message-key-expression`

* The configuration can be simplified
* The `ChannelInterceptor` can be omitted, if a `message-key-expression`
  is specivied for the outbound channel.

2 years agosplitter: 1.0.0-spring-integration - refactored configuration
Kai Moritz [Thu, 30 Jun 2022 19:34:21 +0000 (21:34 +0200)]
splitter: 1.0.0-spring-integration - refactored configuration

2 years agosplitter: 1.0.0-spring-integration - Added the key of the incoming message
Kai Moritz [Sun, 26 Jun 2022 16:07:32 +0000 (18:07 +0200)]
splitter: 1.0.0-spring-integration - Added the key of the incoming message

* Added a `ChannelInterceptor`, that copies the key from the received
  message to the outgoing message.
* This fixes the test.

2 years agosplitter: 1.0.0-spring-integration - Inital implementation (incomplete)
Kai Moritz [Sun, 26 Jun 2022 12:05:11 +0000 (14:05 +0200)]
splitter: 1.0.0-spring-integration - Inital implementation (incomplete)

* "Implementing" the splitter with Spring Integration mainly is a
  configuration task.
* This version does not yet send the messages with the correct key.
* Managment of transactions is not yet considered.
* The test fails, because the key is missing.

2 years agosplitter: Implemented a test that proofs the splitting process splitter-vanilla-kafka
Kai Moritz [Thu, 30 Jun 2022 17:06:09 +0000 (19:06 +0200)]
splitter: Implemented a test that proofs the splitting process

2 years agosplitter: 1.0.0-vanilla-kafka - Fixed shutdown
Kai Moritz [Thu, 30 Jun 2022 16:53:46 +0000 (18:53 +0200)]
splitter: 1.0.0-vanilla-kafka - Fixed shutdown

* The shutdown was blocked, because tSplitterStreamProcessor.stop()
  was called twice.
* The second time, it could no longer reach the cluster, hence, blocking
  the shutdown process.

2 years agosplitter: 1.0.0-vanilla-kafka - Factored out splitting logic
Kai Moritz [Sun, 26 Jun 2022 11:05:46 +0000 (13:05 +0200)]
splitter: 1.0.0-vanilla-kafka - Factored out splitting logic

2 years agosplitter: 1.0.0-vanilla-kafka - Fixed the test "Context Loads"
Kai Moritz [Sun, 26 Jun 2022 08:54:39 +0000 (10:54 +0200)]
splitter: 1.0.0-vanilla-kafka - Fixed the test "Context Loads"

* Added `spring-kafka-test` as dependency.
* Added `@EmbeddedKafka` to the integration test.
* Configured the test to support transactions (replication factor == 1).
* Fixed the `SplitterStreamProcessor`: the application logic is executed
  in a background thread, because it blocks the startup of Spring Boot
  otherwise.

2 years agosplitter: 1.0.0-vanilla-kafka - upgraded Spring Boot to 2.7.2
Kai Moritz [Sun, 26 Jun 2022 07:39:12 +0000 (09:39 +0200)]
splitter: 1.0.0-vanilla-kafka - upgraded Spring Boot to 2.7.2

2 years agosplitter: 1.0.0-vanilla-kafka - splits up the recorded sentences into words
Kai Moritz [Fri, 27 May 2022 12:38:43 +0000 (14:38 +0200)]
splitter: 1.0.0-vanilla-kafka - splits up the recorded sentences into words

* Simple implementation of the splitter without Kafka Streams
* This version does not record its position
* Hence, in case of an error, it will most likly reprocess some messages,
  leading to wrong countings

3 years agorecorder: 1.0.1 - changed default-port and exposed all actuator-endpoints recorder-1.0.1
Kai Moritz [Sat, 16 Oct 2021 14:39:52 +0000 (16:39 +0200)]
recorder: 1.0.1 - changed default-port and exposed all actuator-endpoints

3 years agorecorder:1.0.0 - send recordings keyed by username recorder-1.0.0
Kai Moritz [Wed, 1 Sep 2021 16:42:29 +0000 (18:42 +0200)]
recorder:1.0.0 - send recordings keyed by username

3 years agoGenerated empty project on start.spring.io
Kai Moritz [Wed, 1 Sep 2021 15:49:48 +0000 (17:49 +0200)]
Generated empty project on start.spring.io