Hi David,
David Hawthorne <dsrthorne at gmail.com> writes:
> On Apr 28, 2011, at 2:48 PM, David Hawthorne wrote:
>>> Here's another problem, this time using amqpcpp with 2.4.1:
>>>>dhawth at u16$ ./example_get
>> server connection error 504, message: CHANNEL_ERROR - unexpected method in connection state running
>>>>dhawth at u16$ ./example_consume
>> server connection error 504, message: CHANNEL_ERROR - unexpected method in connection state running
This error suggests that you are trying to use channel number 0 (which
has a special role in AMQP) for general methods.
> [...]
> from my test program:
>> 0 [0x7f1033a7f750] DEBUG AMQP null - Making new connection to amqp server
> 2 [0x7f1033a7f750] DEBUG AMQP null - Logging into amqp server
> 5 [0x7f1033a7f750] DEBUG main null - creating queue foobar
> 5 [0x7f1033a7f750] DEBUG AMQP null - creating queue with name foobar
> 5 [0x7f1033a7f750] DEBUG AMQPQueue null - constructing new queue with
> channelNum 0 and name foobar
And this line suggests the same thing.
But looking at the amqpcpp code on github, I don't see how that could
happen. AMQP::init sets channelNumber to 0, and AMQP::createQueue
increments it. Are you using amqpcpp from github without modification
(other than adding the logging)?
Alexandre: By the way, the channelNumber allocation logic in amqpcpp
looks wrong to me. But it shouldn't affect the examples where only a
single channel is used, so I don't think that's the cause of David's
problem.
David
--
David Wragg
Staff Engineer, RabbitMQ
VMware, Inc.