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
10
votes
1 answer

How do I handle RabbitMQ Consumer Cancellation Notification when using Spring ChannelAwareMessageListener

Newbie to RabbitMQ and new to Java. I'm attempting to write a listener that will use manual acks and handle consumer cancellation notifications using the java Spring AMQP abstraction. Can I accomplish both tasks by using the Spring abstraction? I…
SamAxe
  • 101
  • 1
  • 4
10
votes
2 answers

RabbitMQ suspend queue consumption

What is the best way to keep a durable queue and its bindings but suspend its consumers? The use case is: I would like to "let it crash" and stop handling messages if we keep getting a bunch of messages we can't deal with (e.g. the database is down…
Adam Gent
  • 47,843
  • 23
  • 153
  • 203
9
votes
2 answers

when does an AMQP/RabbitMQ channel with no connections die?

I have a simple RabbitMQ test program randomly enqueuing messages, and another reading them, all using Spring-AMQP. If the consumer dies (for example killing a process without having a chance to close its connection or channel), any messages that it…
Joe Kearney
  • 7,397
  • 6
  • 34
  • 45
9
votes
2 answers

What's the difference between SimpleMessageListenerContainer and DirectMessageListenerContainer in Spring AMQP?

What's the difference between SimpleMessageListenerContainer and DirectMessageListenerContainer in Spring AMQP? I checked both of their documentation pages, SimpleMessageListenerContainer has almost no explanation on inner workings, and…
Mansur
  • 1,661
  • 3
  • 17
  • 41
9
votes
1 answer

Configuring ConnectionFactory for RabbitMQ in Spring Boot AMQP

TL;DR How to create Spring Boot AMQP connection factory programatically? Hey, In order to connect to my RabbitMQ I added these to my application.properties file of my Spring Boot…
Airwavezx
  • 898
  • 5
  • 14
  • 26
9
votes
1 answer

Spring AMQP (Rabbit) Listener goes in a loop in case of exception

@Bean RabbitTemplate rabbitTemplate() { RabbitTemplate template = new RabbitTemplate(rabbitConnectionFactory()); template.setMessageConverter(messageConverter); template.setExchange(amqpProperties.getRabbitMqTopicExchangeName()); …
Sannu
  • 1,202
  • 4
  • 21
  • 32
9
votes
2 answers

RabbitMQ and Delivery Guarantees in Distributed Database Transaction

I am trying to understand what is the right pattern to deal with RabbitMQ deliveries in the context of distributed database transaction. To make this simple, I will illustrate my ideas in pseudocode, but I'm in fact using Spring AMQP to implement…
Edwin Dalorzo
  • 76,803
  • 25
  • 144
  • 205
9
votes
1 answer

how to mark a message as persistent using spring-rabbitmq?

This is how I'm creating an exchange and binding a queue to it
Lalit Mehra
  • 1,183
  • 1
  • 13
  • 33
9
votes
4 answers

JUnit Tests for RabbitMQ

I am building an application using RabbitMQ with Spring: so far so good. To define Unit Tests I am using JUnit targeting an external server. What I wanted to find out is if there is a way to mock the RabbitMQ server to perform tests, and if there…
Ing. Luca Stucchi
  • 3,070
  • 6
  • 36
  • 58
9
votes
2 answers

Spring AMQP RabbitMQ implementing priority queue

After Google for a few days, and i believe i am totally lost. I would like to implement a kind of priority queue that has about 3 queues: high priority queue (daily), that needs to be process first. mid priority queue (weekly), that will process…
Reusable
  • 1,888
  • 7
  • 27
  • 46
8
votes
6 answers

Where is the spring rabbit XSD (schema location for the rabbit: namespace)

http://static.springsource.org/spring-amqp/docs/1.0.x/reference/html/ mentions the rabbit: namespace, but never mentions what is the schema location. Googling (and naming conventions) ended up with:…
Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
8
votes
1 answer

Sending the message to specific RabbitMQ Queue using SpringIntegration Java DSL

I'm working on a Java application which uses Spring Boot version 2.0.4.RELEASE and RabbitMQ version 3.7.7. The app is caching all the messages from the RabbitMQ in Redis database and has to resend when a new Queue is created in RabbitMQ. Currently,…
Vimal David
  • 555
  • 2
  • 7
  • 20
8
votes
2 answers

What's the earliest point of entry to read a rabbit message in spring-amqp?

I store thread-local rabbit message data in an MDC. I would like to clear the old and add new context data for an incoming rabbit message, like reading certain values from the headers or reading the rabbit message payload as a byte[]. Unfortunately…
kinbiko
  • 2,066
  • 1
  • 28
  • 40
8
votes
2 answers

Which one to use RabbitTemplate or AmqpTemplate?

I have the following program written in Spring Boot which is working fine. However, the problem is that the I am not sure whether I should be using RabbitTemplate or AmqpTemplate. Some of the online examples/tutorials use RabbitTemplate while others…
Nital
  • 5,784
  • 26
  • 103
  • 195
8
votes
1 answer

SpringAMQP RabbitMQ how to send directly to Queue without Exchange

I'm using SpringAMQP with Rabbit template. How to send messages directly to Queues omitting Exchange? How can i do it?
munja777
  • 109
  • 1
  • 2