FAQ Database Discussion Community


Spring AMQP return callback vs retry callback

java,spring,spring-amqp
I want to make my app resilient to connection issues that can happen when sending messages to rabbitmq. I want to get hold of all unsent messages, store them and send them latter, when rabbitmq becomes available. Looking at the official documentation I didn't manage to figure out what is...

Spring AMQP stuck queue due to unack'd message

java,spring,rabbitmq,spring-amqp
I am using a SimpleMessageListenerContainer and had problems that every hour or so the queue would get stuck and nothing would be processed due to an unack'd message. I am sure this is due an error that isn't being caught properly but can't trace the issue. I have set the...

Auto-delete queue not recreated after broker outage

spring-amqp
I have a question regarding the use of spring-amqp through XML wiring and through creation of the various objects in java code. Doing this via XML and via Java code is pretty simple and has been working well for me in most cases. However, after an outage of the broker...

spring-rabbit client using lots of cpu

java,rabbitmq,spring-amqp,spring-rabbit
I am running a spring-boot application in ec2 on a c3.large machine. It initializes a spring-rabbit client, which starts up its own thread. After profiling my application using YourKit, I see that a lot of time is spent inside the rabbit client thread, inside: com.rabbitmq.client.impl.AMQConnection$MainLoop.run() specifically down in java.io.DataStream.readUnsignedByte() To...

RabbitMQ: server side Calculation for every received Message

rabbitmq,message-queue,spring-amqp,spring-rabbit
I'm working with RabbitMQ and I want on the server side to conduct a calculation each time an Exchange receives a message. I have a queue for ratings and when too many bad reviews (let's say more than ten) received, then a consumer should be notified. What options are there...

Spring AMQP - Is there a synchronous blocking send method that only waits for confirm?

spring,spring-amqp
I am using Spring AMQP v1.4.2 and trying to find a send method, possibly in RabbitTemplate, that blocks the thread until a confirm is received from the server to make sure we do not lose messages. I have seen the sendAndReceive() method but it waits for a reply message in...

Spring Integration serializes MessageHeader Object

spring,spring-integration,spring-amqp
i have some services, one implemented with Grails 2.4.2 (Spring 4.0.5) some implemented as Spring Web (Spring 4.0.5) and one implemented with Spring Boot 1.2.1 (Spring 4.1.4). The services communicate over RabbitMQ with spring-integration. Communication between Grails and the Spring Web services is fine, but it's not possible to communicate...

Is there a size limit on a RabbitMQ message header?

rabbitmq,spring-amqp
I plan on storing stacktraces in the RabbitMQ message header. Do message headers have a size limit?

Autowiring of exchange, queue and binding with Spring AMQP + RabbitMQ (Spring Boot)

rabbitmq,spring-boot,spring-amqp
In the Spring docs for Messaging with RabbitMQ, rabbitTemplate, queue, exchange and binding are all set up by Spring Boot. What I don't understand is how rabbitTemplate.convertAndSend(...) sends it to the created exchange, since the method call does not specify an exchange and it includes only the routing key (via...

“Channel shutdown: connection error”

amazon-ec2,rabbitmq,load-balancing,spring-amqp
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 port). Then, I started two...

Spring-amqp two queues with different TTL

rabbitmq,spring-amqp
In our application, we use RabbitMQ and spring-amqp(1.4.3.RELEASE). We have two Queues there. Both of them have TTL(60000 and 100000) configured. When we start the application, it gives the following errors: [pool-4-thread-1] ERROR org.springframework.amqp.rabbit.connection.CachingConnectionFactory - Channel shutdown: channel error; protocol method: #method(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'x-message-ttl' for queue 'queue1'...

Spring amqp not publishing message to the queue but to Exchange

spring,rabbitmq,spring-boot,spring-amqp,spring-rabbit
I am trying to test & benchmark spring-amqp for RabbitMQ with multiple queues so I was creating rabbit template for each queue and using it to send message. The message sent is successful and I can see a message published in the exchange but I don't see anything in the...

SimpleMessageListenerContainer ChannelTransacted and MaxConcurrentConsumers

transactions,rabbitmq,amqp,spring-amqp
I'm trying to configure a SimpleMessageListenerContainer from Spring AMQP with channeled transactions to dynamically add consumers on demand. The problem is, I don't see consumers being added dynamically when I have a channeled transaction. To be clear, this doesn't dynamically add consumers under load: container.setMaxConcurrentConsumers(5); container.setChannelTransacted(true); container.setTransactionManager(rabbitTransactionManager); But this does:...

rabbitmq with spring amqp - messages stuck in case of AmqpException

amqp,spring-amqp
I am throwing an AmqpException inside of my consumer. My expectation is that the message will return back to the queue in FIFO order and will be reprocessed sometime in the future. It seems as if Spring AMQP does not release the message back to the queue. But instead tries...

Why is there a delay in Spring AMQP Message dispatching from a filled Queue?

java,spring,rabbitmq,spring-amqp
I am using Spring AMQP in my message driven application. I noticed that there is a nearly constant delay of around 300ms between invocations of my message listener, even though I am sure that the queue is filled with messages. The logfile below shows this delay between BlockingQueueConsumer.nextMessage and BlockingQueueConsumer.handle...

RabbitMQ Spring dead letter config not working

java,spring,rabbitmq,spring-amqp
Below is the configuration I'm using. Messages with no errors, work fine from exchange to queue with conversion picked up by the listener, its great. What I am wanting to happen with erroneous messages is that when I throw a AmqpRejectAndDontRequeueException, "rabbitQueue" will forward the message to it's dead letter...

How to send basicAck to inbound adapter after publisher confirm from outbound adapter

spring-integration,spring-amqp
We have an inbound channel adapter that receives notifications of an event. The complexity of the consumer's criteria restrict our ability to use a simple routing key to distribute the messages, so the application uses a splitter to send that message to interested subscriber's queues via a direct exchange. We...

RabbitMQ RPC accros multiple rabbitMQ instances

rabbitmq,spring-amqp,federation,rabbitmq-shovel
I have three clients each with their own RabbitMQ instances and I have an application (let's call it appA) that has its own RabbitMQ instance, the three client applications (app1, app2, app3) wants to make use of a service on appA. The service on appA requires RPC communication, app1, app2...

spring REST message bus communication

spring-mvc,amqp,spring-amqp,spring-rabbit
I am looking for spring module that can help me to integrate spring REST web services with message bus(RabbitMQ). REST web service are acting as a consumer of AMQP messages from the client. Whenever messages are sent over the bus it is an AMQP message and to make it work...

spring amqp sendAndReceive with multiple queue

spring,amqp,spring-amqp
I'm using spring amqp and I'd like to know if there is a way to invoke a RabbitTemplate.sendAndReceive on a fanout exchange and get a list of answers (one for each queue bound to the chosen exchange) Thanks in advance for the help....

Multiple consumers but only one of each kind

spring-amqp
I have services A, B and C (and possibly more) and I may have NA, NB and NC running instances of each. I want to be able to notify services A, B and C (and every other that may exist) that a given event has occurred (as in fanout),...

Would it be better to have 2 inbound channel adapters or 2 queue names on 1 inbound channel adapter

spring-integration,spring-amqp
My application is listening to 2 completely different queues. One queue will have thousands of messages come through it per minute (lets call it q.notifications) and the other will see something like 10 per day (lets call it q.subscriptionUpdates). Would it be advantageous to create 2 <int-amqp:inbound-channel-adapter /> instances or...

Spring RabbitMQ tutorial results in Connection Refused error

java,spring,rabbitmq,spring-amqp
I'm an experienced Java programmer and am trying out Spring Rabbit MQ for the first time. I followed the messaging-rabbitMQ tutorial exactly using Maven. http://spring.io/guides/gs/messaging-rabbitmq/ I am running on CentOS as a user account. When I ran the application at the very end of the tutorial with java -jar target/gs-messaging-rabbitmq-0.1.0.jar,...

How to keep track of which queue a message came from in a SimpleMessageListenerContainer without a received routing key

spring-integration,spring-amqp
Our application has an amqp inbound-channel-adapter with a listener container where we dynamically add and remove queue names. We would like to utilize RabbitMQ's BCC (Sender-selected Distribution) feature where you set the BCC header to a Collection of recipient routing keys. This would be beneficial to have RabbitMQ distribute the...

what is difference between spring & blueprint & router in apache camel?

apache-camel,spring-amqp,jbossfuse,apiblueprint
I am new in Fuse. I am using Jboss Fuse and creating Fuse project. I want to know basic difference between container like spring, blueprint and router?

Is JsonMessageConverter thread-safe?

java,spring,spring-amqp
I want to create org.springframework.amqp.support.converter.JsonMessageConverter as a Singleton Spring bean and autowire it in my services. Is it thread-safe?

spring boot rabbitmq MappingJackson2MessageConverter custom object conversion

java,json,rabbitmq,spring-boot,spring-amqp
I'm trying to create a simple spring boot app with spring boot that "produce" messages to a rabbitmq exchange/queue and another sample spring boot app that "consume" these messages. So I have two apps (or microservices if you wish). 1) "producer" microservice 2) "consumer" microservice The "producer" has 2 domain...

spring integration amqp channel error handler auto ack

java,error-handling,spring-integration,spring-amqp
I have an amqp-backed channel <int-amqp:channel> to temporarily persist messages coming from a JDBC inbound adapter. when no exception is thrown, the message is ack'd and removed from the rabbit queue. when an exception occurs, the message is returned to the queue and is reprocessed continuosly. There are some circumstances...

Reprocess failed RabbitMQ messages manually

spring,rabbitmq,spring-amqp
I have a dead-letter queue which stores failed messages. Is there have a way to manually trigger a listener to process the messages in the dead-letter queue? I’m using Spring AMQP.

Spring-AMQP Transactionnal publish without Exception

java,spring,rabbitmq,spring-amqp,spring-rabbit
I am trying to use a Transactionnal RabbitMQ channel with Spring-AMQP but I want to actually swallow Exceptions to log them and being able to recover them. Using channelTransacted=true forces the Channel to also join the current transactionManager (Hibernate in my case) and that results in the commit Exception being...

RabbitMQ message conversion issue

rabbitmq,spring-amqp
I am facing issue while converting message into Object format after consuming message at consumer end. I couldn't able to convert back to Student object. FYI, at producer end am using spring RabbitTemplate and at consumer end plain java api(Note#: I cannot use spring at consumer end) Issue: org.codehaus.jackson.map.JsonMappingException: Can...

Trying to migrate over from xml name space config to a java @Configurable cannot replicate

spring-amqp,spring-rabbit,spring-rabbitmq
I am trying to migrate from XML Spring amqp config to a java annotation based one because it is "simpler". Not sure what I am doing wrong the XML config works fine but the java @Configurable throws a "Caused by: java.net.SocketException: Connection reset" exception. XML config (works perfectly): <?xml version="1.0"...

Spring AMQP - how to set arguments on a Queue?

spring,rabbitmq,amqp,spring-amqp,spring-rabbit
I'm try to set arguments on a queue, however Spring's Queue class doesn't have a setter method for arguments. http://docs.spring.io/spring-amqp/api/org/springframework/amqp/core/Queue.html Any ideas? Thanks....