Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
Purpose/Approach:
JMS (Active MQ is a JMS broker implementation) can be used as a mechanism to allow asynchronous request processing. You may wish to do this because the request take a long time to complete or because several parties may be interested in the actual request. Another reason for using it is to allow multiple clients (potentially written in different languages) to access information via JMS. Active MQ is a good example here because you can use the STOMP protocol to allow access from a C#/Java/Ruby client. A real world example is that of a web application that is used to place an order for a particular customer. As part of placing that order (and storing it in a database) you may wish to carry a number of additional tasks:
Store the order in some sort of third party back-end system (such as SAP)
Send an email to the customer to inform them their order has been placed To do this your application code would publish a message onto a JMS queue which includes an order id. One part of your application listening to the queue may respond to the event by taking the order Id, looking the order up in the database and then place that order with another third party system. Another part of your application may be responsible for taking the order Id and sending a confirmation email to the customer.
Contents:
Introduction of IBM Integration Bus
What is IIB..........
What is JMS .........
Approach in IIB/MQ for JMS
How to setup jms in mq............
Node implementation for jms in IIB......
Debug Mode.......
Result
Output........
What is IBM Integration Bus:
IBM Integration Bus (formerly known as WebSphere Message Broker) is
IBM's integration broker from the WebSphere product family that allows
business information to flow between disparate applications across
multiple hardware and software platforms. Rules can be applied to the
data flowing through the message broker to route and transform the
information. The product is an Enterprise Service Bus providing
connectivity between applications and services in a service-oriented
architecture.
What is JMS:
Java Message Service (JMS) is an application program interface (API) from Sun Micro systems that supports the formal communication known as messaging between computers in a network. Sun's JMS provides a common interface to standard messaging protocols and also to special messaging services in support of Java programs.
How to setup jms in mq:
This setup will guide you from creating the Queue-Manager to connect the queue
with JMS, So I follow the start from the queue-manager.
Step1: Create a queue-manager
Queue-Manager → New → Queue-Manager
Step2: Give the Queue-Manager name
Step 3: Create Local queues in JMS_QueueManager
We need three queues for this JMS sample(JMS_LOCAL_QUEUE,IN,OUT)
Queue → New → Local queue
JMS_LOCAL_QUEUE
IN QUEUE
OUT QUEUE
Step 4: Create the connection factory and binding the queue with the Connection
factory
Open the Connection factory QF1 and go to the property to bind the Queue-
Manager
QF1 → Properties → Connection → Base Queue-Manager → JMS_QueueManager
QF1 → Properties → Connection → Broke Queue-Manager→JMS_QueueManager
Step 5: Convert a Local Queue to JMS queue.
Choose a Queue → Create a JMS Queue → JMS Context → Choose a JNDI
Directory → General Property → Queue-Manager Name → Give the Queue-
Manager Name
General Property → Queue → Give the JMS Queue Name
Step 6: Go to the JMS Admin and click on the destination side and check the JMS
configured queue will present there or not.
Step 7: Check the Property in that JMS Queue.
Node implementation for jms in IIB:
Step 1: Create a Integration Node and give the Queue-Manager Name
Step 2: Create a message flow for JMS Output node
File → New → Messageflow → Give the name for the Message Flow
Step 3: Take node from the Palette
Nodes are
1.MqInput Node: For Mq connectivity
2.MqJmsTransform Node: To convert the data for the JMS Queue-Manager
3.Jms Output Node: To store the data in JMS Queue-Manager
Step 4: Set the JMS Configuration in IIB, In JMS Output Node
JMS Output Node → Basic → Destination Queue → give your jms queue name
JMS Output Node → JMS Connection → Location JNDI Binding → give the jndi file
path
JMS Output Node → JMS Connection → Connection Factory Name → give the
connection factory name
Step 5: Create the input flow in same way just we need different node and we
will do the same configuration with the JMS Input node also, but we will take
JMSMQTransformer then it will work fine.
Debug Mode:
Deploy the JMS Input Node Flow for the next flow Debugging mode:
Result and Reference:
The Total Flows are
1. MQ Input Node(IN) → MQJMS Transform → JMS Output Node(JMS_LOCAL_QUEUE)
2. JMS Input Node(JMS_LOCAL_QUEUE) → JMSMQ Transform → MQ Output Node(OUT)