Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Delay in receiving subscribed message


I am trying to implement a simple RPC like communication using RabbitMQ server and a MQTT client; the client sends a number to a (request) queue of the server, server processes the number taken from queue and sends it to  (response) queue to which client is subscribed.

I am encountering this weird behavior from Paho MQTT client using Rabbitmq's mqtt plugin with pika driver for Server and paho-mqtt for client.

RabbitMQ server source

client source

the client publishes exactly 3 times before it starts receiving the message(response of first message sent by client) from subscribed topic (rabbitmq queue), and afterwards follows one request <--> one response pattern with offset of 3. 

The output for client is like this:
Message Published
Message Published
Message Published
what's payload:  6227020800   (Answer of First message)
Message Published
what's payload:  6227020800   (Answer of Second message)
Message Published
what's payload:  6227020800   (Answer of Third message)

I have tried changing the time-out and the sleep duration but with no effect.

I tried to check queue of rabbitmq to ascertain if it was misbehaving, but its not. Rabbitmq updates the queue(to which client is subscribed) with response as soon as it receives the message from client.

I know I can use Mosquitto server instead of RabbitMQ. but I want the broker to scale really well without much effort..

Any help/guidance would be appreciated.

platform details:
Ubuntu 12.04
rabbitmq-server 3.2.4

PS: I hope I'm posting in the right mailing list, if not, kindly let me know.


Back to the top