[rabbitmq-discuss] Intermittent Problem - 2.8.5 java client hangs on declare exchange

m.luchak at smartasking.com m.luchak at smartasking.com
Fri Aug 24 22:28:20 BST 2012


Hi Matthias,
 
I didn't believe it at first either ;) Our java lead got a little pissed as I kept demanding proof that it was the same connection hehe... there are seperate channels on one connection...
 
brilliant - async it is for now... I really need to remove this showstopper and come back to the cause later - crashes aren't good, but, having someone's phone just hang there is a killer!!  As the exchanges are getting created 100% of the time I can live without a reply..
 
thanks for all your help,
Matthew
 
-----Original Message-----
From: "Matthias Radestock" <matthias at rabbitmq.com>
Sent: Friday, August 24, 2012 5:08pm
To: m.luchak at smartasking.com
Cc: "Discussions about RabbitMQ" <rabbitmq-discuss at lists.rabbitmq.com>
Subject: Re: [rabbitmq-discuss] Intermittent Problem - 2.8.5 java client hangs on declare exchange



Matthew,

On 24/08/12 21:49, m.luchak at smartasking.com wrote:
> While the client wait() is well, waiting, the device receives incoming
> messages - so there is a connection and the heartbeat is running
> normally and happily.

The latter is on a different connection though, right? i.e. you are not 
receiving messages on the same connection that has a stuck 
exchange.declare, are you? That would be odder still.

> BTW, In the Javadocs there is an Exchange.Declare with a nowait boolean :
>
> AMQImpl.Exchange.Declare(int ticket, java.lang.String exchange,
> java.lang.String type, boolean passive, boolean durable, boolean
> autoDelete, boolean internal, boolean nowait,
> java.util.Map<java.lang.String,java.lang.Object> arguments)
>
> However, this option is not available in the 2.8.1 or 2.8.6 .jar files
> or source files... can anyone tell me if this overide is in a  nightly
> build and/or if it's irrelevant to the task at hand?

Most synchronous AMQP commands have an async variant, triggered by 
setting the nowait flag. We don't expose convenience methods for that in 
the API but you can use Channel.asyncRpc(Method method) to send commands 
like that, e.g.

import com.rabbitmq.client.impl.AMQImpl.Exchange;

 channel.asyncRpc(new Exchange.Declare.Builder()
 .exchange("myexchange")
 .type("direct")
 .nowait(true)
 .build());

Matthias.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120824/76d44ad7/attachment.htm>


More information about the rabbitmq-discuss mailing list