[rabbitmq-discuss] Consumer/publisher - last message published does not appear in queue, but appears in firehose trace!?
spronkey
keith at spronkey.com
Sun Jul 1 01:14:46 BST 2012
Hi all,
I've got a double pump scenario going on - that is, my application enqueues
a *broadcast* message, that then gets picked up by *consumer** type 1*, and
transformed into many *singlecast* messages on a separate queue that are
picked up by *consumer** type 2. *Consumer type 1 also creates and
publishes a confirmation message in yet another queue, containing the
number of singlecast messages it enqueued.*
*
What's happening is that Consumer type 1 is operating fine up until it
needs to enqueue the confirmation message. The first time any particular
type 1 consumer publishes a confirm message, it never ends up in the
confirmation queue. All singlecast messages end up correctly in their
queues. If the same process is allowed to consume a second broadcast
message, the confirmation it publishes *does *end up in the confirmation
queue (seemingly every time, but this could be a red herring). Firehose
trace would indicate that the consumer is doing everything it should - it
shows all confirm message publishes with correct exchange and routing key,
yet confirm queue remains empty.
The Consumer/publisher operates as follows:
1. Initiate 2 connections (to same server, currently): "in", and "out"
2. Create 4 channels:
1. bound to *gn-broadcast*
2. bound to *gn-smsout*
3. bound to *gn-emailout*
4. bound to *msg-broadcast-confirm***
3. Consume loop begins on *in* channel consuming from *broadcast* queue
1. Gather person list from broadcast message body
2. Start transactions on *smsout* and *emailout* channels
3. Loop through person list. For each, create two AMQP Messages w/
single person and publish to *smsout *and *emailout* queues
respectively
4. Once finished looping, commit transaction (assuming all OK)
5. Create new AMQPMessage with number of persons and publish to *
msg-broadcast-confirm* queue
A copy of the script is here for reference: http://pastebin.com/GH1hr1ph
The php-amqplib debug output clearly shows in all cases that the
basic_publish message* is being sent with the correct contents of the
confirmation message*. There are no breaks in the connection or exceptions
occurring. Likewise, the firehose trace from rabbit publishes a message to
trace queue showing the confirm message has been published, with the
correct exchange and correct routing key. However, my confirm queue is
completely empty!
Why would this occur? Do I need more than 2 connections? (I didn't think I
would need more than 1, but the sms and email messages don't seem to
publish nicely without a second connection).
What on earth is going on? It's doing my head in!
Rabbitmq-server version 2.8.2 running in a Turnkey LAMP VM (Ubuntu 10.04).
Client is running on Mac OS X 10.6.8 with latest php-amqplib.
Regards,
Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120630/421efc96/attachment.htm>
More information about the rabbitmq-discuss
mailing list