Search code examples
springspring-integrationspring-rabbit

Spring Integration with consumer and Nifi as dispatcher


we are developing a service that listens or consume message from RabbitMQ queue. The message is dispatch from Apache Nifi to the message queue (e.g. queue name is "workitems").

Now, I would like to see a code snippet using Spring Integration to listen and process this message dispatched in the queue (RabbitMQ) from Apache Nifi.

Thanks!


Solution

  • It sounds like you need AMQP Channel Adapter from Spring Integration: https://docs.spring.io/spring-integration/docs/5.3.0.M4/reference/html/amqp.html#amqp-inbound-channel-adapter

    And here is a sample on the matter: https://github.com/spring-projects/spring-integration-samples/tree/master/basic/amqp