cannot websocket client receive queued messages #5

Closed
ralight opened this Issue Mar 15, 2016 · 0 comments

Projects

None yet

1 participant

@ralight
Contributor
ralight commented Mar 15, 2016

migrated from Bugzilla #476314
status RESOLVED severity normal in component Mosquitto for 1.4
Reported in version 1.4 on platform All
Assigned to: Roger Light

Original attachment names and IDs:

On 2015-09-01 09:28:00 -0400, Joking Young wrote:

Created attachment 256288
broker debug information

when ues Paho.MQTT to connect to broker with cleanSession flag set as false, and subscribe a topic with qos=1, and then disconnect, messages queued will not be received when the client reconnect to the broker, however, when i use a mqtt client with the same client id to connect then, the queued messages is received.

the attachment is the broker's debug information, the connection from localhost is created by mosquitto_pub or mosquitto_sub, and others is created by websocket(Paho.MQTT.Client).

On 2016-02-20 04:34:09 -0500, Christoph Krey wrote:

I just found and analyzed the same problem. Websockets subscriber does not receive
queued messages after cleansession=NO, disconnect, reconnect immediately after
reconnect, but only when a new message is published while Websockets subscriber is connected.

Steps to recreate:
0 connect with cleansession=NO, client gets sessionpresent=NO, subscribe QoS=1, abort
1 connect with cleansession=NO, client gets sessionpresent=YES, subscribe QoS=1, abort
2 connect with other client, publish message 1 QoS=1
3 connect with cleansession=NO, client gets sessionpresent=YES, subscribe QoS=1

MQTT now receives queued message, WS client doesn't

4 connect with cleansession=NO, client gets sessionpresent=YES, subscribe QoS=1
5 connect with other client, publish message 2 QoS=1

WS client now receives message 1 and message 2

(see commented mosquitto.log attached)

Broker: mosquitto 1.4.8
MQTT-Client: mosquitto_sub/pub 1.4.8
WS-Client: MQTT-Client iOS

On 2016-02-20 04:35:04 -0500, Christoph Krey wrote:

Created attachment 259845
Websocket client not receiving queued messages

On 2016-03-05 17:38:57 -0500, Roger Light wrote:

There is a change that fixes the problem for me on the fixes branch, could you please take a look at it?

On 2016-03-06 09:20:15 -0500, Christoph Krey wrote:

Unfortunately not, still the same behavior (see attached log)

On 2016-03-06 09:23:04 -0500, Christoph Krey wrote:

Created attachment 260112
mosquitto log

org.eclipse.mosquitto-SHA: bf959ef build

On 2016-03-06 09:40:57 -0500, Roger Light wrote:

SHA: bf959ef is the head of master, not of fixes. Could you confirm you tried with the fixes branch?

On 2016-03-06 12:40:23 -0500, Christoph Krey wrote:

OOPS

trying to build from 'org.eclipse.mosquitto-fixes.tar.gz' now:

getting compile error:

cc -Wall -ggdb -O2 -I. -I.. -I../lib -DVERSION=""1.4.8"" -DTIMESTAMP=""2016-03-06 17:39:00+0000"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_WEBSOCKETS -DWITH_EC -c websockets.c -o websockets.o
websockets.c: In function �callback_mqtt�:
websockets.c:270:9: error: �struct mosquitto� has no member named �last_msg_out�
mosq->last_msg_out = mosquitto_time();
^
Makefile:93: recipe for target 'websockets.o' failed
make[1]: *** [websockets.o] Error 1

On 2016-03-06 12:45:03 -0500, Christoph Krey wrote:

same here org.eclipse.mosquitto-SHA: d9142c3

On 2016-03-06 14:51:01 -0500, Roger Light wrote:

OOPS :)

I've fixed that now.

On 2016-03-07 05:06:14 -0500, Christoph Krey wrote:

Thanks Roger,
I can confirm the problem is fixed!

On 2016-03-07 06:14:48 -0500, Roger Light wrote:

Great, thanks for confirming.

On 2016-03-10 01:53:04 -0500, Joking Young wrote:

That sounds wonderful, thanks very much!

@ralight ralight added the bug label Mar 15, 2016
@ralight ralight closed this Mar 15, 2016
@ralight ralight added this to the 1.4.9 milestone May 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment