Skip to main content

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

Hi Manoj,

I'm away from my laptop at the moment so I can't test to be certain, but I think you should be calling mqttc.loop() more often. That function yields control to the client so it can process network traffic etc. With your code as it currently stands (if in remembering how the client works correctly), you are only letting the current handle incoming packets once every second.

Nick

On 6 Jul 2014 08:10, "Manoj Gudi" <manoj.p.gudi@xxxxxxxxx> wrote:
Hello,

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
paho-mqtt==0.9.1
pika==0.9.13
rabbitmq-server 3.2.4

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

Thanks,
Manoj

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

Back to the top