Code Monkey home page Code Monkey logo

g-mqs's Introduction

A WebSphere MQS Groovy wrapper

g-mqs provides a Groovy DSL wrapper around WebSphere MQS client API.

Groovy example

(See full standalone Groovy script including @Grape)

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.

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!

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```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.