Search code examples
springapache-kafkaspring-integrationactivemq-classicspring-dsl

Spring Integration - ActiveMQ to Kafka


I am currently trying to write an adapter which will consume messages from ActiveMQ and publish it to Kafka.

I am thinking of using spring integration to integrate these two messaging systems.

My problem is that my application will not maintain registry of the Models using which many applications will publish the records to activeMQ. I want to receive these javax jms message and want to perform some transformation like adding jmscorrelationId into kafka message.

ALso, another requirement is to send acknowledgement to active mq only when kafka send/publish is successfull.

Can ack be send back to activemq using spring integration?

Will spring integration be a good option?

Kindly note my tech architect is not in favor of using Camel/Mule. Also, he does not want to use Kafka Connect as i was planning to use Kafka connect source.

Please suggest.


Solution

  • The Spring Integration Kafka extension project has a sync mode for publishing, which will block the thread until Kafka confirms delivery (or throw an exception on a failure).

    The JMS inbound gateway can be used to return a reply to a JMS queue.

    You can add transformers (or whatever) in the flow to modify the message.