Interceptor for successful delivery

Hello

I want to use HiveMQ extension to send messages from server directly to clients (messages will come from Kafka queue) and then get a callback when they are successfully delivered (PUBACK).
PublishService.publishToClient returns future with DELIVERED or FAILED status, but I think the DELIVERED status only refers to a message being enqueued for sending.

I noticed there is a new branch in hivemq ce repository (feature/puback-inbound-interceptor) that adds an interceptor for incoming PUBACK messages.
How can I correlate sent message with received acknowledgement? I don’t get packed Id from PublishService.publish so I can’t match it to PubackPacket.getPacketIdentifier .

If I set user properties in PublishService.publish, will I get the same properties back in puback?

1 Like

Hi @JakubS,

It’s great to see your interest in HiveMQ and the extension SDK.
You are right about the DELIVERED state.
There is not packedID in the PUBLISH sent via the Extension system.
You could use User Properties of course. Just make sure that the receiving client supports MQTT 5 and passes the User Properties back on the PUBACK.

Hope this helps.
Kind regards,
Florian from the HiveMQ Team.

Thanks, I will try with user properties then.