IBM® WebSphere® Process Server is a business process integration server that helps you solve complex business flows and a platform that you can use to connect to various technologies. Businesses seeking to use WebSphere Process Server to implement these complex business processes have to be connected to other back-end or front-end systems in order for these business processes to work properly. TIBCO Enterprise Message Service (EMS) is a common messaging resource used by businesses. This article demonstrates how easily WebSphere Process Server processes can be connected to EMS. Since EMS supports Java™ Message Service (JMS), we will use the JMS support of WebSphere Process Server to bind to EMS. Using the techniques and configuration described in this article, you will be able to send messages to business processes.
This article provides a scenario that consists of a message producer (Session Bean) that sends a message to EMS. A TIBCO Listener Bean picks up the message from the EMS queue and then sends it to the WebSphere Process Server (JMS) queue. The Business Process Execution Language (BPEL) business process picks up the message from the WebSphere Process Server queue and prints the contents. Figure 1 shows the visual representation of the flow:
Figure 1. The scenario shows the visual representation of the flow
The following software is required to run this example:
- WebSphere Integration Developer V6.0.x.
- TIBCO EMS server.
- WebSphere Process Server V6
Configuring EMS and WebSphere Process Server
This section walks you through the following steps for configuring EMS and WebSphere Process Server:
- Start the EMS server.
- Create the EMS administered objects.
- Configure WebSphere Process Server for the EMS.
- Add EMS as a JMS provider to WebSphere Process Server.
- Configure the JNDI bindings for the EMS Connection Factories for WebSphere Application Server.
- Configure the JNDI bindings for TIBCO Enterprise Message Service Destinations for WebSphere Application Server.
- Create the Listener Ports for EMS.
- Create the Connection Factories and Destinations for WebSphere Default Messaging.
You can begin by starting the EMS server:
- Install the EMS (evaluation copy).
- Start the EMS server. Choose Start => All Programs => TIBCO => TIBCO EMS Evaluation Version => Start EMS Server.
- Start the EMS server Admin Console. Choose Start => All Programs => TIBCO => TIBCO EMS Evaluation Version => Start EMS Server Administration Tool.
- Type in
connectand press Enter. - Press Enter for login and password (no security configured), and you will see a message saying connected to tcp://localhost:7222 and the same as the command prompt.
Create the EMS administered objects
Create the following objects administered by EMS:
- Start the admin tool and enter the following commands:
- Create factory sample.XAQCF xaqueue.
- Create queue sample.Q1.
Configure WebSphere Process Server for the EMS JNDI provider
You also need to configure WebSphere Process Server for the JNDI provider.
- Create a text file called jndi.properties in the directory: INSTALL ROOT AppServer lib ext.
- Add the following line into the file: java.naming.factory.url.pkgs=com.tibco.tibjms.naming.
- Save the jndi.propertiesfile.
This allows both the WebSphere Application Server and client container to find the EMS URLConnectionFactory when it encounters the tibjmsnaming JNDI naming scheme.
Adding EMS as a JMS provider to WebSphere Process Server Process Server
Complete the following steps to add EMS as a JMS provider to WebSphere Process Server Process Server.
- Start Process Server (if you have not already done so).
- Start the Process Server Administrative Console.
- Expand Resources and choose Generic JMS Providers.
- Click New.
- Enter the following values for the given properties: Name TIBCO Description TIBCO Enterprise Message Service Classpath point to location of tibjms.jar External Initial Context Factory com.tibco.tibjms.naming.TibjmsInitialContextFactory External Provider URL tibjmsnaming://localhost:7222.
- Click OK.
- Click Save on the task bar at the top of the console window.
- To have the changes take effect immediately, stop, and restart WebSphere Application Server.
Configure the JNDI bindings for EMS Connection Factories for WebSphere Application Server
Next, configure the JNDI bindings:
- From the Process Server Administrative Console, expand Resources and choose Generic JMS Providers.
- In the content pane, choose TIBCO.
- Scroll down and choose JMS Connection Factories.
- Click New.
- Enter the following values for the given properties:
- Name TIBCOConnectionFactory.
- Type QUEUE.
- JNDI Name jms/ConnectionFactory.
- Description Sample Queue ConnectionFactory.
- External JNDI Name sample.XAQCF.
- Click OK.
- Click Save on the task bar of the Administrative Console (and Save again to confirm).
- To have the changes take effect immediately, stop, and restart the WebSphere Application Server.
Configure the JNDI bindings for TIBCO EMS destinations for WebSphere Application Server.
- From the Process Server Administrative Console, expand Resources and choose Generic JMS Providers.
- In the content pane, choose TIBCO.
- Scroll down and choose JMS Destinations.
- Click New.
- Enter the following values for the given properties:
- Name Q1.
- Type QUEUE.
- JNDI Name jms/Q1.
- Description Sample Listen Queue.
- External JNDI Name sample.Q1.
- Click OK.
- Click Save on the task bar of the Administrative Console (and Save again to confirm).
- To have the changes take effect immediately, stop and restart the WebSphere Application Server.
Next, create the Listener Ports for EMS.
- From the Process Server Administrative Console, expand Servers and choose Application Servers.
- In the content pane, choose the name of the application server.
- In the Additional Properties Table, select Message Listener Service.
- In the content pane, select Listener Ports.
- In the content pane, click New.
- Enter the following values for the given listener port properties:
- Name TIBCOPtoPListenerPort.
- Initial State Started.
- Description Listener Port for TIBCO Point to Point.
- ConnectionFactory JNDI Name jms/ConnectionFactory.
- Destination JNDI Name jms/Q1.
- Click OK.
- Click Save on the task bar of the Administrative Console (and Save again to confirm).
- Stop and restart the application server to have the changes take effect.
After the application server has restarted, use the Process Server Administrative Console to verify that the new listener ports are in their proper initial state. To do this, expand Servers => Application Servers, then choose your server name in the following: content pane, Message Listener Service, and on Listener Ports. The new TIBCO listener ports should have a solid green arrow under the status column indicating that they are started.
Create Connection Factories and Destinations for WebSphere Default Messaging
Now, you can create the Connection Factories and Destinations:
- Create a Service Integration Bus (SIBus) named MyBus and Destination names TIBCO_WPS_Queue on this bus.
- Create a JMS Queue Connection Factory with following values:
- Name MyQueueConnectionFactory.
- JNDI Name jms/MyConnectionFactory.
- Bus MyBus.
- Create JMS Connection Factory.
- Name TibcoConnectionFactory.
- JNDI Name jms/TibcoConnectionFactory.
- Bus MyBus.
- Create a JMS Queue with following values:
- Name TIBCO_WPS_JMS_Queue.
- JNDI Name jms/tibcowpsq.
- Queue Name TIBCO_WPS_Queue.
- Bus MyBus.
- Create a JMS Activation Spec with following values:
- Name TIBCO_WPS_AS.
- JNDI Name eis/tibcowpsas.
- Destination Type Queue.
- Destination JNDI name jms/tibcowpsq.
- Bus MyBus.
In order to create a business process, you need to create the library, business objects, interfaces, modules, and a business process.
- Open WebSphere Integration Developer and switch to the Business Integration perspective.
Figure 2. Business Integration perspective
- From the Business Integration tab, choose New => Library to create a library called Tibco_Library.
Figure 3. Tibco Library
- In the Library Name field, type in
Tibco_Library, then click Finish.
Figure 4. New library named Tibco Library
- In the Tibco_Library, right-click the Data Types to create a new Business Object called TibcoMessage.
Figure 5. Business Object
- In the Business Object editor, create the following Business Object structure, with the message as one attribute of type
String(see Figure 6).
Figure 6. Business Object structure
- In the Tibco_Library, right-click the Interfaces to create a new Interface called
TibcoMessageIntf.
Figure 7.TibcoMessageIntfInterface
- In the Interface editor, create a one-way Interface operation called
ReceiveMessage.
Figure 8. Interface operation
- Create two inputs namely, req1 and req2 for the operation
ReceiveMessage. Set data types of both inputs asTibcoMessage.
Figure 9. Data types
- From the Business Integration tab, choose New => Module to create a module called
ReceiveTibcoMessage.
Figure 10. Creating a module
- In the module Name field, type in
ReceiveTibcoMessage, and then click Finish.
Figure 11. Naming the module
- Select Tibco_Library as Required Libraries and click Finish.
Figure 12. New module
- In the
ReceiveTibcoMessagemodule, right-click the Processes under Business Logic to create a business process calledTibcoMessageBP.
Figure 13.TibcoMessageBPmodule
- In the Select the interface dialog box, select the interface called TibcoMessageIntf, then click Finish.
Figure 14.TibcoMessageIntfmodule
- In the Business process editor, select the snippet from the left palette to create a snippet called Printing Tibco EMS Message.
Figure 15. Create a snippet
- In the snippet editor, click the standard Java utility to open the box for selecting the "print to log" utility.
Figure 16. Add a snippet
- In the snippet editor, drag the input variable Req1 on the right-hand side and choose the required element (message).
Figure 18. Snippet: Choosing the required element
- The final snippet looks like Figure 19.
Figure 19. Final snippet
- In the Assembly editor, drag the business process.
Figure 20. Assembly Diagram
- In the Assembly editior, right-click the business process and generate the JMS export by selecting Generate Export => Messaging Binding => JMS Binding.
Figure 21. Generate the JMS Export
-
In the Configure JMS Export Service dialog box, type in
jms/tibcowpsqfor the Receive destination andeis/tibcowpsasas the Activation spec JNDI name. Use Business Object XML using JMSTextMessage as Databinding.
Figure 22. Configuring the export
- Check out the final assembly diagram in Figure 23 below:
Figure 23. Final Assembly Diagram
Creating the TIBCO EMS Message Producer
The TIBCO Message producer is a session bean that will put message into TIBCO EMS queue. This requires creation of Session bean.
- In WebSphere Integration Developer, switch to the J2EE perspective.
- From the J2EE perspective, create a new EJB project.
Figure 24. Create a new EJB project
- In the EJB project Name field, type in
TibcoEMSMessageProducerand then click Next.
Figure 25. Naming the EJB project
- Click Finish.
Figure 26. The new EJB project
- Expand the EJB project and right-click Session Bean, then create a New Session Bean.
Figure 27. Creating a new Session Bean
- In the Session Bean Name field, type in
TibcoEMSMessageSender.
Figure 28. Naming the Session Bean
- Double-click the TibcoEMSMessageSenderBean. Create a method called
publishMessage. Place the following code there:
Listing 1. Session Bean's publishMessage methodpublic void publishMessage(String messageString) throws Exception { try { System.out.println("Sending Message to TIBCO EMS Queue..."); InitialContext context = new InitialContext(); ConnectionFactory cf = (ConnectionFactory) context.lookup(SEND_CF); Destination dest = (Destination) context.lookup(SEND_DEST); Connection conn = cf.createConnection(); Session jmsSession = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = jmsSession.createProducer(dest); TextMessage message = jmsSession.createTextMessage(); message.setText(messageString); producer.send(message); producer.close(); jmsSession.close(); conn.close(); } catch (Exception e) { System.out.println("Error in publish message SLSB"); mySessionCtx.setRollbackOnly(); throw e; }
The above code is also there in the attached project interchange file, namely; TibcoMessageProducerAndReceiver.zip
Configuring the Resource references
Resource references needs to be configured on TibcoEMSMessageProducer bean (for it to put message on TIBCO EMS queue).
- Double-click the Deployment Descriptor for TibcoEMSMessageProducer bean.
Figure 29. Deployment Descriptor
- Click the References tab. Select the bean and click Add.
Figure 30. Add References
- On the Add Reference box, select Resource reference, and click Next.
Figure 31. Add Reference
- Type
jms/TibcoConnectionFactoryRefas Name and Type asjavax.jms.Connectionfactory. Select Shareable as connection. Click Finish.
Figure 32. Connectionfactory
- Enter jms/ConnectionFactory as the jndi name.
Figure 33. Naming the Connectionfactory
- Create message destination reference for the jms queue.
Figure 34. Creating a destination reference
- Select the type as javax.jms.Queue and Usage as producers.
Figure 35. Queue
- Type jms/Q1 in the JNDI name under the WebSphere Binding tab and click Save.
Figure 36. JNDI name
Creating the TIBCO Message Receiver Message Drive Bean (MDB)
The TIBCO Message Receiver MDB will receive a message from TIBCO EMS and then send it to Process Server (business process). Hence, it is required to create the MDB with required Resource references as mentioned in steps below.
- In WebSphere Integration Developer, switch to the J2EE perspective.
- From the J2EE perspective, create a new EJB project called TibcoEMSMessageReceive.
Figure 37. Create the EJB project
- Create the Message Driven Bean and name it TIBCOListener.
Figure 38. Create the Message Driven Bean
- Open the Deployment Descriptor of the MDB. Click the Bean Tab and navigate to WebSphere Bindings.
On the listener port, type
TIBCOListenerPortthat we created.
Figure 39. Message Driven Bean listener port
- Go to the References tab. Create following Resource references:
Resource references setting in deployment descriptor Reference Name Type JNDI Name jms/MyConnectionFactoryRef javax.jms.QueueConnectionFactory jms/MyConnectionFactory jms/TibcoConnectionFactoryRef Javax.jms.ConnectionFactory jms/TibcoConnectionFactory jms/DestinationRef javax.jms.Queue jms/tibcowpsq
Figure 40. Resource references
- Open the TIBCOListenerBean.java class. Create the
sendToBusinessProcessmethod:
Listing 2. TIBCOListenerBeanpublic void sendToBusinessProcess(String msg) throws Exception { InitialContext initCtx = new InitialContext(); // Finding the WAS QueueConnectionFactory javax.jms.ConnectionFactory qcf = (javax.jms.ConnectionFactory) initCtx.lookup(SEND_CF); // Finding the Queue Destination Destination q = (Destination) initCtx.lookup(SEND_DEST); // Create JMS Connection Connection connection = qcf.createConnection(); // Create JMS Session Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); // Create MessageProducer and TextMessage MessageProducer queueSender = session.createProducer(q); TextMessage outMessage = session.createTextMessage(); outMessage.setText(messageText1+msg+messageText2+messageText3+msg+messageText4); // set target operation name for WESB default JMS function selector outMessage.setStringProperty("TargetFunctionName", "ReceiveMessage"); // Set type and destination and send outMessage.setJMSType("ReceiveMessage"); outMessage.setJMSDestination(q); queueSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT); queueSender.send(outMessage); connection.close(); System.out.println("Send completed"); }
The class can be found in following project Interchange file: TibcoMessageProducerAndReceiver.zip.
Building and running the sample
Go to the Project tab in WebSphere Integration Developer and do a Clean on all projects, then do a Build All. Next, follow these steps:
- Start the TIBCO EMS server.
Figure 41. TIBCO EMS server
- Start WebSphere Process Server. After the server is started, from the server tab, right-click the server and add
TibcoEMSMessageReceive,TibcoEMSMessageProducer, andReceiveTibcoMessageprojects to the Server.
Figure 42. Add the project
- Click Finish.
Figure 43. Console
- Now switch to the J2EE perspective. Go to TibcoageProducer project and right-click the TibcoMessageSender bean and choose Run => Run on server.
Figure 44.Test Client: Running TibcoMessageSender bean on the server
- The Universal Test Client opens.
Figure 45.Test Client
- Click
TibcoEMSMessageSender create(). Click Invoke and then click Work with object.
Figure 46.TibcoEMSMessageSender
- The new object will be created. Click
publishMessagemethod, then enter the message that we sent to TIBCO EMS.
Figure 47. New TibcoEMSMessageSender object
- The session bean sends the message to TIBCO EMS Queue. The TIBCO Listener MDB picks up the message and sends it to Process Server queue. The business process picks up the message from Process Server queue.
Figure 48.Output on Console
Presently JMS binding in Process Server has some limitations. The Business Object XML using JMS TextMessage serialization type can only serialize business objects; that is, an interface operation must have its input(s) and output(s) defined as a business object type. Secondly, the business process receiving the JMS message should have interface operation with more than one input.
This article described the steps for configuring EMS and Process Server. It showed you how to pass the message coming from an EMS messaging system to a business process in WebSphere Process Server,
how to write an EJB (MDB) to put a message on a queue, how to create a business process, and how to print the TIBCO EMS message received from the WebSphere Process Server.
In this article, you learned how easy it is to connect EMS to WebSphere Process Server and how businesses that are looking forward to using WebSphere Process Server can connect easily with their existing EMS messaging system.
| Description | Name | Size | Download method |
|---|---|---|---|
| Project Interchange of Business Process | ReceiveTibcoMessagePI.zip | 20KB | HTTP |
| Project Interchange of message producer/listerner | TibcoMessageProducerAndReceiver.zip | 17KB | HTTP |
Information about download methods Get Adobe® Reader®
Learn
-
WebSphere Process Server Product page
Product descriptions, product news, training information, support information, and more. -
WebSphere Process Server Information Center
Technical documentation on Process Server. Information on how to install, configure, maintain, and use Process Server. -
Java Message Service specification
Java Message Service specification documentation. -
WebSphere Business integration zone
provides technical resources to help you get started with WebSphere Process Server.
Get products and technologies
-
Download TIBCO Enterprise Message Service (EMS) Evaluation Copy to get started with application development.
-
WebSphere trial downloads
Trial downloads for WebSphere Software.

Abhay Srivastava is a Senior Software Engineer working on IBM WebSphere Process Server. His focus area is around BPEL business processes, Web services, Common Event Infrastructure, ws-security and mediation primitives. He is an engineering graduate from the Indian Institute of Technology, Madras. You can reach him at abhay_iitm@yahoo.com.




