[rabbitmq-discuss] Java API methods don't return nor	throw	exceptions
    Tony Garnock-Jones 
    tonyg at lshift.net
       
    Sun Dec 14 16:45:38 GMT 2008
    
    
  
Matthias Radestock wrote:
> Only asynchronous methods are safe to call inside handleDelivery. To 
> call a synchronous method you'd have to signal another thread and make 
> the call from there (and taking care to not use the channel from more 
> than one thread simultaneously).
For example, class QueueingConsumer encapsulates just such
functionality:
http://www.rabbitmq.com/releases/rabbitmq-java-client/v1.4.0/rabbitmq-java-client-javadoc-1.4.0/com/rabbitmq/client/QueueingConsumer.html
For an example of its usage (we should put one in the API as well),
please see class LogTail in the examples bundled with the client.
Regards,
  Tony
    
    
More information about the rabbitmq-discuss
mailing list