[rabbitmq-discuss] pub-sub part 2: erlang consume
0x6e6562 at gmail.com
Thu Apr 10 22:40:46 BST 2008
On 10 Apr 2008, at 21:18, Joe Lee wrote:
> Does null queue have any special functionality?
Not really. As you correctly observe below, the expected behaviour of
passing an empty queue name is that the broker fills this in for you
and tells you what name it gave the queue. This is also the behaviour
> Abstract from the amqp docs:
> 22.214.171.124 Constructing a PubSub
> Subscription Queue
> Here is the pseudocode
> for creating and binding the pubsub subscription queue:
> TO exchange=amq.topic
> WHERE routing_key=STOCK.USD.*
> To consume from the subscription queue, the consumer does this:
> When publishing a message, the producer does something like this:
> Maybe you can tell us what you are trying to achieve.
> I just want to do simple publish a message and then consume the
This will work with Rabbit. The issue I think you are have is not to
do with non-compliance with the specification.
As I said in my previous mail, I think you have a bug in your code
where you match the response of the queue declare call.
In your code, one of the fields of the tuple you are matching on is
already bound, and as Erlang doesn't allow destructive assignment, it
treats the assignment operator in this context as a comparison.
The way to fix this is the following:
%% Don't use the previously bound variable called Q to store
%% queue name field because the Erlang runtime will complain
queue = SomeVariableNameOtherThanTheOneYouPreviouslyAssigned,
message_count = MessageCount,
consumer_count = ConsumerCount}
and then perform a basic consume using the value stored in the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss