[rabbitmq-discuss] Channel.Flow in Java client

Tony Garnock-Jones tonyg at lshift.net
Thu Feb 25 05:13:51 GMT 2010


Hi Rajkumar,

There's currently no public API for checking whether channel.flow has
been asserted or not. Sorry about that. I've filed a bug to get it
looked at (bug 22412, fyi).

For now, you can use the internal implementation details to get hold of
the value. PLEASE BE WARNED, this can only be a temporary solution,
since we reserve the right to change implementation internals without
notice! So really, if you decide to do this, know that it will
eventually stop working. That said:

  // Gross encapsulation-violating temporary hack to work around
  // the lack of public API for retrieving Channel.Flow status
  Channel ch = ...;
  com.rabbitmq.client.impl.ChannelN chImpl
    = (com.rabbitmq.client.impl.ChannelN) ch;
  System.out.println("We are currently " +
                     (chImpl._blockContent ? "BLOCKED" : "NOT blocked")+
                     " from sending content.");

Regards,
  Tony

Rajkumar S wrote:
> Hello,
> 
> How does a java client (I am using rabbitmq 1.7.2) know when a server
> has enabled Channel.Flow?
> 
> I have been using the stomp plugin to send messages to rabbitmq, since
> stomp plugin does not handle Channel.Flow I am writing a stomp to amqp
> gateway. But during my testing basicPublish method just waits when
> server has enabled Channel.Flow. Is this the normal behavior?
> 
> I am now experimenting with TX. Is there any better way to take care
> of situation when server has enabled Channel.Flow?
> 
> with regards,
> 
> raj
> 
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss




More information about the rabbitmq-discuss mailing list