Questions tagged [spring-amqp]
Spring components for AMQP-based messaging.
1,531
questions
0
votes
1
answer
32
views
spring amqp (rabbitmq) and sending to DLQ when exception occurs
I am using org.springframework.boot:spring-boot-starter-amqp:2.6.6 .
According to the documentation, I set up @RabbitListener - I use SimpleRabbitListenerContainerFactory and the configuration looks ...
0
votes
1
answer
50
views
Creating a seperate conatiner per queue
I have a use case where we have a strict need that all of the queues have a dedicated thread and consumer, which means each thread will only serve one queue.
I have read this accepted answer and the ...
-1
votes
1
answer
33
views
Spring AMQP: Stopping a SimpleConsumer from DirectMessageListenerContainer
I have a use case where I am dynamically registering and removing a queue to and from a container based on some predicate. I am using a DirectMessageListenerContainer based on the advice given in the ...
0
votes
0
answers
12
views
Springboot RabbitMq no consumer connected
I'm using springboot and rabbitmq to receive a message.
The first consumer i created works, declared as below:
@Component
public class UserConsumer {
@Autowired
private RabbitTemplate ...
1
vote
1
answer
37
views
Handle Generic Type in RabbitListener
In my springboot application i am creating a message that contains a generic type as follows:
public List<QMessage<T>> composeMessage(String entityName, List<T> input) {
if (...
0
votes
1
answer
22
views
Spring AMQP: How to specify no arguments for headers exchange binding
I'm trying to create a binding to a headers exchange with Spring AMQP but don't want to specify any arguments so that it will forward all messages
I have tried whereAll or whereAny but both requires ...
0
votes
1
answer
26
views
Spring AMQP: RabbitAdmin unable to recreate queue when it was manually deleted
I have the following code which declares a queue test-amqp-queue. When I run this code initially, it can automatically create the queue.
CachingConnectionFactory connectionFactory = new ...
0
votes
0
answers
48
views
Why is MockBean not working in an integrationtest with RabbitMQ?
I have a Spring Boot application with RabbitMQ and I try to test my code in an integration test. My integration test does work in some cases, but not in all cases.
Application code
@Component
@...
-1
votes
1
answer
58
views
Apache ActiveMQ AMQP Spring Boot AWS
I have an ActiveMQ AWS service with protocol AMQP. AWS returns to me:
failover:(amqp+ssl://b-ca138bd4-e6c4-4596-8329-f11bebf40111-1.mq.us-east-1.amazonaws.com:5671,amqp+ssl://b-ca138bd4-e6c4-4596-8329-...
0
votes
1
answer
33
views
How to change Spring AMQP protocol version from 0.9.1 to 1.0?
I am a beginner to the Spring AMQP and I trying to understand what version of the AMQP protocol it uses, and how to change it.
AFAIK there are 2 variations of the AMQP protocol
0.9.1
1.0
So how do I ...
0
votes
1
answer
24
views
Order in which RabbitMQ concurrent listeners listen to the same queue
I have a @RabbitListener that listens to a container of queues.
@RabbitListener(id = CONTAINER_ID, concurrency = "100")
public void instrumentListener(String payload) {
// do some action
}...
0
votes
1
answer
40
views
How can i intercept incomig messages before they reach methods annotated with @RabbitListener?
I Started by setting up an interceptor for outgoing messages which is working smoothly, but
when i try to intercept incomming messages in the consumers, the postProcessMessage method
is skipped and ...
1
vote
1
answer
43
views
spring-amqp implementation of RabbitMq - does it internally use queueDeclarePassive?
We are migrating from existing classic queues to quorum queues and one of the requirements is that we must declare queue usage as "passive" (i.e. queueDeclarePassive). The intent is to ...
0
votes
1
answer
26
views
RabbitMQ fail-safe feature - automatic requeue at timeout
I am implementing some APIs that consume messages from an AMQP queue (specifically RabbitMQ). Those APIs rely on other APIs to work so there is the possibility for them to fail during the message ...
0
votes
1
answer
32
views
Spring amqp recovery mechanism
I have read the doc which says
Spring AMQP now uses the 4.0.x version of amqp-client, which has auto recovery enabled by default.
Is spring amqp's auto recovery mechanism exactly same as the native ...
0
votes
1
answer
142
views
Spring AMQP reconnection issue with rabbitmq cluster due to queue checking retry limit
I have a rabbitmq cluster with 3 nodes. One node has a durable and non-mirrored classic queue named test-queue.
I have a spring boot app using spring-AMQP default connection factory new ...
0
votes
2
answers
28
views
Handle inbound AMQP messages based on a header attribute (e.g. routing key)
I have a service, that receives AMQP messages. This service is bound to a queue, which receives all messages which match a set of routing keys.
My set up is as follows:
...
private SomeController ...
1
vote
0
answers
24
views
Spring Sending Message RAbbitMQ Rollback
Hi I use spring rabbit to send message to rabbitmq.
I want to rollback sending message how can I do that ,my goal is to achive that in writing process.
Can anyone share code sample
0
votes
0
answers
85
views
Spring messaging with a request-response pattern
Essentially what I'm trying to design is "batch processing" using queues.
I have two Spring projects, one that will act as a message Producer and do the following:
Take a CSV file and for ...
0
votes
0
answers
32
views
Why is the value of "rabbitmq_rejected_total" wrong?
I have a Spring Boot application with Spring AMQP. I don't want to redeliver failed messages endlessly, so I configured error handling with max-attempts to 10, see .A.8. Integration Properties:
...
0
votes
1
answer
129
views
Spring AMQP: remove old bindings and queues
I’m using Spring AMQP and Spring Boot @Configuration and @Bean annotations in order to create all required queues, exchanges and bindings.
@Bean
public Queue queue() {
return new Queue("...
0
votes
1
answer
184
views
Customize RabbitMQ message deserialization in Spring Boot
I have a hierarchy of messages. The topmost message in the hierarchy is defined with @JsonTypeInfo and @JsonSubTypes. The class is not under my control. I extended the hierarchy with my own message ...
1
vote
1
answer
70
views
What does "rabbitmq_rejected_total" metric mean?
I have a Spring Boot application with Spring AMQP. If I call /prometheus I get all metrics including rabbitmq_rejected_total. What does rabbitmq_rejected_total mean?
Output
[...]
# HELP ...
0
votes
1
answer
125
views
Memory leak outgoing messages rabbitmq
I have a Spring Boot application that is using Spring Integration. And I have problem with increasing memory over time. When I run profiler I can see problem in outbound endpoint when it seems like ...
0
votes
1
answer
29
views
Which component is creating null-consumerMonitor-# threads?
Recently we started to test the Direct Container Factory in one of our microservices, the main motivation to change container factory is we want to reduce the thread number that process messages from ...
0
votes
1
answer
29
views
Timeout of the producer confirmation mechanism
I have a question, that is, how to set the time of the producer's message acknowledgement mechanism?
The rabbitMQ producer creates the good news and sends it successfully. My question is: does the ...
1
vote
1
answer
19
views
How do I set a global error handler without overriding existing RabbitListenerContainerFactory in Spring AMQP?
I have a situation where there are many downstream projects using a same common library holding the RabbitMQ configuration.
I want to add a global error handler in such common configuration but pretty ...
0
votes
1
answer
32
views
Retrieve amqp queue name within global error handler
I am implementing a global error handler in a complex system (many queues, many listeners). Inside the handling method, I need to retrieve the name of the queue the message was consumed from. Is that ...
1
vote
1
answer
189
views
Correct way of using spring webclient in spring amqp
I have below tech stack for a spring amqp application consuming messages from rabbitmq -
Spring boot 2.2.6.RELEASE
Reactor Netty 0.9.12.RELEASE
Reactor Core 3.3.10.RELEASE
Application is deployed on ...
2
votes
1
answer
96
views
Incorrect Protocol Buffer Deserialization/Marshaling In Spring AMQP
I am trying to figure out why my protocol buffer payload is being incorrectly de-serialized when received from a Spring AMQP listener in my Java app.
The protocol buffer is written in a Go service and ...
1
vote
1
answer
179
views
RabbitMQ how to only have one message at a time and don't requeue on failure
Our system has a bunch of consumers that use rabbit to consume messages for long running tasks. Currently we ack at the end of processing, so that if the consumer crashes, the message gets requeued. ...
0
votes
1
answer
86
views
Configure Spring AMQP to use default bean for @RabblitListener's replyPostProcessor attribute
Is there a way to configure all @RabbitListener annotations to use the same bean as value for the attribute replyPostProcessor ?
This is an example of using this attribute :
@RabbitListener(queues = &...
0
votes
2
answers
379
views
Can Spring Cloud Stream can send message to the other messageChannel which in the same application with StreamBridge?
purpose:
I want to test the feature "spring.cloud.stream.sendto.destination" that on the document "https://docs.spring.io/spring-cloud-stream/docs/3.1.3/reference/html/spring-cloud-...
0
votes
1
answer
190
views
How to handle AmqpConnectException on pod restart of a spring boot app?
We're using a (reactive) Spring Boot app with RabbitMQ (Spring AMQP), running on a Kubernetes cluster, and lately we noticed some weird behavior in the logs of the application.
When we make a new ...
0
votes
2
answers
265
views
Spring AMQP - anonymous queue declaration
I am trying to declare anonymous queue using Spring AMQP annotations, but seems it is not working.
@RabbitListener(
id = "b1",
bindings =
@QueueBinding(
value =
...
0
votes
0
answers
21
views
Webhook delivery service sending events concurrently
I've a Webhook delivery service (WDS).
All other services publish events on RabbitMQ and WDS receives it from there and starts sending to customers' URLS.
Number concurrency of the listener is 4 and ...
0
votes
1
answer
104
views
Injecting scoped beans in the context of one AMQP message in Spring Boot
When writing web application with Spring Boot you can declare your beans to be part of the session- or request scope.
Is it possible to create a scope for injection of data with messages received by a ...
0
votes
2
answers
149
views
Spring AMQP detect similar payload types to use in @RabbitHandler
I used to have a @RabbitListener that works fine like this:
@Component
public class AppointmentMessageListener {
@RabbitListener(queues = "${rabbitmq.immediateQueueName}")
public ...
1
vote
1
answer
53
views
Can Spring Boot be configured to act as both client and server (mesh topology) with RabbitMQ RPC?
I have 2 apps developed with spring boot:
App1:
exposes an API for app2, for example /api/members
makes a call to app2 in order to retrieve weather details, for example /api/weather
App2:
exposes ...
0
votes
2
answers
269
views
Handling validation error of a JSON payload in Spring RabbitListener
Let's take the following consumer method for a RabbitMQ queue. Ths payload received from the queue is in JSON format, so I register a bean returning a Jackson2JsonMessageConverter. This basically ...
0
votes
1
answer
57
views
How do we hook into After message processing using @RabbitListener
After checking the answer provided here (https://stackoverflow.com/a/34514526/6613150), I'm able to intercept the message before it's processed.
However, I now need to get it after the method who is ...
0
votes
1
answer
25
views
Where are published messages kept while RabbitMQ brokers are in a blocked state?
I noticed that when brokers are in a blocked state due to high watermark messages will not be accepted. However when they get unblocked the messages that are sent when the brokers were in a blocked ...
0
votes
0
answers
41
views
org.springframework.amqp.AmqpResourceNotAvailableException: The channelMax limit is reached. Try later
I am setting up Rabbit template for messaging in my gradle SpringBoot Application. I wrote integration tests for each endpoint that uses rabbit template. I see some tests pass while other tests fail ...
0
votes
1
answer
158
views
How to change message type detection strategy?
I’m using a custom RabbitMQ client in application A and Spring Amqp Library in application B.
I’ve faced with a problem: How to decide witch @RabbitListener to use for different message types?
Problem:...
0
votes
1
answer
78
views
Using RabbitListenerTestHarness with Mockk
We want to write tests for a project that uses Spring Boot and Spring AMQP. As we code in Kotlin we would like to use MockK instead of Mockito as it better fits Kotlin code style and best practices.
...
0
votes
1
answer
44
views
How can make the RabbitMQ PrefetchCount work?
This is my RabbitListenerFactory:
@Bean("workListenerFactory")
public RabbitListenerContainerFactory myFactory(ConnectionFactory connectionFactory) {
...
0
votes
1
answer
63
views
Does Spring AMQP CorrelationData getFuture wait indefinitely without timeout?
In the context of Publisher confirms, when waiting for the CorrelationData's future (SettableListenableFuture#get()) - does it wait indefinitely or is there a timeout configured under the water?
1
vote
1
answer
296
views
RabbitMQ BasicAck giving channel shutdown error messages on console - Spring AMQP
@EnableRabbit
@Service
public class RabbitMqListenerWithReply {
@Autowired
RabbitTemplate rabbitTemplate;
@Value("${test.rabbitmq.exchange}")
private String rabbitMQExchange;
@Value("...
0
votes
1
answer
64
views
Read AMQP message headers spring cloud stream
I made spring batch application that produces amqp (rabbitmq) messages which consists of list of json objects. Messages have headers with some metadata. Spring cloud stream app is consuming messages, ...