Creating a JMS connector
After you have enabled Java Management Services (JMS) support in Pega Platform™ and have finished planning your JMS connector, follow the procedures in this article to create the connector. JMS connectors support JMS 1.0. JMS connectors work with JMS 1.1, but only for JMS 1.0 features, for example, shared subscriptions, a JMS 1.1 feature, is not supported.
For more information about JMS Connectors, see About Connect JMS rules.
Verify that you have read the following articles and have completed the tasks described in them before completing the procedures in this article:
- How to enable JMS support
- Planning JMS connectors
- How to configure a JMS service or connector to find JMS resources through resource references
Optional. Create the JNDI Server Data Object
As described in How to configure a JMS service or connector to find JMS resources through resource references, when configuring a JMS connector, there are two ways to identify the JMS resources (connection factories, destinations, and so on) the service or connector interacts with:
- Using resource references that you insert in the deployment descriptor file (either ejb-jar.xml or web.xml).
- By direct JNDI name lookup using a JNDI server data object (instance of Data-Admin-Connect-JNDIServer).
The recommended option is to use resource references. If you already configured them, skip to Create the JMS Producer Model, below.
If you cannot use resource references, create a JNDI server data object, which locates the JMS provider that manages the queue or topic to which the JMS connector sends messages through direct JNDI lookup. Complete the following steps to create a JNDI server object:
- Click Create > Integration-Resources > JNDI Server.
- In the Short description field, enter a description of the server.
- In the Server name field, enter a name for this instance. It is useful to use the actual host name of the server as the name of the data object.
- Click Create and open.
- On the Environment tab, complete the following fields.
Field
Value
Initial Context Factory
Specify the name of the JNDI initial context factory class.
WebSphere: com.ibm.websphere.naming.WsnInitialContextFactory
WebLogic: weblogic.jndi.WLInitialContextFactory.
JBoss: org.jnp.interfaces.NamingContextFactory
Provider URL
Specify the URL of the JNDI server as follows:
WebSphere: iiop://<servername>:<portnumber>
WebLogic: t3://<servername>:<portnumber>
JBoss: jnp://<servername>:<portnumber>
Security Principal
The user name of a valid user for the JNDI server.
Security Credentials
The password of the user you specified in the Security Principal field.
- On the History tab, enter a description in both the full Description and the Usage fields.
- Click Save.
Create the JMS Producer Model
The JMS producer model configures settings for the messages that the connector sends.
- Click Create > Integration-Resources > JMS Producer Model.
- In the Short description field, enter a description of this producer model.
- In the Model name field, enter a name for this instance.
- Click CCreate and open.
- On the Model tab, define the messaging characteristics of the connector as a JMS producer by completing the fields as shown in the following table.
Field
Value
Description
Enter a brief description of the producer model.
Persistent
Select to specify that messages are to be stored in the database for the queue or topic until they are retrieved or they expire.
Clear to specify that messages are to be stored in memory until they are retrieved or they expire.
Priority
If the queue or topic uses priority levels, enter a priority level for the messages. The range is 0 to 9, with 9 being the highest priority level.
Expiration
The length of time, in seconds, the message stays in the queue or topic before it expires. If the message is not retrieved in this time period, the JMS provider destroys it.
To specify that a message never expires, either leave this field blank or enter the number 0.
Domain
Select either
Point to Point
orPublish/Subscribe
, as appropriate for your system. - On the History tab, enter a description in the Full Description and the Usage fields.
- Click Save.
Create or Identify Class and Property Rules
During the planning stage, you identified the class rule and properties for the connector activity and the connector. The class rule that a connector activity applies to usually inherits from the Work- base class rule so that it can be called directly by an Integrator task in a workflow.
If either the class rule or any of the properties do not exist yet, create them.
Create the JMS Connector Rule
Complete the following steps to create the JMS connector rule.
- Click Create > Integration-Connectors > Connect JMS.
- In the Label field, enter the purpose for this rule.
- In the Applies to field, enter the name of the class rule that you determined was the correct one for this connector rule during the planning stage.
- Click Create and open.
- On the Service tab, complete the fields as shown in the following table.
Field
Value
Resource Name Resolution
If you are using resource references to identify the JMS resources, select
Resource Reference
. Otherwise, selectDirect JNDI Lookup
.JNDI Server
If you selected
Direct JNDI Lookup
in the previous field, select the JNDI server that you created.This field supports the Global Resource Settings syntax (=.PageName.PropertyName). The default property name for this field is pyJNDIServer. For more information, see Using the Global Resource Settings Feature.
Connection Factory
Select the appropriate JMS connection factory from the list. If the Resource Name Resolution field is set to
Direct JNDI Lookup
, the list is provided by the JNDI server selected in the JNDI Server field. Otherwise, it comes from the list of references specified in the Process Commander deployment descriptor file.This field supports the Global Resource Settings syntax (=.PageName.PropertyName). The default property name for this field is pyConnectionFactory. For more information, see Using the Global Resource Settings Feature.
JMS Producer Model
Select from the list the JMS producer model that you created.
Request Destination Name
Select the name of the queue or topic that is the destination of the request message.
This field supports the Global Resource Settings syntax (=.PageName.PropertyName). The default property name for this field is pyDestination.For more information, see Using the Global Resource Settings Feature.
You can view items in the queue by clicking the magnifying glass button, located to the right of the Destination Name field. A window appears, listing any items in the queue. Click a message position number to view detailed information about that item.
Request Message Type
Specify the JMS message type that you want the connector to use for the message: text, map, bytes, stream, or object.
Response Destination Name
If the connector is to wait for a response, select the name of the queue where it will find the response.
This field supports the Global Resource Settings syntax (=.PageName.PropertyName). The default property name for this field is pyDestinationResponse.For more information, see Using the Global Resource Settings Feature.
Response Timeout
The amount of time, in seconds, that the connector waits for a response from the JMS provider before closing the connection and reporting an error. No value or 0 means the connector will wait indefinitely.
- On the Request tab, in the Message Headers section, configure data mapping rows for any data needed in the JMS header of the message.
- In the Message Properties section, configure data mapping rows for any property/value pairs that the recipient of the message uses — a transaction ID, for example.
- In the Message Data section, configure data mapping rows for the data to be included in the body of the message.
- Optional. If the connector is to wait for a response, on the Response tab, specify what should happen to the acknowledgment sent back to the connector from the message recipient.
- On the History tab, enter a description in both the full Description and the Usage fields.
- Click Save.
- Click Test Connectivity. If Pega can connect to the queue or topic you specified, it displays the message
Status Value: Good
. If you cannot connect, determine the source of the problem before proceeding to the next step. For example, examine the values you specified in the JNDI server and JMS producer model data objects and the JMS connector rule. Verify that you entered the correct values for these items.
You are now ready to create the activity that calls the JMS connector rule. Continue with Creating connector activities for JMS and MQ connectors.