Skip to content

This repository shows basic implementarions ibm-mq with Spring Boot.

Notifications You must be signed in to change notification settings

hi-im-yan/ibm-mq-basics

Repository files navigation

IBM-MQ-BASICS

Implementing producers, consumers, publishers and subscribers

This repository shows examples of how to configure multiple listeners, multiple senders and how to convert the message from the broker. The examples mostly uses default configuration. I did not configured things such as QOS, message lifetime, persistence, auto confirms and etc.

What is IBM MQ?

IBM MQ supports the exchange of information between applications, systems, services and files by sending and receiving message data via messaging queues. This simplifies the creation and maintenance of business applications. IBM MQ works with a broad range of computing platforms, and can be deployed across a range of different environments including on-premise, in cloud, and hybrid cloud deployments. IBM MQ supports a number of different APIs including Message Queue Interface (MQI), Java Message Service (JMS), REST, .NET, IBM MQ Light and MQTT.

Features

This repository uses abstract messages to exemplify the functionality. So I made a drawing of what it does and I hope it makes sense. Architecture model

Tech

This repository uses the following techs:

  • IBM MQ - For message queue
  • Spring Boot - For consuming and sending messages
  • Docker - For running the IBM MQ container
  • JAVA 8 - For programming with Spring Boot

Installation

First: the docker

docker volume create qm1data
docker run --env LICENSE=accept --env MQ_QMGR_NAME=QM1 --volume qm1data:/mnt/mqm --publish 1414:1414 --publish 9443:9443 --detach --env MQ_APP_PASSWORD=passw0rd --name QM1 icr.io/ibm-messaging/mq:9.2.0.0-r1

I did'nt use the latest versions because of some bugs that happens when you restart the container.

Second: the spring boot

Go to the root of each project and do this:

mvn clean install
mvn spring-boot:run

How to use

Now it's all setup to use, you should be able to send a message making a POST request to http://localhost:8080/queue with body:

{
    "title":"This message is beign sent to IBM MQ",
    "queueMessage":"This message is supposed to be processed by only one listener."
}

You should be able to send a topic making a POST request to http://localhost:8080/topic with body:

{
    "title":"This message is beign sent to IBM MQ",
    "topicMessage":"This message is supposed to be processed by all subscribers."
}

Swagger documentation is also available at http://localhost:8080/swagger-ui/index.html

About

This repository shows basic implementarions ibm-mq with Spring Boot.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages