Build it yourself

This section shows how you can

Create resources on WebSphere Process Server

To run the sample, you have to create JMS resources on the WebSphere Process Server: destinations, queues, a connection factory and an activation spec for the message driven bean.

Destinations

To create the destinations, follow theses steps:

  1. Open the Administrative Console of your WebSphere Process Server.
  2. In the navigation pane of the administrative console, expand Service integration.
  3. Click Buses. The Buses page is displayed, and you should see the default Service Integration Bus (SIB) for SCA services created during installation named SCA.APPLICATION.<cell name>.Bus.
  4. Click SCA.APPLICATION.<cell name>.Bus.
  5. Under Destination resources, click Destinations. The Destinations page is displayed.
  6. Click New.
  7. Select Queue as destination type, then click Next.
  8. In the Identifier field, enter JMSSample, then click Next.
  9. Accept the default value for Bus member, then click Next.
  10. Click Finish. The destination will be created.
  11. Repeat steps 6 to 10 twice in order to create the destinations JMSSampleReply and JMSSampleCorrelation.
  12. Click Save under Messages to save to the master configuration.
  13. The following image shows the Destinations page with the three new destinations:

Queues

To create the JMS queues, follow these steps:

  1. Switch to the Administrative Console of your WebSphere Process Server.
  2. In the navigation pane of the administrative console, expand Resources > JMS.
  3. Click Queues. The Queues page is displayed.
  4. In the drop-down menu in the Scope section, select Node=widNode,Server=server1. The list of queues is updated.
  5. Click New. The Select JMS resource provider page is displayed.
  6. Select Default messaging provider and click OK. The New page is displayed.
  7. In the Name field, enter JMSSample.
  8. In the JNDI name field, enter jms/JMSSample.
  9. Under Connection, select SCA.APPLICATION<cell name>.Bus as Bus name.
  10. As Queue name, select JMSSample.
  11. Click OK.
  12. Repeat steps 5 through 11 and specify Name JMSSampleReply, JNDI name jms/JMSSampleReply, and Queue name JMSSampleReply.
  13. Repeat steps 5 through 11 and specify Name JMSSampleCorrelation, JNDI name jms/JMSSampleCorrelation, and Queue name JMSSampleCorrelation.
  14. Click Save under Messages to save to the master configuration.
  15. The following image shows the new queue entries on the Queues page:

Queue connection factory

To create the queue connection factory, follow these steps:

  1. Switch to the Administrative Console of your WebSphere Process Server.
  2. In the navigation pane of the administrative console, expand Resources > JMS.
  3. Click Queue connection factories. The Queue connection factories page is displayed.
  4. In the drop-down menu in the Scope section, select Node=widNode,Server=server1. The list of queue connection factories is updated.
  5. Click New.
  6. Select Default messaging provider and click OK. The New page is displayed.
  7. In the Name field, enter JMSSampleReplyQCF.
  8. In the JNDI name field, enter jms/JMSSampleReplyQCF.
  9. Under Connection, select SCA.APPLICATION<cell name>.Bus as Bus name.
  10. Click OK.
  11. Click Save under Messages to save to the master configuration.
  12. The following image shows the new queue connection factory entry on the JMS queue connection factory page:

Activation spec

To create the activation specification, follow these steps:

  1. Switch to the Administrative Console of your WebSphere Process Server.
  2. In the navigation pane of the administrative console, expand Resources > JMS.
  3. Click Activation specifications. The Activation specifications page is displayed.
  4. In the drop-down menu in the Scope section, select Node=widNode,Server=server1. The list of activation specifications is updated.
  5. Click New.
  6. Select Default messaging provider and click OK. The New page is displayed.
  7. In the Name field, enter JMSSampleAS.
  8. In the JNDI name field, enter jms/JMSSampleAS.
  9. Under Destination, enter jms/JMSSample as Destination JNDI name.
  10. For Bus name, select SCA.APPLICATION<cell name>.Bus.
  11. Click OK.
  12. Click Save under Messages to save to the master configuration.
  13. The following image shows the new activation specification entry on the JMS activation specification page:

Summary

The resources listed in the following table have been created on your WebSphere Process Server:

Resource type Resource name JNDI name
Destination JMSSample  
Destination JMSSampleReply  
Destination JMSSampleCorrelation  
JMS queue JMSSample jms/JMSSample
JMS queue JMSSampleReply jms/JMSSampleReply
JMS queue JMSSampleCorrelation jms/JMSSampleCorrelation
JMS queue connection factory JMSSampleReplyQCF jms/JMSSampleReplyQCF
JMS activation specification JMSSampleAS jms/JMSSampleAS

 

Import prepared sample projects

A project interchange file with prepared sample projects is available in the Download section. These projects contain the sample process and the client application, but without the required bindings. These bindings will be added in the following chapters.

To load the prepared projects into WebSphere Integration Developer, follow these steps:

  1. Download the JMSSamplePrepared.zip file, and save it to a temporary directory.
  2. Switch to WebSphere Integration Developer.
  3. From the menu, select File > Import. The Import window opens.
  4. Select Project Interchange.
  5. Click Next. The Import Project Interchange Contents window opens.
  6. Click Browse next to From zip file.
  7. Browse to the temporary directory. Select JMSSamplePrepare.zip, and click Open.
  8. Select your workspace directory as your Project location root.
  9. Click Select All.
  10. Click Finish.
  11. Wait until the automatic build process has finished.

Create an SCA export with JMS binding

To export the JMS sample process as SCA Service with a JMS binding, complete the following steps:

  1. In the Business Integration view, double-click JMSSampleModule > Assembly Diagram. The assembly editor opens.
  2. In the assembly editor, right-click JMSSampleProcess.
  3. From the pop-up menu, select Generate Export > Messaging Binding > JMS Binding.
  4. The Configure JMS Export Service window opens:

  5. Next to the Default data format field, click Select. The Data Transformation Configuration window opens:
  6. Select Use existing data format transformation from the list.
  7. Expand XML and select UTF8XMLDataHandler.
  8. Click Finish.
  9. Next to the Function selector configuration field, click Select. The Function Selector Configuration window opens:
  10. Select Use existing function selector from the list.
  11. Select JMS header property selector.
  12. Click Finish.
  13. Click OK.
  14. The export has been added:

  15. On the toolbar, click the Save button .

To update the bindings to resources on WebSphere Process Server, complete the following steps:

  1. In the assembly editor, click JMSSampleProcessExport.
  2. Switch to the Properties view, then click the Binding tab.
  3. Choose Text as Default message type.
  4. Select the End-point configuration tab.
  5. Select the Specify JNDI Name for pre-configured messaging provider resource option.
  6. Under ActivationSpec Properties, enter jms/JMSSampleAS in the JNDI Lookup Name field.
  7. Click the Response Connection tab.
  8. Select the Specify JNDI Name for pre-configured messaging provider resource option.
  9. Under Managed Connection Factory Properties, enter jms/JMSSampleReplyQCF in the JNDI Lookup Name field.
  10. Click the JMS Destinations tab.
  11. Expand Receive Destination Properties.
  12. Select the Specify JNDI Name for pre-configured messaging provider resource option.
  13. In the JNDI Lookup Name field, enter jms/JMSSample.
  14. Expand Send Destination Properties.
  15. Select the Specify JNDI Name for pre-configured messaging provider resource option.
  16. In the JNDI Lookup Name field, enter jms/JMSSampleReply.
  17. Expand Callback Destination Properties.
  18. Select the Specify JNDI Name for pre-configured messaging provider resource option.
  19. In the JNDI Lookup Name field, enter jms/JMSSampleCorrelation.
  20. On the toolbar, click the Save button .

Add resource references to the client application

To link the client application to resources on WebSphere Process Server, complete the following steps:

  1. Switch to the Java EE perspective.
  2. Expand JMSClient.
  3. To open the deployment descriptor, double-click Deployment Descriptor: JMSClient.
  4. Click the References tab.
  5. The References page is displayed.

  6. Click Add.
  7. The Add Reference wizard opens:

  8. Select Resource reference, then click Next.
  9. The Resource Reference page is displayed:

  10. In the Name field, enter jms/JMSSampleQCFRef.
  11. For Type, select javax.jms.QueueConnectionFactory.
  12. For Authentication, select Container.
  13. Click Finish.
  14. A new resource reference has been added. Next, we update the WebSphere Bindings for this reference:

  15. Under WebSphere Bindings, enter jms/JMSSampleReplyQCF in the JNDI name field.
  16. As JAAS login configuration, select Use default method and enter SCA_Auth_Alias as Authentication alias.
  17. Click Add to create another reference.
  18. Select Resource reference, then click Next.
  19. In the Name field, enter jms/JMSSampleRef.
  20. For Type, select javax.jms.Queue.
  21. For Authentication, select Container.
  22. Click Finish.
  23. Under WebSphere Bindings, enter jms/JMSSample in the JNDI name field.
  24. Click Add to create another reference.
  25. Select Resource reference, then click Next.
  26. In the Name field, enter jms/JMSSampleReplyRef.
  27. For Type, select javax.jms.Queue.
  28. For Authentication, select Container.
  29. Click Finish.
  30. Under WebSphere Bindings, enter jms/JMSSampleReply in the JNDI name field.
  31. Three resource references have been added:

  32. On the toolbar, click the Save button .