I don't see a way to register a ReturnListener (used for mandatory and immediate undeliverable messages) on RabbitTemplate? It seems basic functionality... Plans to add it on future realease?
Thanks,
nicolas.loriente
I don't see a way to register a ReturnListener (used for mandatory and immediate undeliverable messages) on RabbitTemplate? It seems basic functionality... Plans to add it on future realease?
Thanks,
nicolas.loriente
It was added in the 1.1.0.RELEASE; current version is 1.1.1.RELEASE.
See.Code:public void setReturnCallback(ReturnCallback returnCallback)
The RabbitTemplate.ReturnCallback looks like this...
Requires:Code:public static interface ReturnCallback { void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey); }
1. A ConnectionFactory with2. Only one ReturnCallback can be registered with each RabbitTemplateCode:publisher-returns="true"
3. Also need to setMandatory(true) / setImmediate(true) on the template.
We need to add this information to the reference guide I've opened a JIRA issue for that... https://jira.springsource.org/browse/AMQP-240
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware
Hi Gary,
Thanks for the quick and detailed response. I see it on the APIs but there seems to be no schema support. Is this the case at this point?
Thanks,
nicolas.loriente
Last edited by nicolas.loriente; Jun 1st, 2012 at 11:05 PM.
??
This is on the template element in the 1.1 schema...
Code:<xsd:attribute name="return-callback" type="xsd:string" use="optional"> <xsd:annotation> <xsd:documentation><![CDATA[ A reference to an implementation of RabbitTemplate.ReturnCallback - invoked if a return is received for a message published with mandatory or immediate set that couldn't be delivered according to the semantics of those options. ]]></xsd:documentation> <xsd:appinfo> <tool:annotation kind="ref"> <tool:expected-type type="org.springframework.amqp.core.RabbitTemplate.ReturnCallback" /> </tool:annotation> </xsd:appinfo> </xsd:annotation> </xsd:attribute> <xsd:attribute name="confirm-callback" type="xsd:string" use="optional"> <xsd:annotation> <xsd:documentation><![CDATA[ A reference to an implementation of RabbitTemplate.ConfirmCallback - invoked if a confirm (ack or nack) return is received for a published message. Requires a 'connection-factory' that has 'publisher-confirms' set to 'true'. ]]></xsd:documentation> <xsd:appinfo> <tool:annotation kind="ref"> <tool:expected-type type="org.springframework.amqp.core.RabbitTemplate.ConfirmCallback" /> </tool:annotation> </xsd:appinfo> </xsd:annotation> </xsd:attribute>
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware
Hi Gary,
Yes, you are right... I see it on the distribution. I had only checked to see if it was posted here http://www.springframework.org/schema/rabbit.
Thanks,
Nick.
Thanks; I see the 1.1 schema is missing from the site; sorry about that; I will fix it now.
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware