[rabbitmq-discuss] Problems with the Java client and clustering

Ray Krueger raykrueger at gmail.com
Wed Jul 29 03:15:45 BST 2009


I am currently evaluating RabbitMQ and the Java client. RabbitMQ is
absolutely awesome. The Java client though is giving me a lot of
grief.

The first thing I'm trying to deal with is trying to handle failure
gracefully. Currently I'm testing a pubsub model with a publisher
publishing to a topic exchange, and one consumer binding a
client-named queue to the exchange. The problem I keep seeing is that
after I stop_app and start_app on the primary node in the cluster, the
Consumer refuses to reconnect...

The Consumer works great until I bounce the primary "rabbit" node.
When I try to connect the Consumer after that I get this error.
{#method<channel.close>(reply-code=404,reply-text=NOT_FOUND - no queue
'q1' in vhost '/',class-id=60,method-id=20),null,""}

What am I doing wrong?

Sorry for two questions in one email here, but am I correct in
assuming that I should pass an array of addresses to the
ConnectionFactory when using a cluster?
My current cluster looks like...

Status of node 'rabbit at Rays-MacBook-Pro' ...
[{running_applications,[{rabbit,"RabbitMQ","1.6.0"},
                        {mnesia,"MNESIA  CXC 138 12","4.4.9"},
                        {os_mon,"CPO  CXC 138 46","2.2.1"},
                        {sasl,"SASL  CXC 138 11","2.1.6"},
                        {stdlib,"ERTS  CXC 138 10","1.16.1"},
                        {kernel,"ERTS  CXC 138 10","2.13.1"}]},
 {nodes,['rabbit_1 at Rays-MacBook-Pro','rabbit at Rays-MacBook-Pro',
         'rabbit_2 at Rays-MacBook-Pro']},
 {running_nodes,['rabbit_1 at Rays-MacBook-Pro','rabbit_2 at Rays-MacBook-Pro',
                 'rabbit at Rays-MacBook-Pro']}]
...done.

I'm currently passing the following Address[] to the ConnectionFactory...
        Address[] addresses = {
                new Address("localhost", 5672),
                new Address("localhost", 5673),
                new Address("localhost", 5674)
        };

Is this correct?




More information about the rabbitmq-discuss mailing list