Questions tagged [spring-amqp]

Spring components for AMQP-based messaging.

The Spring AMQP project applies core Spring concepts to the development of AMQP-based messaging solutions. It provides a "template" as a high-level abstraction for sending and receiving messages. It also provides support for Message-driven POJOs. Its libraries facilitate management of AMQP resources while promoting the use of dependency injection and declarative configuration. In all of these cases, you will see similarities to the JMS support in the Spring Framework.

The spring-amqp sub-project is a general abstraction, with spring-rabbit being the implementation for RabbitMQ.

Resources

See Also

1608 questions
8
votes
1 answer

RabbitMQ sending message in transaction

Is it possible to run below code in a transaction so if an exception is thrown in the business processing we can roll back the message we sent to the queue? rabbitTemplate.convertAndSend("queue1", data); //do some…
user3444718
  • 1,485
  • 6
  • 22
  • 32
8
votes
2 answers

How to write an integration test for @RabbitListener annotation?

My question is really a follow up question to RabbitMQ Integration Test and Threading There it states to wrap "your listeners" and pass in a CountDownLatch and eventually all the threads will merge. This answer works if we were manually creating…
Selwyn
  • 3,118
  • 1
  • 26
  • 33
7
votes
2 answers

How do I know that my message was sent successfully with spring amqp?

I am writing to a RabbitMQ queue with spring amqp using the RabbitTemplate class. I use the convertAndSend method to send messages to the queue. This works well under normal situations, but it seems to fail silently if the queue doesn't exist. No…
Eric Milas
  • 1,807
  • 2
  • 18
  • 29
7
votes
2 answers

Rabbit mq prefetch undestanding

I understand below prefetch simply controls how many messsages the broker allows to be outstanding at the consumer at a time. When set to 1, this means the broker will send 1 message, wait for the ack, then send the next. but questions regarding…
user3444718
  • 1,485
  • 6
  • 22
  • 32
7
votes
2 answers

Spring Amqp internal NullPointerException on RabbitTemplate convertAndSend

I randomically experience a NullPointerException while trying to publish a message using RabbitTemplate.convertAndSend I tried both spring-amqp:1.7.6 and spring-amqp:1.7.8 and this should be the relevant part of my dependency tree: [INFO] | +-…
7
votes
4 answers

MessageConversionException: Failed to convert message content

I have a SpringBoot Application which makes use of Spring AMQP. At the moment I am implementing the receiver side of it using JavaConfig classes as directed by official Spring docs examples. However, I am receiving a MessageConversionException and…
7
votes
1 answer

RabbitMQ - Regex Implementation Topic Exchange

Suppose, If I have a binding key as "a.b.*" then I can use the routing keys as a.b.1, a.b.2, a.b.3 , a.b.4 and so on. I want the queue to accept messages from the all these routing keys except the routing key "a.b.3". How can that be…
Sagar Rout
  • 651
  • 1
  • 12
  • 29
7
votes
1 answer

Spring amqp: How can I read MessageProperties in MessageListenerAdapter

handleMessage method does not get the message from queue if I add MessageProperties in its signature. It works fine if there is no MessageProperties. How can I get MessageProperties in handleMessage of MessageListenerAdapter? public class…
user3400371
  • 109
  • 1
  • 9
7
votes
1 answer

Distributed Rabbitmq within a spring-cloud environment

I am trying to setup a distributed system based on current spring-cloud release (meaning mostly Netflix OSS) using the following components 1 or more cloud config servers 1 or more Eureka servers 1 or more services using Eureka and Config Server…
Alexandre Thenorio
  • 2,288
  • 3
  • 31
  • 50
7
votes
1 answer

Scheduled/Delay messaging in Spring AMQP RabbitMq

I am struggling hard to find out the way for scheduled/Delaying messages in Spring AMQP/Rabbit MQ.After hell lot of searching still I am not able to do that in Spring AMQP. Can someone please tell me how to do x-delay in Spring AMQP.I want to Delay…
Raghav Tandon
  • 183
  • 1
  • 2
  • 13
7
votes
1 answer

rabbitmq consume json message and convert into Java object

I have put together a java test. It puts a message on a queue and returns it as a string. What Im trying to achieve is for it to it convert into the java object SignUpDto. I have stripped down the code as much as possible for the question. The…
Robbo_UK
  • 11,351
  • 25
  • 81
  • 117
7
votes
3 answers

How to configure and receiveAndConvert jSON payload into domain Object in Spring Boot and RabbitMQ

Recently I have been having a keen interest on Microservice Architecture using Spring Boot. My implementation has two Spring boot applications; Application One receives requests from a RESTful API, converts and sends jSON payload to a RabbitMQ…
OchiengOlanga
  • 135
  • 1
  • 3
  • 11
7
votes
1 answer

"Channel shutdown: connection error"

I've set up on AWS a RabbitMQ cluster with two nodes, and enabled HA as described here. Then, I set up an Elastic Load Balancer mapping 5672 to the instances' 5672 port, with a periodic health check to the instances' 15672 port (the HTTP management…
Martin
  • 1,317
  • 3
  • 13
  • 18
7
votes
2 answers

RabbitMQ Integration Test and Threading

I have written a RabbitMQ consumer by implementing the MessageListener interface and setting up a SimpleMessageListenerContainer. Its working well when I test it manually. Now I would like to write an integration test that: Creates a message Pushes…
Ry Lowry
  • 173
  • 1
  • 7
7
votes
1 answer

Check if the Exchange with a specified name exist in rabbitmq

I have a scenario where there is an application which is generating different types of interesting events (not commands). The producer application does not care about by whom and how the events get processed. I am implementing a consumer who will…
Anand Patel
  • 6,031
  • 11
  • 48
  • 67