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, connection factory and an activation spec for the message driven bean.

Destinations

To create the destinations, follow theses steps:

  1. Switch to 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. In the Buses page, 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 Additional properties, 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, to create destinations JMSSampleReply and JMSSampleCorrelation.
  12. Click Save under Messages to save to the master configuration.
  13. Click save to confirm.
  14. 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 Providers.
  3. Click Default messaging. the Default messaging provider page is displayed.
  4. Under Scope, select Server: server1, then click Apply.
  5. Under Destinations, click JMS queue. The JMS queue page is displayed.
  6. Click New.
  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 Apply.
  12. Repeat steps 6 through 11 with name JMSSampleReply and JNDI name, jms/JMSSampleReply, select Queue name JMSSampleReply.
  13. Repeat steps 6 through 11 with name JMSSampleCorrelation and JNDI name, jms/JMSSampleCorrelation select Queue name JMSSampleCorrelation.
  14. Click Save under Messages to save to the master configuration.
  15. Click save to confirm.
  16. The following image shows the JMS queue page with the three new queues:

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 Providers.
  3. Click Default messaging. the Default messaging provider page is displayed.
  4. Under Scope, select Server: server1, then click Apply.
  5. Under Connection Factories, click JMS queue connection factory. The JMS queue connection factory page is displayed.
  6. Click New.
  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. Click save to confirm.
  13. The following image shows the JMS queue connection factory page with the new queue connection factory:

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 Providers.
  3. Click Default messaging. the Default messaging provider page is displayed.
  4. Under Scope, select Server: server1, then click Apply.
  5. Under Activation Specifications, click JMS activation specification. The JMS activation specification page is displayed.
  6. Click New.
  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. Click save to confirm.
  14. The following image shows the JMS activation specification page with the new activation specification:

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/JMSSampleQCF
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 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. Switch to the Assembly Diagram: JMSSampleModule.
  2. In the assembly editor, right-click JMSSampleProcess.
  3. From the pop-up menu, select Export > JMS Binding.
  4. The JMS Export Binding attributes selection window opens.

  5. For serialization method, select Text.
  6. Click OK.
  7. The export has been added:

  8. 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. The binding properties are displayed:

  4. Under Connection, enter jms/JMSSampleAS for the JNDI Lookup Name for the activation specification.
  5. Under Response Connection, enter jms/JMSSampleReplyQCF for the JNDI Lookup Name for the managed connection factory.
  6. Ensure, that com.ibm.websphere.sca.jms.data.impl.JMSDataBindingImplXML is selected for Data Type.
  7. Now, the JMS Export Binding page looks like:

  8. Select JMS Destinations tab:
  9. Expand Send Destination Properties.
  10. In the JNDI Lookup Name field, enter jms/JMSSampleReply.
  11. Leave the other values unchanged.
  12. The send destination properties look like:

  13. Expand Receive Destination Properties.
  14. In the JNDI Lookup Name field, enter jms/JMSSample.
  15. Leave the other values unchanged.
  16. Expand Callback Destination Properties.
  17. In the JNDI Lookup Name field, enter jms/JMSSampleCorrelation.
  18. Leave the other values unchanged.
  19. On the toolbar, click the Save button .

Add resource references to the client application

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

  1. Switch to the J2EE perspective.
  2. Expand Dynamic Web Projects > JMSClient.
  3. To open the deployment descriptor, double-click Deployment Descriptor: JMSClient.
  4. Click the References tab.
  5. The Reference 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:

  15. Under WebSphere Bindings, enter jms/JMSSampleReplyQCF in the JNDI name field:
  16. Click Add.
  17. Select Resource Reference, then click Next.
  18. In the Name field, enter jms/JMSSampleRef.
  19. For Type, select javax.jms.Queue.
  20. For Authentication, select Container.
  21. Click Finish.
  22. Under WebSphere Bindings, enter jms/JMSSample in the JNDI name field.
  23. Click Add.
  24. Select Resource Reference, then click Next.
  25. In the Name field, enter jms/JMSSampleReplyRef.
  26. For Type, select javax.jms.Queue.
  27. For Authentication, select Container.
  28. Click Finish.
  29. Under WebSphere Bindings, enter jms/JMSSampleReply in the JNDI name field.
  30. Three resource references have been added:

  31. On the toolbar, click the Save button .