spring-attic / spring-cloud-stream-binder-ibm-mq

Apache License 2.0
10 stars 29 forks source link

spring-cloud-stream-binder-ibm-mq is no longer actively maintained by VMware, Inc.

Spring Cloud Stream JMS Binder – IBM® MQ® Support Build Status

This module provides provisioning functionality for IBM® MQ® 8.x+ as required by spring-cloud-stream-binder-jms.

IBM® and MQ® are registered trademarks of International Business Machines Corporation.

How it works

Using PCF commands, a Topic is created for publishing messages. Receiving messages via consumer groups is implemented as Subscriptions created and subscribed to the Topic, which are then configured to deliver messages to created Queues (named according to consumer group name) from which the messages are processed.

Security constraints

Note that object creation is dependant on the security constraints enforced by the queue manager. The current implementation assumes that the user (if username is provided) used for authentication has the correct access rights to create Topic, Subscription and Queue objects.

Reusing existing objects is currently not tested but is possible and will be catered for in upcoming updates.

Versions tested

Currently only IBM® MQ® version 8.x has been tested.

Local test environment

One option to test the binder locally is to use the IBM® MQ® for Developers Docker image available on Docker Hub.

Included in this project is a docker-compose.yml file to build, configure and run a local Queue Manager instance. See the README.md for details.

Compiling the module

As the MQ Java libraries are proprietry licensed software, you must install the libraries into your configured Maven repository (local and/or remote).

From your IBM® MQ® installation directory under java/lib, install/add the following two libraries:

Below is an example of installing the two libraries into your local Maven repository:

$ mvn install:install-file
  -Dfile=<path-to-file>/com.ibm.mq.allclient.jar \
  -DgroupId=com.ibm \
  -DartifactId=com.ibm.mq.allclient \
  -Dversion=<version> \
  -Dpackaging=jar

$ mvn install:install-file
  -Dfile=<path-to-file>/com.ibm.mq.pcf.jar \
  -DgroupId=com.ibm \
  -DartifactId=com.ibm.mq.pcf \
  -Dversion=<version> \
  -Dpackaging=jar  

where <version> is the major version identifier of your IBM® MQ® installation. For example, -Dversion=8 for an IBM® MQ® version 8.x installation.

Now compile the IBM® MQ® binder with:

$ mvn -P ibmmq clean compile

Running integration tests

Make sure you have an IBM® MQ® Queue Manager instance running. If you are running the MQ Docker container via the included docker-compose.yml, you can run all the integration tests as is, with:

$ mvn -P ibmmq clean test -Dtest=EndToEndIntegrationTests -DfailIfNoTests=false

otherwise adjust the connection details according to your queue manager.

Known issues

If no consumer group (spring.cloud.stream.bindings.input.group / spring.cloud.stream.bindings.output.producer.required-groups) is provided, an anonymous group is generated. The corresponding topic, subscription and queue provisioned will not be removed at any point. If you run many apps without a specific consumer group set, you will incur many orphaned anonymous objects.

These objects must be cleaned up manually.