spring-amqp

RabbitMQ RPC across multiple rabbitMQ instances

╄→尐↘猪︶ㄣ 提交于 2019-11-27 17:46:21
问题 I have three clients each with their own RabbitMQ instances and I have an application (let's call it appA) that has its own RabbitMQ instance, the three client applications (app1, app2, app3) wants to make use of a service on appA. The service on appA requires RPC communication, app1, app2 and app3 each has a booking.request queue and a booking.response queue. With the shovel plugin, I can forward all booking.request messages from app1-3 to appA: Shovel1 virtualHost=appA, name=booking-request

spring boot rabbitmq MappingJackson2MessageConverter custom object conversion

扶醉桌前 提交于 2019-11-27 16:23:08
问题 I'm trying to create a simple spring boot app with spring boot that "produce" messages to a rabbitmq exchange/queue and another sample spring boot app that "consume" these messages. So I have two apps (or microservices if you wish). 1) "producer" microservice 2) "consumer" microservice The "producer" has 2 domain objects. Foo and Bar which should be converted to json and send to rabbitmq. The "consumer" should receive and convert the json message into a domain Foo and Bar respectively. For

How to stop consuming messages with @RabbitListener

前提是你 提交于 2019-11-27 15:18:41
问题 When I use MessageListenerAdapter to handle message, I could call SimpleMessageListenerContainer.stop() to stop consume from the queue. But after I change to use @RabbitListener to listen, I can't find a method like this. I tried CachingConnectionFactory.stop() but doesn't work. Could anyone help? Thank you very much. 回答1: Give the @RabbitListener an id . Get a reference to the listener endpoint registry bean by autowiring etc. Calling stop() on the registry will stop all containers. Call

Spring amqp with RabbitMq: Message is not circled back to live queue after falling off dead letter queue

雨燕双飞 提交于 2019-11-27 08:33:16
问题 I am trying to achieve this. There are so many conflicting answers to know if its possible or not. According to previous link, it is not possible. But in another question on this forum, somebody remarked that they were able to here and in the comment section here. So, Is it possible to do live queue => dead-letter-queue => live queue Or do I need to use a particular version of RabbitMq to achieve this ? I am able to do: live queue => dead-letter-queue and dead-letter-queue => live queue. 回答1:

How is concurrency in Spring AMQP Listener Container implemented?

流过昼夜 提交于 2019-11-27 02:39:09
问题 My container XML config: <rabbit:listener-container connection-factory="myConnectionFactory" acknowledge="none" concurrency="10" requeue-rejected="false"> <rabbit:listener ref="myListener" queues="myQueue"/> </rabbit:listener-container> and myListener is just a class @Component("myListener") public class MyListener implements MessageListener { @Autowired SomeDependency dependency; .... } I've specified concurrency="10" in my XML. What does this mean exactly ? I've found some docs. They are

Spring RabbitMQ - using manual channel acknowledgement on a service with @RabbitListener configuration

一曲冷凌霜 提交于 2019-11-26 19:38:21
问题 How to acknowledge the messages manually without using auto acknowledgement. Is there a way to use this along with the @RabbitListener and @EnableRabbit style of configuration. Most of the documentation tells us to use SimpleMessageListenerContainer along with ChannelAwareMessageListener . However using that we lose the flexibility that is provided with the annotations. I have configured my service as below : @Service public class EventReceiver { @Autowired private MessageSender messageSender