You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases we want to only send certain events via Kafka. Also a typical Kafka setup is using a different topic for each message type. It would be nice if this was configurable.
Current Behaviour
Currently there is just one topic to which all events are sent.
Wanted Behaviour
Add an optional mapping lambda, from EventMessage to Optional KafkaPublisher<String, byte[]>. By default this will send all events to the default "Axon.Events" topic, if a topic is used in the builder, it will use a lambda that always returns the set topic.
If the lambda returns an empty optional the event will be skipped. Note that by using the lamda on the EventMessage, it's both versatile, and we can skip the conversion step if the event doesn't need to be sent via Kafka.
Something like:
m -> {
if (m.getPayloadType() instanceofWantedEvent) {
returnOptional.of("wanted-events-topic");
} else {
returnOptional.empty()
}
}
Possible Workarounds
Skipping the extension, and doing it yourself, for example with Spring Cloud Streams, which needs a lot more code to setup.
The text was updated successfully, but these errors were encountered:
Feature Description
In some cases we want to only send certain events via Kafka. Also a typical Kafka setup is using a different topic for each message type. It would be nice if this was configurable.
Current Behaviour
Currently there is just one topic to which all events are sent.
Wanted Behaviour
Add an optional mapping lambda, from EventMessage to Optional KafkaPublisher<String, byte[]>. By default this will send all events to the default "Axon.Events" topic, if a topic is used in the builder, it will use a lambda that always returns the set topic.
If the lambda returns an empty optional the event will be skipped. Note that by using the lamda on the EventMessage, it's both versatile, and we can skip the conversion step if the event doesn't need to be sent via Kafka.
Something like:
Possible Workarounds
Skipping the extension, and doing it yourself, for example with Spring Cloud Streams, which needs a lot more code to setup.
The text was updated successfully, but these errors were encountered: