spring-amqp

SimpleMessageListenerContainer is continuously consuming after TransactionSystemException

爱⌒轻易说出口 提交于 2019-12-12 03:48:23
问题 I don't want the SimpleMessageListenerContainer to continuously consume the messages when my Transaction marked as rollback. I didn't add listener-container in my configuration file and trying to rethrow the AmqpRejectAndDontRequeueException . It is not working. Here is my codebase: @Transactional public class MySecondService { @Resource private MySecondRepository mySecondRepository; @Transactional(propagation = Propagation.REQUIRED) @ServiceActivator(inputChannel = "my-first-servie-output

How to throttle message subscription for a spring-amqp ascyn consumer?

橙三吉。 提交于 2019-12-12 02:36:15
问题 I have an async consumer configured via the spring-amqp framework: <listener-container connection-factory="connectionFactory" message-converter="jsonMessageConverter" xmlns="http://www.springframework.org/schema/rabbit"> <listener ref="requestHandler" method="handleMessage" queue-names="blah" /> </listener-container> An external event from a 3rd party app indicates to my server that its ready to process data, at such a time I would like to take messages from the queue that I'm subscribed to

Negative Acknowledgement to RabbitMQ Queue to Re-Queue the Message using Spring AMQP

﹥>﹥吖頭↗ 提交于 2019-12-12 01:56:26
问题 I have an application which uses spring AMQP for consuming and producing messages to other application. I have a scenario where some of the exception occurred i need to re-queue back to RabbitMQ. For some exceptions i need to ignore (Basically i need to ignore the message no need to requeue) Currently in below code, i have set the configuration as factory.setDefaultRequeueRejected(false); But my requirement is to dynamically reject for some messages and re-queue back to RabbitMQ for some

Null response for spring-amqp Request/Reply Messaging

半腔热情 提交于 2019-12-12 01:42:39
问题 I'm following the instructions for the Stock Trading sample, which outlines how to use request/reply messaging in spring-amqp : http://static.springsource.org/spring-amqp/docs/1.2.x/reference/html/sample-apps.html#d4e742 I've tweaked the sample instructions to create a client which should wait for the reply by using convertSendAndReceive instead of convertAndSend : https://gist.github.com/pulkitsinghal/5774487 Now even though the reply is put on the responseQueue and I've updated the timeout

How can we make producer in spring amqp rabbitmq waiting after sending all messages and release upon receiving all?

让人想犯罪 __ 提交于 2019-12-12 01:36:25
问题 I am queuing all messages to rabbitmq queue and processing those on remote server. Below is my producer and reply handler in same class. public class AmqpAsynchRpcItemWriter<T> implements ItemWriter<T>, MessageListener { protected String exchange; protected String routingKey; protected String queue; protected String replyQueue; protected RabbitTemplate template; // Reply handler @Override public void onMessage(Message message) { try { String corrId = new String(message.getMessageProperties()

Not able to process response received from template.convertSendAndReceive()

流过昼夜 提交于 2019-12-11 23:18:51
问题 I am trying to send message and receive response using following code MessageProperties props =MessagePropertiesBuilder.newInstance().setContentType(MessageProperties.CONTENT_TYPE_TEXT_PLAIN) .setMessageId("MSG12345").setHeader("type", "type1").setCorrelationId(UUID.randomUUID().toString().getBytes()).build(); Message message = MessageBuilder.withBody(input.getBytes()).andProperties(props).build(); Message response = (Message) template.convertSendAndReceive("key", message); But, its is

rabbitmq publish failed with PRECONDITION_FAILED - fast reply consumer does not exist

倾然丶 夕夏残阳落幕 提交于 2019-12-11 22:02:14
问题 We are getting the below error when we are posting a message to rabbitmq from a spring boot service. [AMQP Connection 123.11.xxx.xx:5672] ERROR [] org.springframework.amqp.rabbit.connection.CachingConnectionFactory - Channel shutdown: channel error; protocol method: #method(reply-code=406, reply-text=PRECONDITION_FAILED - fast reply consumer does not exist, class-id=60, method-id=40) Does anyone faced a similar issue with rabbitmq ? Please help us with your inputs. 来源: https://stackoverflow

How does ChunkMessageChannelItemWriter collect replies in spring batch remote chunking?

五迷三道 提交于 2019-12-11 21:17:33
问题 I am trying to implement remote chunking in spring batch using spring integration and amqp (rabbitmq). I am not able to understand how does ChunkMessageChannelItemWriter collect replies in remote chunking test below https://github.com/spring-projects/spring-batch/blob/master/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkStepIntegrationTests-context.xml How does it work ? Does it send one message, wait for its reply, receives its reply and

How do I handle content-type null with Jackson2JsonMessageConverter in Spring-AMQP

烈酒焚心 提交于 2019-12-11 18:42:26
问题 If it's not one problem, it's another... I seem to have gotten the 2 previous problems fixed but now when running outside of a test context, with a stood up application I see this. o.s.a.s.c.Jackson2JsonMessageConverter : Could not convert incoming message with content-type [null], 'json' keyword missing. Like before, this message seems fairly clear. Heck, things even worked in a standalone test context, however when running in a standalone server the code seems to be taking a different path

RabbitHandler to create consumer and retry on Fatal Exception in Spring for queue on listening to rabbitmq

时光毁灭记忆、已成空白 提交于 2019-12-11 17:18:07
问题 I am using Spring AMQP RabbitHandler and have wrote the following code:- @RabbitListener(queues = "#{testQueue.name}") public class Tut4Receiver { @RabbitHandler public void receiveMessage(String message){ System.out.println("Message received "+message); } } Also Queue is defined like:- @Bean public Queue testQueue() { return new AnonymousQueue(); } I am using seperate code to initialise the Connection Factory. My question is if rabbitmq is down for some time,it keeps on retrying to create a