This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

The behavior I am seeing is that the message keeps repeating. Perhaps there is a poller that reexecutes the same message? The message is never removed from RabbitMQ.

So first I'd like to know how to stop the message from repeating and have it removed from the queue. Second, how do I specify a queue name on which to publish the response on the invalid and reply channels.

So far my client looks like this (it is not polling for a reply right now--it's only submitting the request and looking for a response. I'm new to this...

I imagine the repeat deliveries you are seeing are caused by an exception in the message listener - by default an exception causes the message to be re-queued on the broker. The exception is probably logged for you, but unless there is some more config that we haven't seen, I can guess that it is Spring Integration telling you that it has no way to deliver the messages you send to the channels downstream of the router (they are not connected to anything). That is related to one of your questions: if you want to send the messages back to the Rabbit broker, then you need an outbound adapter attached to each of the outbound channels.

Your test looks like a good start, and it should at least send a message, but there are some problems. First, it seems to be sending and receiving from the same queue - the default queue that you have configured in the unseen autowired RabbitTemplate (probably not what you wanted). Second, you don't wait for a response, so at least some of the time the result from receiveAndConvert() will be null. Third (cosmetic only), the Message you declare is never used.

Since a lot of this is really about Spring Integration, you might find it helpful to analyse the behaviour by taking AMQP out of the equation to start with. Also the Integration forum will be able to provide more detail if you still have questions about vanilla Spring Integration.

Comment

I noticed toward the end of the day yesterday as I traced through the spring source that some kind of exception was being thrown. This morning I'm working on my example to create two reply queues that I will listen to asynchronously. If I can do that then I am in business.

I can't get my integration solution to call back onto this reply queue, though I can get a similar solution to work without integration. This is a simple matter of semantics. Can anyone tell me what my spring integration config should look like to make this happen?

I haven't defined anything to associate with the smsOutputChannel and so I have an error. You can see that I've commented out the stdout-channel-adapter line, which I've done because I want the reply to go to queue the client named. So what I have definitely won't work; what I need is the last piece of the puzzle. How do I define an output channel for my service-activator.

Keep in mind too that this is a simplified case. Later there will be several chained steps leading up to and away from my service activator. I will want to maintain the reply queue name throughout and send back to that named queue when the chain is complete.

Comment

All the samples provided in the integration tests point to the stdout-channel-adapter. There are no examples of spring configuration that leaves the choice of the reply queue/channel up to the requester. The GatewayEchoTest-context.xml file routes replies as such:

Comment

Just checking in to see what you think of this issue so far. Is it a bug that needs to be fixed, or a scenario that has not been tested? No pressure, just wondering if you haven't had time to look at it yet, or if you have been looking at it and it's been some work to figure out.

I didn't really have time to look any further since posting the question. However, the attribute should not be *required* according to the latest version of the XSD. Can you make sure you have the latest 2.1.0.BUILD-SNAPSHOT for Spring Integration (or maybe try 2.1.M2 if you want something more "bookmarkable").

The Spring AMQP, Spring Framework, and RabbitMQ client dependencies could be loaded transitively, and would be 1.0.0.RELEASE, 3.0.6.RELEASE, and 2.5.0 respectively.

Comment

I haven't gotten back to trying this yet. Since I had issues and limited time, I dropped to the Spring-Amqp level without using integration, and implemented my solution there, which works. I'm trying to get my project set up using Maven and it appears that in order to use integration, I'll have to pull a snapshot build in order to use SpringAMQP.

Is this the way that I need to proceed? When is this going to be part of the official release of integration?