spring-amqp

Expired Message Delivery Sequence RabbitMQ

我与影子孤独终老i 提交于 2020-02-02 12:59:19
问题 We are building a solution in which we are publishing message to a time-out queue. After TTL expiry messages are pushed to main queue for re-processing. We are setting up counter value so that messages will be tried for x no. of times for the redelivery. Solution is working fine. But the scenario is when the message on the head position is highest TTL is not expired, other messages of lower expiry will not be re-published (to main queue). Is this understanding correct ? If Yes what is the

Expired Message Delivery Sequence RabbitMQ

亡梦爱人 提交于 2020-02-02 12:59:12
问题 We are building a solution in which we are publishing message to a time-out queue. After TTL expiry messages are pushed to main queue for re-processing. We are setting up counter value so that messages will be tried for x no. of times for the redelivery. Solution is working fine. But the scenario is when the message on the head position is highest TTL is not expired, other messages of lower expiry will not be re-published (to main queue). Is this understanding correct ? If Yes what is the

RabbitMQ SSL Connection with spring-amqp 1.4.3

不羁的心 提交于 2020-01-13 06:14:09
问题 I am trying to connect to RabbitMQ over SSL. I have followed the RabbitMQ SSL documentation linked here https://www.rabbitmq.com/ssl.html As per RabbitMQ SSL documentation connecting using SSLv3 and TLSv1 is not recommeded due to known vulnerabilities. Due to this I have disabled these protocols on RabbitMQ as per instructions. I am using spring-amqp 1.4.3 to connect to RabbitMQ. Plese find below code snippet ApplicationContext context = new GenericXmlApplicationContext("classpath:/testConfig

RabbitMQ SSL Connection with spring-amqp 1.4.3

余生长醉 提交于 2020-01-13 06:13:47
问题 I am trying to connect to RabbitMQ over SSL. I have followed the RabbitMQ SSL documentation linked here https://www.rabbitmq.com/ssl.html As per RabbitMQ SSL documentation connecting using SSLv3 and TLSv1 is not recommeded due to known vulnerabilities. Due to this I have disabled these protocols on RabbitMQ as per instructions. I am using spring-amqp 1.4.3 to connect to RabbitMQ. Plese find below code snippet ApplicationContext context = new GenericXmlApplicationContext("classpath:/testConfig

Retrieving number of unacknowledged messages in RabbitMQ queue from Java/ Spring

筅森魡賤 提交于 2020-01-12 07:34:24
问题 is there any way to return the number of messages that are unacknowledged? I am using this code to get the number of messages in the queue: DeclareOk declareOk = amqpAdmin.getRabbitTemplate().execute( new ChannelCallback<DeclareOk>() { public DeclareOk doInRabbit(Channel channel) throws Exception { return channel.queueDeclarePassive(name); } }); return declareOk.getMessageCount(); but I would like to know as well the number of unacknowledged messages. I have seen that the RabbitMQ Admin tool

RabbitMQ listener stops listening messages when MessageListener throws exception

微笑、不失礼 提交于 2020-01-07 05:20:27
问题 I am using Spring AMQP for processing the messages in RabbitMQ. Below is the issue: 1. (say) there are 3 messages in ready state inside RabbitMQ 2. First one is picked up by MessageListener and starts processing. (say) It ends up throwing an exception 3. In this case, the container remains up but the remaining 2 messages are not processed until i restart the container. Also the first messages stays in unacknowledged state. Is it the expected behavior? If not, how to make sure that other 2

How to log Queue name in SimpleMessageListenerContainer.java

て烟熏妆下的殇ゞ 提交于 2020-01-06 04:17:04
问题 We're having issues with one of the consumers, and need to debug the code. SimpleRabbitListenerContainerFactory allows to set a ConsumerTagStrategy, which should add tags during logging. @Bean public SimpleRabbitListenerContainerFactory analyzeTransactionListenerContainerFactory(ConnectionFactory connectionFactory, AsyncTaskExecutor asyncTaskExecutor) { connectionFactory.getVirtualHost()); SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); factory

rabbitmq ReturnCallback stuck while declaring queue on NO_ROUTE(312)

笑着哭i 提交于 2020-01-05 06:26:10
问题 I am trying to use the publisher returns callback to declare queue and bindings if no route is available so that messages aren't dropped again. This is because my queue is auto-delete and would be deleted if my consumer goes down. But the ReturnCallback thread gets stuck in returnedMessage() at admin.declareQueue(queue). On Further debugging I see that it is stuck in RabbitAdmin.declareQueue() at: DeclareOk[] declared = declareQueues(channel, queue); Though this call is stuck, I see the queue

Spring AMQP multi-threaded producer

左心房为你撑大大i 提交于 2020-01-05 05:46:06
问题 I have a multi-threaded application that uses a RabbitTemplate (with CachingConnectionFactory) to send messages to the broker. I need to ensure that the messages are delivered in order. I have seen this answer about this myself in: Spring AMQP ensuring message order in multi-threaded environment Are these the only two options with Spring AMQP? What does a dedicated connection mean? I need to define a new RabbitTemplate with its ConnectionFactory in each java class that serves as the producer?

RabbitMQ SSL giving handshake failure when using SpringAMQP

╄→гoц情女王★ 提交于 2020-01-04 14:01:25
问题 I have rabbitMQ installed using the following configuration [ {rabbit, [ {ssl_listeners, [5671]}, {ssl_options, [{cacertfile,"C:\\dev\\rabbitcert\\testca\\cacert.pem"}, {certfile,"C:\\dev\\rabbitcert\\server\\cert.pem"}, {keyfile,"C:\\dev\\rabbitcert\\server\\key.pem"}, {verify,verify_peer}, {fail_if_no_peer_cert,false}]} ]} ]. And i am Instantiating the Connection Factory as such (data replaced with dummy): private static ConnectionFactory getConnectionFactoryForQueue(){ com.rabbitmq.client