[rabbitmq-discuss] ewbie question - need modified fanaout/publish/subscribe behavior

Laing, Michael P. Michael.Laing at nytimes.com
Thu Nov 8 22:58:58 GMT 2012


Here's some working code using pika 0.9.6:
...
def queue_declare_ok(self, method_frame):
  print 'queue_declare_ok'
  self._my_queue = method_frame.method.queue
  self._channel.queue_bind(self.queue_bind_ok, self._my_queue,
'static_exchange', '#')
...
    
def channel_on_open_callback(self, channel):
  print 'channel_on_open_callback'
  self._channel = channel
  self._channel.add_on_close_callback(self.channel_on_close_callback)
  
  self._channel.basic_qos(prefetch_count=1) # process 1 at a time
  self._channel.add_on_cancel_callback(self.channel_on_cancel_callback)
  self._channel.queue_declare(self.queue_declare_ok, '', exclusive=True)

Michael




On 11/8/12 5:41 PM, "scott taggart" <taggart at taggarts.org> wrote:

>Matthias,
>
>Thanks for the response.  Short story is that I have not crossed the
>bridge of "forgetting" about messages in my message queuing server.  I
>will figure that out, eventually.  It may not be a problem because the
>message Q server only has to run a limited amount of time...
>
>Hey, unrelated question - I cannot get the python pika queue_declare
>method to accept an empty queue name so that the q name is
>auto-generated.  I looked for issues with this online and could not find
>any.  The python demo 3 sample, for example,  at the rabbitmq site shows
>queue_declare as taking no queue parameter yet the current 0.9.6
>function demands a queue parameter. Thoughts?
>
>Thanks,
>
>Scott
>
>
>On 11/8/2012 8:05 AM, Matthias Radestock wrote:
>> Scott,
>>
>> On 08/11/12 15:57, scott taggart wrote:
>>> As I research and better understand AMQP better, I learn that messages
>>> are never queued in an exchange - they are always routed to existing
>>> queues or tossed.  Given my basic requirement that messages
>>> be queued for as-yet non-existent queues, this seems not possible
>>> directly with amqp/rabbitmq.
>>
>> Yes, that's basically correct. Though it's not too hard to be build
>> something along those lines on top of amqp/rabbitmq as long as you
>> don't care about certain edge cases.
>>
>> Btw, when in your hypothetical system can the server ever forget a
>> message? Never?
>>
>> Regards,
>>
>> Matthias.
>>
>>
>
>
>
>
>_______________________________________________
>rabbitmq-discuss mailing list
>rabbitmq-discuss at lists.rabbitmq.com
>https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



More information about the rabbitmq-discuss mailing list