[rabbitmq-discuss] FW: wct + pubsub

Andrius Norkaitis Andrius.Norkaitis at oryo.lt
Wed Oct 1 06:49:19 BST 2008


>Are both instances of the server running off the same (shared) queue?
>That could explain the behaviour you are seeing.

>If you want to get one copy of the message per subscribed client, you
>need one queue per subscriber, and then to bind each queue to the
>relevant exchange with the relevant key (direct case) or keys (topic
>case).

>Without diving deeper into the code it looks to me like this is how
>logtail is working (so "Both instances of logtail program got the
>message."), but the second example is running off a shared queue (or
>you have found a bug).

>Can you check if I am right please.  If I am wrong we shall need
>someone to dig deeper at this end, which we can do, but probably not
>today or tomorrow.

I tried to compare query declaration code in logtain and WCF example and
haven't found significant differences.


Ok. This is code from WCF service model implementation
(RabbitMQInputChannel.cs):

	//Create a queue for messages destined to this service, bind it to
the service URI routing key
            
            string queue = model.QueueDeclare(ticket);
            model.QueueBind(ticket, queue, base.LocalAddress.Uri.Host,
base.LocalAddress.Uri.PathAndQuery, false, null);

            //Listen to the queue
            messageQueue = new QueueingBasicConsumer(model);
            model.BasicConsume(ticket, queue, null, messageQueue);


and this code is from logtail:

using (IModel ch = conn.CreateModel()) {
                        ushort ticket = ch.AccessRequest("/data");

                        Subscription sub;
                        if (exchange == "") {
                            sub = new Subscription(ch, ticket, routingKey);
                        } else {
                            sub = new Subscription(ch, ticket, exchange,
exchangeType, routingKey);
                        }

And Subscribtion implamentation code (Subscription.cs) for query creating:

    m_queueName = m_model.QueueDeclare(ticket);



Maybe I missed something, but I fell the same, that something with query
declaration is wrong.





More information about the rabbitmq-discuss mailing list