spring-rabbit

Delay message to send to listener using Spring AMQP

独自空忆成欢 提交于 2021-02-19 04:22:30
问题 I have a requirement to send message to MessageListener after certain duration , So is there any way to achieve using Spring AMQP. Eg . Producer produces the message and message goes to RabbitMQ Q , The message gets received Listener listening to that Q immediately, I want to delay that message to be received at consumer side say after some configuration parameter say 1000ms 回答1: The RabbitMQ provides for this purpose Delayed Exchange feature. Starting with version 1.6 Spring AMQP also

How to resolve RabbitMQ Server connection error in Spring-cloud-sleuth-zipkin (Edgware.SR5)

不想你离开。 提交于 2021-02-10 13:51:22
问题 I need to send spans through RabbitMQ to Zipkin. I'm Using Spring-Cloud-Sleuth Edgware-SR5 version and SpringBoot 1.5.3.RELEASE versions. With older Spring-cloud sleuth version (spring-cloud-stream-binder-rabbit - v1.1.4.RELEASE) it was working fine. When I try to start the service, I'm getting " "AsyncReporter{RabbitMQSender{addresses=[localhost:5672], queue=zipkin}}. Unable to establish connection to RabbitMQ server" error. I have gone through the documentations, but I could't able to

How to avoid shutdown of SimpleMessageListenerContainer in case of unexpected errors?

谁都会走 提交于 2021-02-07 09:16:08
问题 I am using Java boot 1.4.0 and 'spring-boot-starter-amqp' for connecting to rabbitMq. The message producer, consumer and the rabbitMq server are under my control.Things were working fine for a few months in production. But suddenly my consumer stopped with exceptions given below. As I only produce messages which are always valid, I had no clue what went wrong. But this caused my listener-container to shutdown. And hence my message processing stopped.I had to manually restart my message

How to avoid shutdown of SimpleMessageListenerContainer in case of unexpected errors?

元气小坏坏 提交于 2021-02-07 09:15:57
问题 I am using Java boot 1.4.0 and 'spring-boot-starter-amqp' for connecting to rabbitMq. The message producer, consumer and the rabbitMq server are under my control.Things were working fine for a few months in production. But suddenly my consumer stopped with exceptions given below. As I only produce messages which are always valid, I had no clue what went wrong. But this caused my listener-container to shutdown. And hence my message processing stopped.I had to manually restart my message

Rabbit Spring Boot properties

点点圈 提交于 2021-01-29 03:53:40
问题 What is the key difference between the following properties : 1)spring.rabbitmq.listener.direct.prefetch= # Number of messages to be handled in a single request. It should be greater than or equal to the transaction size (if used). 2)spring.rabbitmq.listener.simple.prefetch= # Number of messages to be handled in a single request. It should be greater than or equal to the transaction size (if used). 回答1: With Spring AMQP 1.7.x and earlier (boot 1.5.x uses that version), there was only one

Spring AMQP - Proper way to register queues to container on startup

扶醉桌前 提交于 2021-01-07 03:28:56
问题 I have a situation where I need to register queues dynamically in a run-time to a SimpleMessageListenerContainer . The problem I am experiencing is a deadlock that happens because of this: Thread: [52] Thread1 wants the lock java.lang.Object@5537e0df org.springframework.amqp.rabbit.connection.CachingConnectionFactory.getDeferredCloseExecutor(CachingConnectionFactory.java:907) org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.restart(SimpleMessageListenerContainer.java

Spring AMQP - Proper way to register queues to container on startup

懵懂的女人 提交于 2021-01-07 03:27:41
问题 I have a situation where I need to register queues dynamically in a run-time to a SimpleMessageListenerContainer . The problem I am experiencing is a deadlock that happens because of this: Thread: [52] Thread1 wants the lock java.lang.Object@5537e0df org.springframework.amqp.rabbit.connection.CachingConnectionFactory.getDeferredCloseExecutor(CachingConnectionFactory.java:907) org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.restart(SimpleMessageListenerContainer.java

how configure timeouts, retries or max-attempts in differents queues with spring rabbitmq

 ̄綄美尐妖づ 提交于 2021-01-03 07:08:40
问题 Is it possible to make these settings for each queue? I have queues that are important so i need a larger number of retries, but have less important queues that I do not want to configure retry, attempt, etc public Queue newQueue(String name) { return new Queue(name, durable, exclusive, autoDelete, arguments); } I saw that in the Queue class, it is possible to pass an argument map as the last parameter, but I do not know if it would be here, or via properties. 回答1: In my case I had to create

Spring Reactive Stream - Unexpected Shutdown

巧了我就是萌 提交于 2021-01-02 03:10:17
问题 We are using Spring Cloud Reactive Streams with RabbitMQ. Spring Reactive Stream appears to acknowledge the message as soon as it pulls it off the queue. So any errors unhandled exceptions that happens during the message processing need to be handled in the application (which is a different than a non-reactive stream where unhandled exceptions can be thrown and a message would be rejected, thus sending it to a dead letter queue). How are we supposed to deal with a sudden shutdown in an

RabbitMQ Failed to declare queue and Listener is not able to get queue on server

主宰稳场 提交于 2020-12-31 08:46:38
问题 I have spring boot rabbitmq application where i have to send an Employee object to queue. Then i have set up a listener application. Do some processing on employee object and put this object in call back queue. For this, i have created below objects in my appication. Created ConnectionFactory . Created RabbitAdmin object using ConnectionFactory .. Request Queue. Callback Queue. Direct Exchange. Request Queue Binding. Callback Queue Binding. MessageConverter. RabbitTemplate object. And finally