[rabbitmq-discuss] problems updating to new client library

Max Warnock maxjwarnock at gmail.com
Thu Oct 13 18:17:40 BST 2011

I've just swapped out the whole amqp_client infrastructure in my erlang
application to the latest release. It looks like there were significant
changes to the infrastructure but the api remains almost identical (the
network vs direct connection being the only exception I've found).  But now
I'm getting an error in code that used to work about my subscription.  My
code looks like this:

%% Queue is a binary name, Listener is a PID and State is a dictionary
containing various things including the channel PID
subscribe(Queue,Listener,State) ->
    Sub = #'basic.consume'{queue = Queue},
    #'basic.consume_ok'{consumer_tag = Tag} =
amqp_channel:subscribe(State:fetch(amqp_channel_pid), Sub, Listener),
    {ok, Tag}.

This worked with the previous version of the library and I don't see any
difference in the docs (
http://www.rabbitmq.com/erlang-client-user-guide.html) now it produces the
following error:





There is a clause in the new docs that explains the difference between the
selective consumer and the direct consumer. Based on that description it
seems like everything used to be a direct consumer and that's what I should
be using, but I don't see any docs on how to use it. I explored the rabbit
headers and couldn't find anything that would let me select it. The only
mention of it I found was when selective consumer is set as the default.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111013/f2ec2be1/attachment.htm>

More information about the rabbitmq-discuss mailing list