Using websocket pub/sub

To be sure not misunderstanding it completely I would need some guidance about how pub/sub using websocket is supposed to work.

My understanding so far:

  1. Do API call “Create New Connection” for Publications.

  2. Use the obtained “websocketUrl” to setup MQTT secure websocket.
    E.g., “wss://a3uu8w64of2gip-ats.iot.eu-central-1.amazonaws.com/mqtt?X-Amz-Algorithm=…”

  3. Include the MQTT Client Id in the “Create a Subscription” HTTPS call.
    E.g.
    {
    “applicationId”: “246e5963-57e9-440f-9493-ac0a508b6475”,
    “deviceId”: “mqtt-explorer-ca7166d3”,
    “transport”: “websocket”,
    “topic”: “platform-api-conversations”,
    “subjectFilter”: “/conversations/[^/]+/messages/[^/]+$”,
    “expiryDateTime”: “2021-06-12T14:19:06.633Z”,
    “batchReceive”: true
    }

Due to no support in Postman for WebSocket I’m using a tool. E.g. MQTTBox.

Q1: Is there some detailed description regarding the websocket pub/sub that I have missed?

Q2: Shall anything more than “MQTT Client Id” be included when initializing the MQTT websocket?
-MQTT topics?

Q3: Using the Mitel web tool (https://office.dev.mitel.io/) to send messages to each other
-will that then publish information on the websocket?

Q4: How does the published content look?
-example?

Q5: Any supported tool that can be used as MQTT websocket client?
-or Mitel client reference implementation available?

Thanks

Hi secg,

I haven’t tried using the websocket pub/sub yet but just wanted to let you know that postman has added support (in beta) for websockets: https://blog.postman.com/postman-supports-websocket-apis

Thanks Arne.
Will take a look and see if the MQTT part can be handled.

Thanks Arne!

@secg - I’m still looking for a developer who’s available to write up more technical instructions on opening websockets with the Notification API, it’s just taking some time. To answer some your questions:

Q1: Is there some detailed description regarding the websocket pub/sub that I have missed?
A1: Not currently.

Q2: Shall anything more than “MQTT Client Id” be included when initializing the MQTT websocket? MQTT topics?
A2: I don’t believe so, but I’m still waiting on verification

Q3: Using the Mitel web tool (https://office.dev.mitel.io/) to send messages to each other
-will that then publish information on the websocket?
A3: Yes, it absolutely will.

Q4: How does the published content look?
A4: I will see if I can get a good example for you

Q5: Any supported tool that can be used as MQTT websocket client?
-or Mitel client reference implementation available?
A5: Not currently, no.

@secg - Here’s an example of the published content:

{
    "publicationId": "5b7b490a-6025-4301-85c3-d31340fb67eb",
    "topic": "node-sample-topic",
    "method": "POST",
    "subject": "subject",
    "content": {
        "data": "test"
    },
    "publisher": {
        "accountId": "105990045",
        "principalId": "testuser@mitel.com"
    },
    "subscription": {
        "subscriptionId": "f714718caeb6ce4a175151b69c2536c9"
    },
    "notification": {
        "createdOn": "2021-05-28T17:46:05.158Z",
        "correlationId": "cloudlink-notifications-node-sample-1f763fb8-91d4-4122-a5f2-756fdebb1c83"
    }
}

This was generated by a publication that we created, it wasn’t created by a specific event in another application or service. The first block of data is what is going to be most useful specifically topic, method, subject, and content.

@secg

Q2: Shall anything more than “MQTT Client Id” be included when initializing the MQTT websocket? MQTT topics?

That is correct, just the client Id needs to be defined.