Skip to Content
0
Dec 12, 2022 at 02:23 PM

Event Mesh - MQTT via Websocket questions

329 Views Last edit Dec 12, 2022 at 02:30 PM 2 rev

Hello everyone,

currently we are trying to connect a MQTT subscriber with Event Mesh but run into a problem.

When the MQTT client is connecting and subscribing to our queue topic, the connection is directly closed by EOF and the following error ist given: “MQTT connection lost. Reason: web socket: close 1006 (abnormal closure): unexpected EOF”

Since we want to use events, we would like to take MQTT via web socket.

The library used in our go application is the go paho MQTT library.

At the moment, the application is developed and tested on a local machine. The bearer token is received from the token endpoint by clientId and -secret successfully.

Options are:

Event Mesh Service Descriptor:
{
    "resources": {
        "units": "<units>"
    },
    "options": {
        "management": true,
        "messagingrest": true,
        "messaging": true
    },
    "rules": {
        "topicRules": {
            "publishFilter": [
                "${namespace}/*"
            ],
            "subscribeFilter": [
                "${namespace}/*"
            ]
        },
        "queueRules": {
            "publishFilter": [
                "${namespace}/*"
            ],
            "subscribeFilter": [
                "${namespace}/*"
            ]
        }
    },
    "version": "1.1.0",
    "emname": "<emname>",
    "namespace": "<namespace>"
}

MQTT client options:
  clientId=”test”, // Using clientId of Service Key didn't work either
  protocolVersion=4, // Meaning MQTT 3.1.1,
  broker="<wss broker uri from service key>",
  Http header: "Authentication: Bearer <oAuth2-token>",


MQTT client subscription options:
  topic=<namespace>/<queueName>,
  qos=1,

Any help on the following points would be much appreciated:

  • Is there a documentation/example available, including the Event Mesh options and corresponding MQTT client options for a "standard" MQTT client or even for go language?
  • Is it possible to get logs including the reason for connection / subscription denial?
  • Suggestions, why the options above are not working.

Thank you in advance

Matthias