Alternative of #RabbitListner annotation in Reactor RabbitMQ - spring-boot

I want to use Reactor RabbitMQ for my existing RabbitMQ project with Spring boot(https://github.com/gotidhavalh/amqpdemo).
So I want to know how can I implement it and when any AMQP message is sent to any queue then how can I receive that AMQP message just like with #RabbitListner annotation in without Reactor case.

There is currently no support for #RabbitListener with the reactive client.

Related

Spring Integration Kafka : Inbound channel adapter vs message driven adapter

I am new to using spring integration kafka. I was reading the docs, and got confused between Inbound channel adapter and message driven channel adapters. Can some one explain the difference between them . Also does spring integration for kafka has some error handling mechanism like the one present in spring integration for amqp/rmq( using dlq).
PS : We are trying to move away from rabbit mq to kafka as source of messages in ithe spring integration framework
thanks,
The message-driven adapter is similar to the rabbitmq inbound adapter in that messages are "pushed" into your integration flow whenever records are available in the topic.
The inbound channel adapter uses the "pull" model, where you poll for messages on a schedule. There is an equivalent for RabbitMQ (since 5.0.1) but it's not currently configurable with XML.
some error handling mechanism
The SIK components are subclasses of the same classes as all other SI components, so the same facilities are generally available, yes.

emq and Spring AMQP

I am new to both Spring AMQP and MQTT world. I have a legacy application which uses Rabbitmq as broker for mqtt messages.There are plans to use emqtt as broker and I want to know if my existing listeners ( on mqtt topics) written using Spring AMQP can work with emqtt or not ? I am just trying to save the effort of rewriting all those listeners using MqttClient.
Thanks in advance.

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.
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.

Pollable StreamListener or MessageSource for RabbitMQ Queue

I have Spring Cloud Stream Rabbit project that sends messages to an rabbit exchange errorEx in case of errors in the flow.
I want to periodically(once in 5 mins) listen from the queue and process it.
Is there any way I can have a Pollable #StreamListener?
OR Can I configure a rabbitMQ org.springframework.integration.core.MessageSource so I can build a IntegrationFlow with a Poller?
Spring Integration AMQP doesn't provide a pollable adapter. #StreamListener only supports Subscribable channels.
You could use a custom MessageSource that uses a RabbitTemplate receive() operation to fetch messages.
Or, you could use the message-driven adapter and stop()/start() it as needed.

How to get properly all queue messages from RabbitMQ in Spring?

I am using Spring, Spring-Websocket, STOMP for my application, and RabbitMQ as broker. I need to log all messages going through RabbitMQ to Postgresql tables.
I know that I can write #MessageMapping in Spring and log there, but my problem is that some clients talk to RabbitMQ directly through MQTT protocol, and Spring does not support it yet (https://jira.spring.io/browse/SPR-12581). Moreover browser clients talk through Spring to RabbitMQ using STOMP protocol.
RabbitMQ allows to track all messages using Firehose tracer. How to properly listen to amq.rabbitmq.trace topic from Spring? Or do I need to write separate Java app as consumer?
The Spring AMQP is for you!
You bind some custom queue to to that amq.rabbitmq.trace with appropriate pattern (e.g. publish.#) and configure SimpleMessageListenerContainer to receive messages from that queue.
It can be done even with pretty simple config: #EnableRabbit and #RabbitListener on some POJO method. Anyway the Binding #Bean must be there to attache your queue to that exchange.

Resources