Results 1 to 6 of 6

Thread: Support for ReturnListener on RabbitTemplate???

  1. #1

    Default Support for ReturnListener on RabbitTemplate???

    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

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,037

    Default

    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...

    Code:
    	public static interface ReturnCallback {
    
    		void returnedMessage(Message message, int replyCode, String replyText,
    				String exchange, String routingKey);
    	}
    Requires:

    1. A ConnectionFactory with
    Code:
    publisher-returns="true"
    2. Only one ReturnCallback can be registered with each RabbitTemplate
    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

  3. #3

    Default

    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.

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,037

    Default

    ??

    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

  5. #5

    Default

    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.

  6. #6
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,037

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •