[rabbitmq-discuss] no error or exception

PATAR, SAGAR sp345s at att.com
Fri Nov 15 20:00:03 GMT 2013


Thanks..
I was dot using 1.2.0.RELEASE vesion of spring-rabbit and spring-amqp  libraries and so was not able to see those options ..
Now I was able to configure  the confirm-callback .. BUT for some reason
The spring-rabbit (http://docs.spring.io/spring-amqp/api/org/springframework/amqp/rabbit/core/RabbitTemplate.html)
Supports send<http://docs.spring.io/spring-amqp/api/org/springframework/amqp/rabbit/core/RabbitTemplate.html#send(java.lang.String,%20java.lang.String,%20org.springframework.amqp.core.Message,%20org.springframework.amqp.rabbit.support.CorrelationData)>(String<http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true> exchange, String<http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true> routingKey, Message<http://docs.spring.io/spring-amqp/api/org/springframework/amqp/core/Message.html> message, CorrelationData<http://docs.spring.io/spring-amqp/api/org/springframework/amqp/rabbit/support/CorrelationData.html> correlationData)

But the spring-amqp jar's doesn't  has this method call ..

Below is my context file configuration .. not sure what's missing ...

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:rabbit="http://www.springframework.org/schema/rabbit"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/rabbit
       http://www.springframework.org/schema/rabbit/spring-rabbit-1.2.xsd">

       <import resource="classpath*:jmsclient-context.xml" />

       <rabbit:connection-factory id="connectionFactory" channel-cache-size="${channel.cache}"
              publisher-confirms="true"
       host="${hostname}" port="${port}"
       username="${username}"
              password="${password}" />

       <rabbit:admin connection-factory="connectionFactory" />

       <rabbit:template id="amqpTemplate" connection-factory="connectionFactory" confirm-callback="dlCallBack"/>

       <bean id="dlCallBack" class="com.att.dlife.dlcore.mbus.client.DLCallBack">
       </bean>

</beans>

From: rabbitmq-discuss-bounces at lists.rabbitmq.com [mailto:rabbitmq-discuss-bounces at lists.rabbitmq.com] On Behalf Of Gary Russell
Sent: Friday, November 15, 2013 2:33 PM
To: Discussions about RabbitMQ
Subject: Re: [rabbitmq-discuss] no error or exception

See the various spring-amqp reference documentation sections about how to configure the template (and connection factory) for 'publisher confirms' http://docs.spring.io/spring-amqp/reference/html/amqp.html#d4e209

Essentially, when you send a message, you provide some correlation data; when the ack is received, you get a callback with the result (ack/nack) together with the correlation data (so you know which message the ack is for).

On Fri, Nov 15, 2013 at 2:04 PM, PATAR, SAGAR <sp345s at att.com<mailto:sp345s at att.com>> wrote:
Thanks Simon ..

I am using spring rabbit template .. not sure how to implement the basic.ack (option 1) with the configuration ..
Can you pl. provide some sample examples I can refer ..


-----Original Message-----
From: Simon MacMullen [mailto:simon at rabbitmq.com<mailto:simon at rabbitmq.com>]
Sent: Friday, November 15, 2013 8:37 AM
To: Discussions about RabbitMQ
Cc: PATAR, SAGAR
Subject: Re: [rabbitmq-discuss] no error or exception

On 15/11/2013 13:09, PATAR, SAGAR wrote:
> But when we try to post a message it doesn't throw any exception

That's because publishing is asynchronous. The channel will have closed
due to the permission error but if you just publish and do nothing else
your app won't notice.

Ways you could notice:

* Publish in confirm mode and await a basic.ack
* Publish in mandatory mode and await a basic.return
* Publish in a transaction

These all have performance costs (in approximately increasing order).

Cheers, Simon
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss at lists.rabbitmq.com<mailto:rabbitmq-discuss at lists.rabbitmq.com>
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131115/aa1d5d3d/attachment.htm>


More information about the rabbitmq-discuss mailing list