[rabbitmq-discuss] CRITICAL:pika.connection:Attempted to send frame when closed

Michael Klishin mklishin at gopivotal.com
Tue May 27 13:55:10 BST 2014


 On 27 May 2014 at 16:49:17, shilpa karkera (shilpa.karkera at finoux.com) wrote:
> > =ERROR REPORT==== 27-May-2014(http://airmail.calendar/2014-05-27%2012:00:00%20GMT+4)::17:19:41  
> ===
> AMQP connection <0.6238.0> (running), channel 1 - error:
> {amqp_error,unexpected_frame,
> "expected content header for class 60, got non content
> header frame instead",
> 'basic.publish'}

Right, so this means RabbitMQ has encountered a connection-level error
and notified Pika about it. So the connection is indeed closed.

Now, why you may get this exception. You most likely share a channel between
threads. It's OK to publish from multiple threads on the same connection
but only when every channel uses its own thread.

Every published message on the wire is 2 or more frames:

[basic.publish method]+[content header]+[content body frame]*

Concurrent publishes on the same channel w/o synchronization mean you will
get frames interleaved incorrectly.
--  
MK  

Software Engineer, Pivotal/RabbitMQ


More information about the rabbitmq-discuss mailing list