[rabbitmq-discuss] [Java-client] How to catch the error or exception while call basic operation?

pprun pzgyuanf at gmail.com
Thu Jun 27 18:46:47 BST 2013


Hi all,

I have code call channel.basicPublish(exchangeName, routingKey, props, 
message.getBytes());,  without firstly declare the exchange.

Although the method return normally, but server log the error, as below:

=ERROR REPORT==== 28-Jun-2013::01:35:50 ===
connection <0.853.0>, channel 1 - soft error:
{amqp_error,not_found,
             "no exchange 
'com.abc.mq.ex.d2ac3c5c-1caf-4c73-bbdf-2024a0e5c092' in vhost '/'",
             'basic.publish'}


My question is how to catch the error/exception, so clients know there's 
failure?

Thanks,
Pprun



More information about the rabbitmq-discuss mailing list