Skip to main content

Digital Experience

How To: Message Selectors in WMB & WMQ as JMS Publish Subscriber

WebSphere MQ, when used as a JMS provider, can be leveraged to implement one of the widely used architecture patterns, the Pub-Sub model. In this use case, we have a message flow as the service provider that connects to WMQ publisher and another consumer message flow that uses WMQ topics as a subscriber within WebSphere Message Broker. Here message selectors are used as filter criteria for a given topic string. The steps below will guide you through the implementation of the use case.

Create Topic to Publish Messages

1. Create Topic to publish messages: Expand QM (MQ Explorer) -> Select “Topics” -> New -> Topic

New Topic
Create JMS Administered Objects

1. Create initial context under “JMS Administered Objects” ->”Add Initial Context.”

Add Initial Context

2. Under Initial context created above, create Connection Factory and specify the Base Queue Manager.

New Connection Factory 1

New Connection Factory 2

Within the install location, run “JMSAdmin.bat”. In Windows environment you would most likely find it in location below:

ConsortiumNumber of MembersPremier Financial Services MembersLeader(s)Start DateFocus/Goal
R3CEV84DTCC, American Express, Bank of America Merrill Lynch, Wells Fargo, Citigroup, TD Bank, BBVA, Bank of New York Mellon, Northern Trust, HSBC, BarclaysR3, CEV2014General-purpose platform and technology to design and deliver advanced distributed ledger technologies to the financial services market.
Digital Asset Holdings15Deutsche Borse, J.P. Morgan, DTCC, ABN AMRO, Goldman Sachs, Santander, Citi, IBMDAH2014Capital markets – post-trade settlement. Building distributed, encrypted straight through processing tools to improve efficiency, security, compliance, and settlement speed.
Hyperledger Project 142J.P. Morgan, Barclays, Deutsche Bank, Wells Fargo, UBS, BBVA, Bank of New York MellonLinux Foundation, IBM, Cisco, Intel, SWIFT, DAH2015General purpose blockchain. Open source collaborative effort based on IBM’s Fabric codebase, which was created to advance cross-industry blockchain technologies. It is a global collaboration that includes leaders in finance, banking, the internet of things (IoT), supply chain, manufacturing, and technology. The Linux Foundation hosts Hyperledger as a Collaborative Project under the foundation.
Ethereum116J.P. Morgan, Santander, BNY Mellon, BBVA, Bank of New York MellonMicrosoft, Intel 2017Considering a more distributed approach to self-management rather than the more traditional leadership structure adopted by competing blockchain consortia like R3CEV and Hyperledger. Offers smart contract features that contain a virtual machine, executing peer-to-peer contracts using a cryptocurrency known as Ether.
Ripple75UBS, Standard Chartered, Santander, CIBC, Sumitomo Mitsui Banking Corporation (SMBC), MUFG, MizuhoGoogle, IDG Capital Partners 2012Payments. A real-time gross settlement system (RTGS), currency exchange and remittance network by the company of the same name. The Ripple Transaction Protocol (RTXP) or Ripple protocol is built upon a distributed open-source Internet protocol, consensus ledger and native currency called XRP (ripples).
Kinakuta35Ethereum FoundationMicrosoft,
ConsenSys
2016Working group dedicated to improving smart contracts security.

In Unix server, you would have to run using the command below.

FunctionCurrent ProcessFuture ProcessImpacted
Security and Digital Identity – Compliance (KYC)The Know Your Customer (KYC) regulation is an integral part of global anti-money laundering (AML) efforts. Compiling and maintaining these databases is expensive for financial services; this can lead to duplication of effort and can delay transactions.If digital identities are recorded on a blockchain shared ledger, an individual can add devices to their identity and add authorization to transact on their behalf. Verifiable and robust identities, cryptographically secured
blockchain technology could provide a single digital source of ID information, allowing for the seamless exchange of documents between banks and external agencies. This would likely result in automated account opening and reduced resources and costs, while maintaining the legally required privacy of data.
All financial services firms, payment card networks, regulators
Cross-border PaymentsCross-border payments use SWIFT messaging. Fees are leveraged by multiple intermediaries.BBVA cleared a real money transfer between Spain and Mexico in minutes. One-fee
Smart contracts can be coded to reflect any data-driven business logic. For example:
•Cross-border transactions
•Digitalizing letters of credit
•Loan repayments
Consumer banks, commercial banks
Clearing & SettlementCentralized clearing and settlement for all financial instruments. Settlement can take from days to weeks, depending on the complexity of the transaction.Settlement can be done in minutes using blockchain.

A fundamental advantage of a distributed ledger system, in which no single company has control, is that it resolves problems of disclosure and accountability between individuals and institutions whose interests are not necessarily aligned. It gives each member of the network far greater and timelier visibility of the total activity.

DTCC has already proven that complex post-trade events inherent to credit default swaps (CDS) can be managed with distributed ledger technology in a permissioned, distributed, peer-to-peer network.
Investment banking, asset management, corporate banking, hedge funds, ForEx trading, clearinghouses, central banks, regulators
Transfer of Ownership (Contracts, Titles)Transferring title of a property or negotiating contractual terms for financing, funding and loads is a long and onerous process with multiple intermediaries, include the legal profession.Securities based on payments and rights that are executed according to predefined rules can be written as smart contracts.

A smart contract is any contract that can automatically enforce itself without the need for a trusted intermediary. Any contract can be a smart contract if the terms of the contract can be automated. The blockchain assures that everybody is seeing the same thing at the same time, which negates the need for trust.
All banks, legal profession, real estate industry, regulators
Asset ManagementEach party in the trade lifecycle (e.g., broker dealers, intermediaries, custodians, clearing and settlement teams) currently keeps its own copy of the same record of a transaction, creating significant inefficiencies and room for error.Blockchain technology would provide an automated trade lifecycle in which all parties to the transaction would have access to the exact same data about a trade. This would lead to substantial infrastructural cost savings, effective data management and transparency, faster processing cycles, minimal reconciliation, and a reduced need for brokers and intermediaries.Asset management banks, broker-dealers, custodians
Smart Assets (Supply Chain/Trade Finance)Primary pain points for supply chain firms are: no visibility of payments, long payment schedules, demand management.Blockchain provides a system of trusted records that addresses all three.
Digitizing letters of credit and bills of lading facilitates a smart asset tracking system. Tracking assets that are rich in data can be turned into information for corporate clients.
Financing firms, supply chain industry
LendingMultiple intermediaries and fees for bank loans, mortgages, credit card debt, government bonds, muni bonds, asset-back securities Both loan and collateral can be stored in a blockchain. A smart contract can automatically revoke access to the collateral if the terms of the loan are broken.

Debt can be issued, traded and settled on the blockchain. Improves small business lending and lending for the unbanked (Approx. 2bn – World Bank).
Commercial banking, consumer banking, payment card network, money transfer services, telecommunications, regulators
FundingFunding and investing in an asset, IPOs, dividends, capital appreciation, rental incomePeer-to-peer financing, recording of corporate actions, automatic payment of dividends, smart contracts for title registries. Contracts that monitor the performance of digital or non-digital assets can also be used as futures, forwards, swaps, and options.Investment banking, corporate banking, real estate, legal
InsuranceManaging risk, derivatives, insuring assetsDecentralized markets for insurance, more transparent derivativesInsurance, risk management, brokerages, corporate banks, clearinghouses, regulators
GovernanceAccounting for valueA distributed ledger will mean real-time audit and financial reporting capabilities. Transparency of the blockchain improves regulatory management.Audit, asset management, regulators, banks
Recording and storing transactions and custodyCentralized recording and storage of financial assets, currencies, commodities for all types of accounts Cryptographic mathematical equations and immutable blockchain secures recording and storing of all transactions. Will reduce need for typical financial services accounts (brokerage, checking, savings, etc.).Consumer banks, Investment banks, brokerages, asset management, regulators

Unix Command

3. Create Destination (Queue/Topic) under Initial Context created in Step 2 and with the same Topic string as we created in Step 1 highlighted below.

JMSTopic - Properties

Unix Command 2

 

Message Flow Configuration

1. Create Publish flow and configure JMSOutput node to specify the Topic.

Publish flow - JMSOutput

Publish flow - JMSOutput 2

Publish flow - JMSOutput 3

2. Optionally, you could specify the Application Property to be used as Message Selector either using ESQL(a) or JMSHeader node(b).

a) 

SprintDaysStory PointsTakt Time
Sprint 11061.67
Sprint 21061.67
Sprint 31052.00
Sprint 4881.00
Sprint 51081.25
Sprint 61071.43
Sprint 7890.89
Sprint 81091.11
Sprint 91081.25
Sprint 10991.00

b)

Publish flow - JMSHeader

Publish flow - JMSHeader 2

3. Create Subscription message flow to read messages published on a topic using Message Selectors.

Publish flow - JMSInput

Publish flow - JMSInput 2

Publish flow - JMSInput 3

Publish flow - JMSInput 4

 

Creating Subscriptions Using MQ Explorer

You could also create multiple subscriptions for the same Topic but with different destination queue and message selector: Expand QM (MQ Explorer) -> Select “Subscriptions” -> New -> subscription.

Note: Select previously created Topic, destination Queue name, and message selector when creating the subscription.

New Subscription

 

What’s next?

If you’re still using WebSphere Message Broker, it might be time to think about upgrading your ESB. Whether you’re using an unsupported version of WMB or want the features of the newest IIB release, use our best practices compiled over the course of countless migrations to ease the process and maximize your IBM investment.

WMB to IIB

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.