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

Brian Lalor blalor at bravo5.org
Sun Dec 11 13:11:08 GMT 2011


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


More information about the rabbitmq-discuss mailing list