[rabbitmq-discuss] 505 UNEXPECTED_FRAME when publishing in a consume handler using pika

Simon MacMullen 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).

Cheers, Simon

On 11/12/11 13:11, Brian Lalor wrote:
> Good morning, all.  I opened this issue[1] 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[2] 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:
>
>      [505] 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.
>
> Thanks,
> Brian
>
> [1]: https://github.com/pika/pika/issues/112
> [2]: https://gist.github.com/7f9ebb6455d2677a1b66
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


-- 
Simon MacMullen
RabbitMQ, VMware


More information about the rabbitmq-discuss mailing list