Search code examples
apache-kafkajakarta-eewildflysmallrye-reactive-messaging

Add smallrye-in-memory connector to Wildfly (Reduce redeployment time during development)


During development redeploy time is critical, so it would be nice to eliminate as much as possible. In my Jakarta EE 10 .war project I connected 10 channels to Kafka topics via microprofile reactive streams. I bring up Kafka via Docker before and deploy the .war to Wildfly 28.0.1 which use smallrye-reactive-messaging. The channels are connected after the deployment is finished and this takes only a short amount of time.

But on undeployment the channels are closed synchronously one by one and the overall time is up to 10 seconds. I checked out if it is possible to reduce this time, by defining a shorter timeout or something else. But I did not find anything what can be configured here.

So my question would be if it is possible to add the smallrye-in-memory connector to Wildfly and use it during development? This would also reduce the dependency to a running Kafka during development.


Solution

  • Kafka connector waits some grace period while closing channels to ensure that ongoing message processing and messages pending for sending are terminated.

    These can be adjusted using configuration options: graceful-shutdown (true by default) for incoming channels and close-timeout (10s by default) for outgoing channels.

    Hope this helps.