[rabbitmq-discuss] ShutdownSignalException second 'channel.open'

Steve Powell steve at rabbitmq.com
Tue Jan 31 12:19:10 GMT 2012


Yogesh,

Please can you provide some information about your environment? And your
application? What version of RabbitMQ (and client) are you using?

In your stack trace the ShutdownListener you registered is apparently being
called, because the Connection is being shut down. It is not clear why this
exception (and its associated stack trace) appears, it seems to come from your
Listener code, but perhaps that does nothing.

The Shutdown seems to be being called because the channel is being opened twice.
The broker complains about this and closes the connection. Are you creating
channels on different threads simultaneously? (Looking at your app 'design' you
might be.) Depending upon the version of RabbitMQ this might cause a problem.

I'm afraid your application design is unclear:

> This is how I handle doing basicPublish and basicGet on potentially
> non-existent queues
> - publish involves 3 steps
>  queueDeclare
>  queueBind
>  basicPublish
>  If some other thread deletes the queue after either queueDeclare or
> queueBind, basicPublish fails and I again create a new
>  channel and do these operations

I don't think the basicPublish will fail if the queue doesn't exist. Why would
you create a new channel in this case?

Please explain why you expect the queue might be deleted by some other thread.

> - if basicGet fails, I simply ignore it

What do you mean by ignoring it? Do you poll the queue periodically? Why aren't
you using basicConsume and a Consumer to get messages (which will be notified if
the queue is deleted)?

Steve Powell  (a loopy bunny)
----------some more definitions from the SPD----------
vermin (v.) Treating the dachshund for roundworm.
chinchilla (n.) Cooling device for the lower jaw.
socialcast (n.) Someone to whom everyone is speaking but nobody likes.

On 30 Jan 2012, at 04:33, Yogesh Ketkar wrote:

> Only operations I ever do with com.rabbitmq.client.Connection in the
> code are
>    c.addShutdownListener
>    c.createChannel
> 
> What does this error signify?
> 
> 2012-01-30 09:44:45,158 ERROR  [ConnectionShutdownHandler]
> ShutdownListener
> com.rabbitmq.client.ShutdownSignalException: connection error; reason:
> {#method<connection.close>(reply-code=503, reply-text=COMMAND_INVALID
> - second 'channel.open' seen, class-id=20, method-id=10), null,
> "[B at 105691e"}
> 	at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:
> 641)
> 	at
> com.rabbitmq.client.impl.AMQConnection.handleConnectionClose(AMQConnection.java:
> 599)
> 	at
> com.rabbitmq.client.impl.AMQConnection.processControlCommand(AMQConnection.java:
> 571)
> 	at com.rabbitmq.client.impl.AMQConnection
> $1.processAsync(AMQConnection.java:88)
> 	at
> com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:
> 144)
> 	at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:
> 91)
> 	at com.rabbitmq.client.impl.AMQConnection
> $MainLoop.run(AMQConnection.java:500)
> 
> Some additional info.
> I create and close thousands of channels in the code. But at any point
> of time there are not more than 20/21 channels open.
> This is how I handle doing basicPublish and basicGet on potentially
> non-existent queues
> - publish involves 3 steps
>  queueDeclare
>  queueBind
>  basicPublish
>  If some other thread deletes the queue after either queueDeclare or
> queueBind, basicPublish fails and I again create a new
>  channel and do these operations
> - if basicGet fails, I simply ignore it
> 
> regards, Yogesh
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



More information about the rabbitmq-discuss mailing list