RabbitMQ- Blocking Connection Best Practice

70 views
Skip to first unread message

aravind rp

unread,
Jul 21, 2020, 2:35:22 AM7/21/20
to rabbitmq-users
I am using pika to publish messages to the rabbitmq server using blocking connection following the example below.


I dont have to constantly publish the messages, as its used to inform the progress on a long running process. Some times a message needs to be sent in say 2 or 3 minutes or this interval can be longer. Hence for each message I create a new connection and close it after sending the message. Is this a wrong practice?

Warren Pang

unread,
Jul 21, 2020, 8:52:36 AM7/21/20
to rabbitm...@googlegroups.com
For publishing it has no problem. For consuming you would better keep the long connection and use asynchronous consumer mode.

Thanks 

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/b8ebccd7-2cd8-4e51-9166-b8b4e39ad5eao%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages