[rabbitmq-discuss] 505 UNEXPECTED_FRAME when publishing in a consume handler using pika
simon at rabbitmq.com
Mon Dec 12 11:27:54 GMT 2011
I'm not a Pika expert, but that error message is triggered by wrongly
interleaved frames on a *single* channel - the most likely cause is
using a single channel from multiple threads in a client where channels
are not threadsafe (I suspect Pika is such a client).
On 11/12/11 13:11, Brian Lalor wrote:
> Good morning, all. I opened this issue on GitHub for Pika, but I'm not sure if it's a problem with pika or my code.
> I'm trying to implement a consumer that also publishes messages using pika 0.9.5 running against RabbitMQ 2.7.0. I've created some sample code that attempts to put a more user-friendly layer on top of the basic event-drivenSelectConnection, but it's still very simple. :-) I'm doing the following:
> • connect to the server
> • create a channel for subscribing to Exchange A
> • create a channel for subscribing to Exchange B
> • create a channel for publishing received messages to Exchange C
> This will start and run for a short period of time, but eventually all three channels will close abruptly with:
>  UNEXPECTED_FRAME - expected content header for class 60, got non content header frame instead
> The problem doesn't happen if I don't publish a message, so I that seems to be the key. Is it illegal to publish a message while in the callback handler for consuming another message? If so, what's the best way to handle this? I'm trying to minimize the number of connections I have to make to the server, as that seems to be the point of multiplexing channels over one connection.
> : https://github.com/pika/pika/issues/112
> : https://gist.github.com/7f9ebb6455d2677a1b66
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
More information about the rabbitmq-discuss