[rabbitmq-discuss] Publisher and Consumer design doubts
Alberto Perez Alonso
aperez at alea-soluciones.com
Fri Jul 27 08:28:42 BST 2012
Hello
Yes, you're right.
I detected with management console that there are too many consumers.
Reviewed code and fixed it ( basic_consume out of loop ) but I sent the
example without the corrections.
Concerning to close connection:
umm, it seems that depends on the architecture:
*) consumer, publisher, RabbitMQ at localhost work fine.No connections are
closed.
*) consumer, publisher at localhost. RabbitMQ other machine (virtual
machine)->Connection is closed
Ok-> it's not rabbitmq problem. I've to take a look
Thanks a lot.
2012/7/26 Steve Powell <steve at rabbitmq.com>
> Dear ___,
>
> Your example code appears to register the consumer callback repeatedly
> in a loop, draining events after doing this. This cannot be good use of
> the interface (but I could be wrong).
>
> You may like to look at http://pypi.python.org/pypi/librabbitmq/ for
> information about how to use the library correctly. There is an example
> on the first page that demonstrates the consumer idiom.
>
> The five minutes pause is likely enough time either for the repeated
> stuff to clog up the client somehow, or for some network mechanism to
> close the connection since nothing is happening on it. RabbitMQ will not
> do this, but I am told there are network firewalls and stuff that will
> unceremoniously chop a connection if it is silent for a while. It is not
> clear that the client would ever notice this.
>
> If these steps do not help I recommend looking in the RabbitMQ logs to
> see why the connection is lost. Come to think of it, I would recommend
> looking there anyway. You do not say if your tests are run locally or if
> the server is on a different machine from the publisher/consumers?
>
> Good luck,
> ____ ____ (*a happy bunny*)
> *----------yet more definitions from the SPD----------*
> *corrugate* (*n.*) T.V. soap scandal.
> *olympic* (*n.*) A camp road-digger.
> *jamboree* (*n.*) A conserve made from French cheese.
>
> On 26 Jul 2012, at 10:34, APA wrote:
>
> High, I wonder if someone can help me
>
> I'm using python and librabbitmq
>
> I've a publisher and consumer (files are attached)
>
> First Test
> The consumer declares and binds a queue to the exchange with
> AutoDelete=True
> Start the consumer then the publisher.
> Everything works great until I kill the publisher. Then wait five minutes
> and run the publisher again.
> When it starts, RabbitMQ deletes the queue. The consumer does not get
> notice that he "loss connection"
>
> Second Test
> Change the consumer queue to be AutoDelete=False.
> Everything works great until I kill the publisher. Then wait five minutes
> and run the publisher again.
> The queue is not deleted but the consumer does not get notice that he
> "loss connection" and no message are received.
>
> This behavior is normal or I'm making a great mistake, because I'm
> supposing the consumer should be listening to incoming messages from
> publisher.
>
> Thanks in advanced
>
> Best regards
>
>
>
>
> <consumer.py><publisher.py>_______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120727/879aff8f/attachment.htm>
More information about the rabbitmq-discuss
mailing list