Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question : MQ Package to Publish / Subscribe to IBM MQ  #24

Closed
jameschensmith opened this issue Mar 24, 2018 · 4 comments
Closed

Question : MQ Package to Publish / Subscribe to IBM MQ  #24

jameschensmith opened this issue Mar 24, 2018 · 4 comments

Comments

@jameschensmith
Copy link

I need to publish / subscribe to IBM MQ queues / topics (v8.0.0.4 fixpack, so currently no AMQP support). Unfortunately I don't have the luxury of building against an instance of IBM MQ, as I'm working in a containerized environment.

Is there support for communicating to IBM MQ from a containerized, isolated Go application that's supported by other languages such as Java? The IBM post here uses this library as the go-to package for communicating with IBM MQ, but if you can't be isolated from the instance, it's usage is quite hindered. I'm curious if I just need the header files, like the previous mq-golang library was doing, to get this package to work or to be able to write a simple library to communicate with IBM MQ.

If this is not supported by this package and if anyone can direct me to an implementation where I can simply communicate with IBM MQ while being separated from where the instance is deployed, I would greatly appreciate it. Thanks!

@ibmmqmet
Copy link
Collaborator

I don't really understand what you mean by "isolated". This package can run as an MQ client, connecting to a queue manager elsewhere. It does require that you have the MQ C client installed underneath the Go bindings in order to run a Go program that connects to the qmgr. And to compile the Go bindings you have to have that C client package AND the SDK component that includes the header files (once compiled, then the header files are not needed for runtime).

But that can all be done inside containers.

There is a Dockerfile here that puts all of the MQ components into a container; it should be easy to see how to simplify it and only pull in the filesets needed for client compilation or runtime.

@jameschensmith
Copy link
Author

jameschensmith commented Mar 29, 2018

@ibmmqmet, thanks for the tips! I've been working on my own Dockerfile using the link you provided as an example. I feel like I am so close to getting it working, but I have hit a hurdle that I'm hoping you might have the answer to. I'm working in a CentOS environment, but the issue I'm having should be common with an Ubuntu image as well.

Response

Connection to <% Example Queue Manager %> failed.
MQCONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_HOST_NOT_AVAILABLE [2538]
Done.
exit status 2

Packages Included

ARG MQ_PACKAGES="MQSeriesRuntime* MQSeriesClient* MQSeriesSDK*"

I added the needed packages, and I am using docker run -it --rm <% Example Image Name %> and running the clientconn.go sample to connect to a remote Queue Manager for testing. I believe it might be the connection that I provided, but I successfully pinged the host from within the docker container, so I'm not positive. I'm working under a proxy, but l've been able to do this via a Java program, so I don't think it's the proxy. Any help that you can provide is much appreciated. Thanks!

Edit : It may be the port that I'm trying to connect to. I'm using the same port that I use for my Java program.

Edit 2: Got it to work, I wasn't following the correct format for the port using parenthesis. 🤦‍♂️ Thank you for the tip for the Dockerfile, @ibmmqmet. 😊👍

@chstout
Copy link

chstout commented Mar 31, 2018

@james-r-smith Is your solution something you can share publicly? I have a similar need - want a simple go app in a lightweight container (not new to Go, but new to IBMMQ). I was going to pull the ibmcom/mq image and add the go compiler, this package, and my source, and then statically build the app and throw it to a slimmer container from scratch. Did you need the full MQ server package or just the client?

@ibmmqmet
Copy link
Collaborator

See https://github.com/ibm-messaging/mq-container/tree/master/incubating/mq-golang-sdk for a sample Dockerfile that contains what is needed to build Go programs with MQ. There are more Dockerfiles and scripts in other directories of that repo that build the base containers used by it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants