user2291509
user2291509

Reputation: 1

COSM MQTT subscribe does not get latest update value

I expect mosquitto_sub should got the latest value sent from mosquitto_pub.

But seems it is not true, subscribe always got the value before latest update one.

Here is my test steps:

I start mosquitto_sub first:

mosquitto_sub: got value 5 (last good known, it's ok)

Then use mosquitto_pub to send value and check mosquitto_sub side:

mosquitto_pub: send value 1

mosquitto_sub: still got value 5

mosquitto_pub: send value 2

mosquitto_sub: got value 1

mosquitto_pub: send value 3

mosquitto_sub: got value 2

mosquitto_pub: send value 4

mosquitto_sub: got value 3

Here is the commands to reproduce this issue: (remember to change YOUR_API_KEY/YOUR_FEED_ID/YOUR_DATASTREAM to your setting)

The subscribe side:

$ mosquitto_sub -h api.cosm.com -t YOUR_API_KEY/v2/feeds/YOUR_FEED_ID/datastreams/YOUR_DATASTREAM.csv

The publish side:

$ for i in 0 1 2 3 4 5 6 7 8 9 10; do mosquitto_pub -h api.cosm.com -t YOUR_API_KEY/v2/feeds/YOUR_FEED_ID/datastreams/YOUR_DATASTREAM.csv -m "$i"; sleep 1; done

It's obviously the subscribe side does not show 10 0 1 2 3 4 5 6 7 8 9 10.

Below is what I got in my test:

2013-05-09T00:40:20.009034Z,10
2013-05-09T00:40:20.009034Z,10
2013-05-09T00:47:52.062114Z,1
2013-05-09T00:47:54.325130Z,2
2013-05-09T00:47:54.325130Z,2
2013-05-09T00:47:58.398895Z,4
2013-05-09T00:47:58.398895Z,4
2013-05-09T00:48:02.680777Z,6
2013-05-09T00:48:04.721811Z,7
2013-05-09T00:48:06.813412Z,8
2013-05-09T00:48:06.813412Z,8
2013-05-09T00:48:11.278083Z,10

Upvotes: 0

Views: 192

Answers (1)

smulube
smulube

Reputation: 91

This is probably best handled by mailing Cosm support, as it sounds like it could be some sort of issue at their end (probably something being cached when it shouldn't be)

Upvotes: 1

Related Questions