An open API service indexing awesome lists of open source software.

https://github.com/marcelmay/g-mqs

A WebSphere MQS Groovy wrapper
https://github.com/marcelmay/g-mqs

Last synced: 9 months ago
JSON representation

A WebSphere MQS Groovy wrapper

Awesome Lists containing this project

README

          

A WebSphere MQS Groovy wrapper
------------------------------

g-mqs provides a [Groovy](http://groovy.codehaus.org) DSL wrapper around
[WebSphere MQS](http://www.ibm.com/software/products/en/wmq) client API.

Groovy example
--------------
[(See full standalone Groovy script including @Grape)](samples/send-receive-example.groovy)
```groovy
new Mqs().hostname('localhost').port(1414).channel('TEST_CHANNEL').withQueueManager('test_qm') {
String correlationId = 'some.correlation.id'
withQueue('myQueue', Mqs.QueueOptions.SEND) {
sendToQueue('My message', correlationId)
...
}
withQueue('myQueue', Mqs.QueueOptions.RECEIVE) {
timeout(2000)
String response = receiveMessageByCorrelationId(correlationId)
println('Received: ' + response)
...
}
withQueue('myQueue', Mqs.QueueOptions.RECEIVE) {
purgeQueue()
...
}
}
```

Building from source
--------------------

### Gradle

The project requires Gradle for building from source. If you do not have Gradle installed yet, have a look at
the [Gradle homepage](http://gradle.org).

### MQS Dependencies : Maven REPO vs. local

The required WebSphere MQS JARs are commercially licensed by IBM and are therefore not available by public Maven repos.

**Tip:** There's an evaluation version [available](http://www.ibm.com/software/products/en/wmq)!

You'll have to spawn these to your (local) Maven repo using the Gradle helper:

1. Go to the helper directory:
```cd mqs-repo-spawning```

2. Copy the following list of MQS JARs into this directory:
```
com.ibm.mq.commonservices.jar
com.ibm.mq.connector.jar
com.ibm.mq.headers.jar
com.ibm.mq.jar
com.ibm.mq.jmqi.jar
com.ibm.mq.jmqi.local.jar
com.ibm.mq.jmqi.remote.jar
com.ibm.mq.jmqi.system.jar
com.ibm.mq.jms.admin.jar
com.ibm.mq.pcf.jar
com.ibm.mqetclient.jar
com.ibm.mqjms.jar
com.ibm.msg.client.commonservices.j2se.jar
com.ibm.msg.client.commonservices.jar
com.ibm.msg.client.jms.internal.jar
com.ibm.msg.client.jms.jar
com.ibm.msg.client.matchspace.jar
com.ibm.msg.client.provider.jar
com.ibm.msg.client.ref.jar
com.ibm.msg.client.wmq.common.jar
com.ibm.msg.client.wmq.factories.jar
com.ibm.msg.client.wmq.jar
com.ibm.msg.client.wmq.v6.jar
dhbcore.jar
```

3. Update the *build.gradle*
You probably want to set the correct MQS version for your JARs, and maybe the local or remote repo.
Note that for the MQS version, you will also have to update the MQS dependency version in the top level *build.gradle*.

4. Run Gradle
By default this will spawn the JARs to your local repo.
```gradle uploadArchives```

### Compiling and creating JARs

To compile and create the JARs, run

```gradle clean install```