I am currently working with the CocoaMQTT library to integrate MQTT-based message consumption in my Swift application. I am trying to consume all messages from a queue in Solace, similar to how queue bindings work in Solace’s guaranteed messaging model.
From my understanding, CocoaMQTT primarily supports topic-based subscriptions (rather than direct queue consumption). However, I would like to confirm whether it’s possible to consume messages from a Solace queue directly using CocoaMQTT, especially in the context of guaranteed message delivery.
Specifically, I have the following questions:
Does CocoaMQTT support binding directly to a Solace queue and consuming messages from it?
If not, what would be the recommended approach to consume all messages from a queue in Solace using MQTT in a Swift application?
Are there any additional configurations required on the Solace broker to allow this type of queue consumption via MQTT?
I would appreciate your insights on how to proceed with consuming queue-based messages effectively in Solace with CocoaMQTT or if a different solution is required.
Hi there, I’m Solly AI, I generate responses to your questions using the power of the Solace Agent Mesh:
Please remember that AI technology can make mistakes so ensure that you read our Disclaimer.
AI Generated responses are a work in progress, your help in evaluating my response would be awesome! If my response makes sense, please mark it as a solution or give a . If my response doesn’t make sense for your topic, please react to it with a .
Looking at the documentation and community discussions, I can provide information about consuming messages from a queue using CocoaMQTT in a Swift application.
The Solace documentation and community discussions indicate that:
For MQTT connections to Solace event broker:
Port 8883 is used for MQTT over SSL/TLS
Port 8443 is used for MQTT over WebSocket Secure (WSS)
CocoaMQTT library can be used to establish MQTT connections, with successful connections reported using port 8883 for SSL/MQTT.
Here’s a summary of the key points for implementation:
Use the appropriate connection URL and port (8883 for SSL or 8443 for WSS)
Configure SSL/TLS settings if using secure connections
MQTT v5.0 is recommended over MQTT 3.1.1 for better features and interoperability
Just a quick note that official Solace support isn’t currently offered via the Community forum. You can of course open a support ticket via options here: https://solace.com/support/
I’m not familiar with CocoaMQTT, but you are correct that in general MQTT doesn’t have the concept of Queues. That said, under the covers Solace does use queues in our implementation.
For example if you are using MQTT v5 and specify a QoS 1 subscription a queue will be created under the covers which subscribes the topics your app specifies that it wants to receive from.
Depending on what you require there are options for also pre-creating the queue via SEMP or cli. More info on how queues are used can be found in the docs: Managing MQTT Sessions
Note that the “Ask Solly AI” button on the docs should also prove useful if you have specific questions regarding MQTT, but be sure to specify your MQTT version and note that I don’t think it will be familiar with CocoaMQTT specifically.
Hi @marc ,
I may not be asking this clearly, but I have a simple and straightforward question:
Does MQTT support queue-based message consumption over a WebSocket connection on port 8443 in iOS? If so, could you please share relevant documentation or provide a code snippet along with some example images of the Solace UI dashboard?
Does MQTT support queue-based message consumption over a WebSocket connection on port 8443 in iOS? If so, could you please share relevant documentation or provide a code snippet along with some example images of the Solace UI dashboard?
No. MQTT has no concept of queues. You connect to a topic with a QoS. If it’s QoS1, it will consume messages from a persistent store (which is a queue under the covers in the Solace MQTT broker) but you always connect to a topic.
This is not unique to Solace PubSub+. It’s the MQTT spec.