Configuring Pega Platform as a Java Messaging Service receiver
You can configure Pega Platform as a message receiver client in your Java Messaging Service (JMS) model for other applications to communicate with Pega Platform.
This task involves the following steps that take place both external to and within Pega Platform:
- Create a JMS resource:
JMS Service forms require either the JMS resource of a JDNI server (external or internal to Pega Platform), or a resource reference. Create a JMS resource by completing the following tasks:
Create a JMS resource by completing the following tasks:
- Create a JMS server.
- Create a JMS module.
- In the JMS module, create a Connection Factory, and add a queue or topic.
Refer to your JMS provider documentation for more information on how to create JMS resources.To integrate JMS with Pega Platform as a receiver client you must create a JMS resource for other applications or components to communicate with Pega Platform. Pega Platform uses either a resource reference or a direct JNDI lookup to integrate with your JMS model. The types of JMS resources you can use to integrate your JMS model with Pega Platform depend on your environment. For environment restrictions for each type of compatible JMS resource, see Messaging service overview.
- Import the JAR file for your JMS provider into the runtime classpath for
Pega Platform.
Refer to the repository of your JMS provider in order to download the JAR files that are required to create a publisher client. Use the Import Wizard to automatically place the most recent JAR files on the runtime classpath.
- In the header of Dev Studio, click .
- In the Import Wizard, select a location from which to import the JAR file you downloaded from your JMS vendor.
- Click Next.
- Confirm the details of the JAR file, then click Next.
- In the Code Archive page, enter the CodeSet name
and the CodeSet version used by the base ruleset
of your instance of Pega Platform.
The default value is usually this CodeSet.
- Finish the import by clicking Next.
- To import all the requisite JAR files for your JMS provider into Pega Platform, repeat substeps 4b through 2e.
- Restart your environment to import the JAR file into the CodeSet. For Pega Cloud clients, make a request by selecting New request in My Support Portal to restart your environment.
- Use the Service Wizard to create the necessary rules
required to integrate Pega Platform as a message receiver
client.
- In the header of Dev Studio, click
- In the Service type list, select JMS, then click Next.
- On the Select Work Properties page, in the Case/Supporting Type drop-down list, select the case type that receives messages that you want to associate with JMS.
- In the Flow Type list, select the JMS listener flow type associated with the case type, and then click Next.
- On the Select Flow Actions page, select the action used during the Case type, and then click Next.
- On the Service rule data page, click the expand icon next to the service rule data.
- Select the properties used to receive the JMS message, then click Next.
- On the Select Service Resources page, enter the Ruleset name and Ruleset version for which you want to create a new Service Package and JMS listener, and then click Next.
- On the Configure Data Records page, in the New Service Package section, enter the details for the Service package name, its security authentication requirements, and required requestor pools.
- In the New Service Listener section, enter the name, model, connection factory, request and response destination name from the JMS resources that you created in step 1.
- In the New Data Source section, enter the
information for the JNDI server or JMS resource used by your Java
Messaging Service that you created in step 1, then click
Next.
Pega Cloud only: If you want to create an internal JNDI server or resource reference for use with your JMS model to make it compatible with a Pega Cloud deployment, make a request that states you need an internal JNDI server with your regional Pega Support representative by selecting New Request in My Support Portal. Pega Cloud Services creates an internal JNDI service reference for you to use in your instance of Pega Platform.
- Review the Service rules, Service Package, Service Listener, and Data Source details, and then click Finish.
- In the navigation pane of Dev Studio, click .
- Select the Service Package that you created in step 3i.
- On the Request tab, in the Message data section, select the JMS message Data type that Pega Platform will receive as a message receiver client.
- In the Map to and Map to
key fields, enter the object to which you want to map
the received message. For example, pyLabel.
For more information about Service JMS rules, see Service JMS form – Completing the Request tab.
- Click the Service tab of the Service JMS rule.
- In the Service activity section, in the Activity name field, click the Open icon.
- On the Steps tab, in the Method list, select Java.
- Click the Expand icon.
- In the Method Parameters section, enter a Java
method that references the object that receives the message. For
example:
oLog.infoForce("received message:" + myStepPage.getString("pyLabel"));
- Click Save.
- In the Actions list, select Run.
Previous topic Configuring Pega Platform as a JMS publisher Next topic Testing JMS connectivity and capability