Configuring Pega Platform as a JMS publisher
Configure Pega Platform as a message publisher client in your Java Messaging Service (JMS) model to communicate with a message destination to send messages to other JMS clients.
This task involves the following steps that take place both external to and within Pega Platform:
- Create JMS resources:
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 server.
- Create a JMS module.
- In the JMS module, create a connection factory, and add a queue or topic.
For more information, refer to your JMS provider documentation.
To integrate JMS with Pega Platform as a publisher client, you create a JMS destination, connection factory, server, and other JMS resources to communicate with other applications or components. JMS resources include connection factories and destinations.
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 run-time classpath for
Pega Platform:
- In the header of Dev Studio, click .
- In the Import Wizard window, select a location
from which you want to import the JAR file that you downloaded from your
JMS vendor.
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 recently imported JAR files on the run-time classpath.
- Click Next.
- Confirm the details of the JAR file, and then click Next.
- On the Code Archive page, in the
CodeSet name and the CodeSet
version fields, enter the related parameters that are used
by the base ruleset of your instance of Pega Platform. The default value is usually CodeSet used by the base ruleset.
- Finish the import by clicking Next.
- Optional: To import all the requisite JAR files for your JMS vendor into Pega Platform, repeat substeps 4b through 2e.
- Import the JAR file into the CodeSet by restarting your
environment.For Pega Cloud, you request a restart of your environment in My Support Portal.
- To use an JNDI server instance for your JMS resource,
create a JNDI server data instance by clicking the rule that references the
context factory and provider URL of the JMS resource:
- In the header of Dev Studio,, click .
- If you use an external or internal JNDI server for your JMS resource, reference the JNDI server environment information that you created in step 1 in the JNDI Server form.
- Restart the environment.For Pega Cloud, you request a restart of your environment in My Support Portal.
- Test connectivity on the form before continuing your JMS integration.
- Optional: For Pega Cloud, to create an internal JNDI server or resource reference for use with your JMS model to make it compatible with a Pega Cloud deployment, create a request that states that you need an internal JNDI server with your regional Pega Support representative by selecting New Request in My Support Portal.
For more information about the environment tab of the JNDI Server data instance form, see JNDI Server form - Completing the Environment tab.
- Create a Producer Model that determines the messaging characteristics of the
connector as a JMS producer:
- In the header of Dev Studio,, click .
- In the JMS Producer Model form, configure the JMS Producer Model. For more information about completing the form, including determining whether the message should remain in queue until confirmed as received, or whether the JMS model uses point-to-point or publish/subscribe messaging. see JMS Producer Model form - Completing the Model tab.
- Create a Connect JMS rule that references the JNDI server or resource
reference:
- On the Service tab, in the Resource name resolution list, select the type of JMS resource that you created in steps 1 and 2.
- Enter the resource reference or JNDI server information in the associated fields.
- In the JMS Producer Model list, select the JMS Producer Model that you created in step 3.
- In the Request section, in the Destination name field, enter the JMS resource for the queue or topic to receive messages.
- In the Response section, in the
Destination name field, enter the JMS resource
for a temporary queue to hold response messages.
For more information about configuring the Connect JMS rule, see Connect JMS form – Completing the Service tab.
- On the Request tab, in the Message
data section, in the Data type list, select
the primitive Java data type that you plan to send with the message:
- In the Map from field, select whether you mapped your message to the Clipboard, or enter a constant value to send.
- In the Map from key field, select a property
that contains your message.
For more information about completing the Request tab for the Connect JMS rule, see Connect JMS form – Completing the Request tab.
- On the Response tab, in the Data
type list, select the data type you want to use as a response from
your queue or topic upon receiving the message.
- In the Message Key field, enter the external name for the response.
- In the Map to and Map to
key fields, enter the elements to which you want to map the
response.
For more information about completing the Response tab of the Connect JMS rule , see Connect JMS form – Completing the Response tab.
- Create an activity that runs the property or key that contains the
message:
- In the header of Dev Studio, click .
- On the Steps tab, in the Label field, enter a descriptive name for the rule instance.
- In the Apply to field, select the class to which this activity applies.
- Click Create and open.
- On the Steps tab, in the Method list, select Property-Set.
- Click the Expand icon.
- In the Properties Name field, enter the property that you selected in the Connect JMS rule that you created in step 4.
- In the Properties Value field, enter the message
that you want to send through JMS.
- Click Add a step.
- In the Method list for the new step, select Connect-JMS.
- Click the Expand Method Parameters icon.
- In the Value field, select the name of the Connect JMS rule that you created in step 4.
- Click Save.
- In the Actions list, select Run.
- In the Run Activity window, send the message from Pega Platform by selecting Run.
Previous topic Messaging service overview Next topic Configuring Pega Platform as a Java Messaging Service receiver