u-blox / ubxlib

Portable C libraries which provide APIs to build applications with u-blox products and services. Delivered as add-on to existing microcontroller and RTOS SDKs.
Apache License 2.0
303 stars 92 forks source link

Sent message (MQTT) #183

Closed alexmaron81 closed 7 months ago

alexmaron81 commented 8 months ago

What does “Sent message” mean? Does it mean that the message has arrived at the MQTT broker?

image

RobMeades commented 8 months ago

Hi Alex: it means that the module has returned +UMQTTC: 2,1. Since MQTT runs on TCP, a reliable transport, I would guess that this means that, at the very least, the transmission of the MQTT message has been Ack'ed at transport level. Whether it means that the MQTT broker has accepted your publish message I'm not sure; I would guess "yes", I could probably find out...?

alexmaron81 commented 8 months ago

I have to somehow ensure that the message arrives, and exactly once. I understand that QoS 2 does this?

int32_t error = uMqttClientPublish(pMqttContext, logTopic, message, strlen(message), U_MQTT_QOS_EXACTLY_ONCE, false);

RobMeades commented 8 months ago

Yes, that's correct.

alexmaron81 commented 8 months ago

But somehow not all messages arrive. I don't know how I can make sure. I use RabbitMQ, and some messages arrive in the queue multiple times. Also with QoS 2 As a test I brobed Mosquitto, not all messages arrive here.

RobMeades commented 8 months ago

OK, I will raise the question internally. To be clear, is it that some published messages in a sequence of published messages do not arrive at the broker or that some published messages arrive at the broker more than once even with QoS 2 (or both)?

alexmaron81 commented 8 months ago

I have now switched to (U_MQTT_QOS_AT_LEAST_ONCE), now all messages arrive at (Mosquitto). But I don't know yet whether these will arrive twice in RabbitMQ, I still have to check.

RobMeades commented 7 months ago

But I don't know yet whether these will arrive twice in RabbitMQ, I still have to check.

Hi Alex: does this one need further attention or can it be closed?

RobMeades commented 7 months ago

I'm going to assume this can be closed, please re-open (or open another issue) if there is more to discuss.