Configure IBM MQ for use with blockchain
Set up and run the IBM MQ Bridge to blockchain to securely connect an IBM MQ Advanced or IBM MQ Advanced for z/OS Value Unit Edition queue manager and IBM Blockchain. Use the bridge to asynchronously connect to, look up and update the state of a resource in your blockchain, by using a messaging application that connects to the IBM MQ Advanced or IBM MQ Advanced for z/OS VUE queue manager.
Before starting
Attention: The IBM MQ Bridge to blockchain built on Hyperledger Composer is no longer supported.We must be running IBM MQ Version 9.1.4 or later to use the IBM MQ Bridge to blockchain built on Hyperledger Fabric.
- IBM MQ Bridge to blockchain is available for connecting to:
- IBM MQ Advanced, or
- IBM MQ Advanced for z/OS VUE
queue managers only.
- The queue manager must be at the same command level as the bridge, or above; for example Version 9.2.0.
- IBM MQ Bridge to blockchain is supported for use with your blockchain network that is based on Hyperledger Fabric Version 1.4 architecture.
About this task
Blockchain is a shared, distributed, digital ledger that consists of a chain of blocks that represent agreed upon transactions between peers in a network. Each block in the chain is linked to the previous block, and so on, back to the first transaction.
IBM Blockchain is built on Hyperledger Fabric and we can develop with it locally with Docker or in a container cluster in IBM Cloud. We can also activate and use the IBM Blockchain network in production, to build, and govern a business network with high levels of security, privacy, and performance. For more information, see the IBM Blockchain Platform.
Hyperledger Fabric is an open source, enterprise blockchain framework that is developed collaboratively by members of the Hyperledger Project, including IBM as the initial code contributor. Hyperledger Project, or Hyperledger, is a Linux Foundation open source, global, collaborative initiative to advance cross-industry blockchain technologies. For more information, see IBM Blockchain, Hyperledger Projects, and Hyperledger Fabric.
If we are already using IBM MQ Advanced, or IBM MQ Advanced for z/OS VUE, and IBM Blockchain, we can use the IBM MQ Bridge to blockchain to send simple queries, updates, and receive replies from your blockchain network. In this way, we can integrate your on-premises IBM software with a cloud blockchain service.
We can see a brief overview of the bridge operating process in Figure 1. A user application puts a JSON formatted message on the input/request queue on the IBM MQ Advanced, or IBM MQ Advanced for z/OS VUE queue manager. The bridge connects to the queue manager, gets the message from the input/request queue, checks that the JSON is correctly formatted, then issues the query or an update to the blockchain. The data that is returned by the blockchain is parsed by the bridge and placed on the reply queue, as defined in the original IBM MQ request message. The user application can connect to the queue manager, get the response message from the reply queue, and use the information.
We can configure the IBM MQ Bridge to blockchain to connect to a blockchain network as a participant, or peer. When the bridge is running, a messaging application requests the bridge to drive chaincode routines that query or update the state of the resource and return the results as a response, to the messaging application.
Procedure
-
Create and start a queue manager, or start an existing queue manager that we want to use with
the IBM MQ Bridge to blockchain.
Create queue manager:
crtmqm adv_qmgr_name
Start queue manager:strmqm adv_qmgr_name
-
Create the queues for the bridge that are defined in the DefineQ.mqsc
script.
Sample bridge queue definitions are provided for the default named queues that are used for:
- User credentials, for example SYSTEM.BLOCKCHAIN.IDENTITY.QUEUE
- Message input to the bridge, for example APPL1.BLOCKCHAIN.INPUT.QUEUE
- Replies from blockchain, for example APPL1.BLOCKCHAIN.REPLY.QUEUE
From the /opt/mqm/mqbc/samp directory, issue the following command:
runmqsc adv_qmgr_name < ./DefineQ.mqsc
Different applications can use the same input queue but we can specify multiple reply queues, one for each of the applications. You do not have to use defined reply queues. To use dynamic queues for replies, we must consider their security configuration.
Results
You created the queues that the bridge requires for processing messages from IBM MQ and your blockchain network.What to do next
Use the IBM MQ Advanced, or IBM MQ Advanced for z/OS VUE, queue manager information and the credentials from your blockchain network to create a configuration file for the IBM MQ Bridge to blockchain.- Create the configuration file for the IBM MQ Bridge to blockchain
Enter your queue manager and your blockchain network parameters to create the configuration file for the IBM MQ Bridge to blockchain to connect to the IBM MQ and IBM Blockchain networks. - Example Hyperledger Fabric network credentials file
Contents of the .yml file from your locally instantiated Hyperledger Fabric blockchain network running in Docker, used to configure the IBM MQ Bridge to blockchain. - Running the IBM MQ Bridge to blockchain
Run the IBM MQ Bridge to blockchain to connect to IBM Blockchain and IBM MQ. When connected, the bridge is ready to process request messages, send them to your Hyperledger Composer blockchain network, and receive and process the replies. - Additional configuration options for IBM MQ Bridge to blockchain
IBM MQ Version 9.1.2 introduces a change to the way in which tracing and logging work on IBM MQ Bridge to blockchain.
Parent topic: Configure IBM MQ