🎄 Happy Holidays! 🥳
Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.
Happy Holidays!
Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.
MQTT QoS 1 Queue name
Hello @all,
when creating a queue on the Solace Broker with an MQTT Client 3.1.1 and QoS 1 the queue name consists of two parts
#mqtt/{client id}/{3 digits numeric id}
For example:
#mqtt/MQTTFOGarticleStore/351
#mqtt/MQTTFOGarticleStore/347
When connecting with the client the numeric id changes. Is there a way we can fix the numeric id? We want to do this because we want to check whether the MQTT queue is there or not.
Best regards
Jens
Comments
-
If you are getting a queue, your QoS is already set to 1 so we don't have to worry about that. What SAP system are you using and perhaps I can help find out if the session can be changed or not? It is a boolean, so sometimes it is just a checkbox like in SAP Plant Connectivity.
Clean Session if Connection Was Interrupted .... If you select the checkbox, any messages that have been missed during an interruption to the connection are not sent when the connection is restored. If you do not select the checkbox, and the connection is interrupted, the MQTT server sends all missed messages as soon as the connection has been restored.
0 -
Hi,
we are using a sap netweaver system with
SAP_BASIS 745 and SP-Level 0005
SAP_ABA 75E and SP-Level 0005
There is implemented a mqtt interface and in class CL_MQTT_CLIENT and method IF_MQTT_CLIENT~CONNECT there is no support for clean session false.
ABAP code ---------------------------------------------------------------------------------------------------------------------
CALL METHOD cl_mqtt_krn_services=>mqtt_connect
EXPORTING
i_apc_client_conn_id = lv_apc_client_id
i_timeout_ms = lv_mqtt_connect_timeout
i_mqtt_client_id = lv_mqtt_client_id
i_mqtt_clean_session = abap_true " no support for clean session = false yet !
ABAP code ----------------------------------------------------------------------------------------------------------------------
So that's the reason i want to check the existence of an mqtt queue in the solace broker.
Best regards
Jens
0 -
Unfortunately, if you can't do "clean session = false", then according to the spec and how we implemented it you will get a new session when you connect or reconnect and for Solace that also means a new queue. Here's a good document that explains how that works with the spec, http://www.steves-internet-guide.com/mqtt-clean-sessions-example/. What you could do is on the OT side use MQTT as the publisher, and on the IT side consume with another Solace API or RDP from a queue that attracts the messages with a subscription. That way you'll have a durable queue if you get disconnected. Once SAP implements "clean sessions. = false" then you can go back to an end-to-end mqtt solution if you wish.
0 -
I would like to stay with my mqtt solution because we want to make the consuming SAP system to control the message flow.
Back to my first question. Is there a way to fix the three digits id numer in the queue name, so we can checkt if a defined queue is there or not?
example:
#mqtt/MQTTFOGarticleStore/351
Kind regards
Jens
0 -
No, not that I know of, as you're getting a new queue (hence a new queue name based on the properties you pointed out initially) every time you connect or reconnect. For a definitive answer or a desired change in implementation, I'd suggest opening a support ticket.
0