spring-rabbitmq

spring-rabbit JSON deserialization for ArrayList contents

筅森魡賤 提交于 2019-12-11 03:32:53
问题 I am using Spring-boot with rabbitmq with JSON message serialization. Replies using the Direct-Reply-to feature cannot deserialize my classes inside the java.util.List container. Using my debugger in Jackson2JsonMessageConverter.fromMessage() , the MessageProperties states the __TypeID__ is correctly set to java.util.ArrayList . However the __ContentTypeId__ is java.lang.Object is incorrect as I would be expecting FooDto (I assume...). The exception message is: java.lang.ClassCastException:

exception handling for rabbitmq listener in spring

ε祈祈猫儿з 提交于 2019-12-11 02:38:12
问题 Working with spring, I am new to rabbitmq, i want to know where i am wrong. I have written a rabbitmq connection factory, and a listener container containing a listener. I have also provided the listener container with an error handler but it doesnt seems to work. My spring beans: <rabbit:connection-factory id="RabbitMQConnectionFactory" virtual-host="${rabbitmq.vhost}" host="${rabbitmq.host}" port="${rabbitmq.port}" username="${rabbitmq.username}" password="${rabbitmq.password}"/> <rabbit

Rabbitmq: Unacked message not going away after broker restart

微笑、不失礼 提交于 2019-12-11 02:31:08
问题 We have observed the following behavior of RabbitMQ and are trying to understand if it is correct and how to resolve it. Scenario: A (persistent) message is delivered into a durable queue The (single) Consumer (Spring-AMQP) takes the message and starts processing => Message goes from READY to UNACK Now the broker is shut down => Client correctly reports "Channel shutdown" The consumer finishes the processing, but can not acknowledge the message as the broker is still down Broker is started

Increase heartbeat value in spring rabbit

感情迁移 提交于 2019-12-10 21:01:00
问题 I'm facing some problems with my setup and I'm trying to increase the heartbeat interval in order to test a possible fix. I'm using Spring boot 1.3.2.RELEASE Spring rabbit 1.5.3.RELEASE And the code instantiating the connection factory is the below RabbitConnectionFactoryBean connectionFactoryBean = new RabbitConnectionFactoryBean(); connectionFactoryBean.setUseSSL(useSsl); connectionFactoryBean.setHost(rabbitHostname); connectionFactoryBean.setVirtualHost(rabbitVhost); connectionFactoryBean

RabbitMQ java client stops consuming messages

允我心安 提交于 2019-12-10 15:22:05
问题 My application consumes some messages from RabbitMQ and processes them. I have about 10 queues and each queue has up to ten consumers (threads). I have a prefetch of 5. I'm running my setup in Heroku using the CloudAMQP plugin (RabbitMQ as a service). I'm running with the default heartbeat and connection timeout settings (60 seconds). My java application is a spring boot application using the spring-rabbit library. Versions: RabbitMQ 3.5.3 Erlang 17.5.3 Java 1.8 Spring boot 1.3.2.RELEASE

Designing Complex Notification system in spring

心已入冬 提交于 2019-12-08 07:23:09
问题 I want to design and implement a complex notification system where I have a user which will be automatically and manually subscribed to different events. After some research I made up my mind to go with websockets for pushing the notifications to client, and for subscribing the events I would go for RabbitMQ specifically I would go for direct exchange. At first thoughts I was thinking after establishing the websocket connection I would send the userId which will be subscribed with the

Return message to the end of queue in rabbitmq

北慕城南 提交于 2019-12-08 06:19:09
问题 I have exchange and queue. Producer doesn't need consumption confirmation, but messages in some cases can be un-processable by consumer in current moment, because of lack of other data. Because of this, I want to return those messages to the end of queue. How to do this? Or is it done automatically when I reject message? Flow: Message1 gets consumed and creates some record in database. Message2 gets consumed and checks if there is record in database, and if yes, then it updates the record. If

Spring boot stream bind queue with multiple routing keys

别等时光非礼了梦想. 提交于 2019-12-08 06:05:20
问题 I need to bind single queue with multiple routing keys. I have configuration in application.properties: spring.cloud.stream.bindings.some-channel1.destination=exch spring.cloud.stream.bindings.some-channel1.group=a-queue spring.cloud.stream.rabbit.bindings.some-channel1.consumer.binding-routing-key=event.domain1 spring.cloud.stream.bindings.some-channel2.destination=exch spring.cloud.stream.bindings.some-channel2.group=a-queue spring.cloud.stream.rabbit.bindings.some-channel2.consumer.binding

Designing Complex Notification system in spring

 ̄綄美尐妖づ 提交于 2019-12-08 04:08:27
I want to design and implement a complex notification system where I have a user which will be automatically and manually subscribed to different events. After some research I made up my mind to go with websockets for pushing the notifications to client, and for subscribing the events I would go for RabbitMQ specifically I would go for direct exchange. At first thoughts I was thinking after establishing the websocket connection I would send the userId which will be subscribed with the exchange in the RabbitMQ, any change will be sent with the userId of this change and that is how I would get

Automatic retry connection to broker by spring-rabbitmq

孤者浪人 提交于 2019-12-07 08:20:27
问题 I have read this fragment of docs: RabbitMQ Automatic Connection/Topology recovery Since the first version of Spring AMQP, the framework has provided its own connection and channel recovery in the event of a broker failure. Also, as discussed in Section 3.1.10, “Configuring the broker”, the RabbitAdmin will re-declare any infrastructure beans (queues etc) when the connection is re-established. It therefore does not rely on the Auto Recovery that is now provided by the amqp-client library.