ibm-messaging / mq-container

Container images for IBM® MQ
Apache License 2.0
255 stars 189 forks source link

How to configure MQTT channel #494

Closed aliraza995 closed 2 years ago

aliraza995 commented 2 years ago

I am working on a project where we need to use mqtt protocol to communicate with IBM MQ. I was trying to configure ibm mq docker container with mqtt channel configured but unable to configure it so far. Can you suggest if its possible if yes. Can you suggest how?

callumpjackson commented 2 years ago

You will need to rebuild the container image and enable the MQTT feature. This is down by editing the install-mq.sh file from: export genmqpkg_incmqxr=0 to export genmqpkg_incmqxr=1 Then as part of the container build process the MQTT feature should be included.

arthurbarr commented 2 years ago

The sample container doesn't have MQTT installed or configured, so you'll need to build your own image. I'm not aware of anyone who has done it, but it should certainly be possible. A few pointers:

  1. You'll need to install the MQXR package, which you can enable in the install-mq.sh script.
  2. I don't think the XR server gets started automatically, so you'll need to start the XR server at runtime.
    • You could do it through an MQ "service" configured via MQSC
    • We already start the MQ web server in post_init.go, so you could do it from the Go code there.
    • Alternatively, I think you could create a separate container which shares an IPC namespace (as Pods do in Kubernetes), and run it in a separate container.
  3. If you decide to run it in the same container, you might want to mirror the logs to the container stdout, which we already do for the other logs.