Create a JMS activity
Create a custom JMS activity to retrieve or send messages to external systems using the Java Messaging Service.
Before you begin
Role required: activity_creator or workflow_admin
About this task
The JMS activity supports third party JMS providers whose JMS client application is written with a typical Java EE pattern and can support these operations:
- Using JNDI to find a ConnectionFactory object.
- Using JNDI to find one or more destination objects.
- Using the ConnectionFactory to create a JMS connection object.
- Using the JMS connection to create one or more JMS session objects.
- Using a JMS session and the destinations to create the MessageProducer and MessageConsumer objects.
- Starting the JMS connection to enable delivery or consumption of messages.
Note: The JMS activity designer has been tested with the JMS providers ActiveMQ and Tibco EMS. When connecting to a JMS provider, refer to your third party user documentation.
Procedure
Create or verify your JMS credential .
Your JMS credentials must have permission for the target database and proper configuration for the corresponding JMS connection. Credentials must be set up before you can create a JMS activity.
Create or verify your JMS connection .
Your JMS connection must be configured with valid JMS credentials set up before you can create a JMS activity.
Create a custom activity.
This action creates a custom activity using a template.
After setting up general properties and creating input variables, configure the JMS Execution Command.
| Configure your credential | Fill in the fields necessary for your database connection. |
| Connection Factory | Name of the JMS Connection Factory. You should create or verify your JMS connection. This configuration links the name of the Initial Context Factory with the URL of the JMS provider. |
| Destination Type | Type of destination used for this message:- Queue: Message is queued for point-to-point communications. Note: The GET operation is only supported for the Queue destination type.
|
| Destination Name | Name of the queue or topic destination that is configured on the JMS provider. |
| Message Type | The JMS message type value. Only the Text Message type is supported. The queue or topic destination must be configured to receive or send only Text Message. Other message types are dropped, since the JMS Activity cannot process them. |
| Operation | The programmatic operation to perform on the destination. The choices are PUT or GET. |
| Timeout (Secs) | Allowed time to wait for a message in the message queue before it times out, in seconds. The default is 30. |
| Custom message headers | The custom header values in a name/value pair format, that is available on the JMS destination. Note: This is only supported for a PUT operation. |
| Message payload | Actual message content or payload that is sent to the JMS destination.Note: This is only supported for a PUT operation. |
| Credential tag | A tag for an individual credential for a JMS activity in an Orchestration workflow. |
| Required MID Server capabilities | MID Server to use, by capabilities. |
What to do next
- Use auto-mapping to generate outputs and parsing rules
- If you do not use auto-mapping, you can manually create output variables and create parsing rules
Parent Topic:Orchestration custom activity templates
Create a JMS connection for an Orchestration activity
Configure your system to use Java Messaging Service (JMS) with a custom Orchestration JMS activity.
Before you begin
Role required: admin
About this task
The MID Server must have the correct JMS connection factories for your organization. Configure those values in the mid.property.jms.command.allowed_factory_names property, found in MID Server > Properties. The default values for this property can be changed to any value or comma-separated list of values that the third-party JMS provider advertises.
Procedure
Navigate to MID Server > JAR Files.
Click New and add.
| Name | A unique and descriptive name for identifying the file in the instance. |
| Version | A version number for the file, if one is available. |
| Source | Location of the JAR file for reference purposes. Source information is not used by the system. |
| Description | Short description of the JAR file and its purpose in the instance. |
Click the paper clip icon in the banner and attach the JMS driver jar file.
The JMS driver jar file should be available as part of JMS provider installation. Few JMS vendors make them available as a separate product. Refer to the JMS provider documentation to determine which JMS client driver jar files require the client applications to connect to the JMS provider. For example, if you are trying to connect to ActiveMQ V5.10 (JMS provider), you need the
activemq-all-5.10.1.jarfile.Navigate to Orchestration > Credentials & Connections > JMS Connection Factory.
Click New, add the following, and click Submit.
| Name | Unique name of this connection factory. |
| Initial Context Factory | Name of the JNDI class that is used to create the InitialContext. Note: For example, to connect to ActiveMQ V5.10 (JMS Provider), the value is org.apache.activemq.jndi.ActiveMQInitialContextFactory. |
| Provider URL | Location of the running JMS provider installation. Note: For example, to connect to ActiveMQ V5.1: tcp://ipAddressOrHostName:61616. |
Navigate to Orchestration > Credentials.
Click New, select JMS Credentials, and provide the user name and password the MID should use to communicate with the JMS provider.
For more information, see JMS credentials JMS credentials.
Click Submit.
You are ready to create a custom JMS activity.
JMS template execution parameters
You use execution parameters to create the input process script in the Preprocessing form.
You must use the executionParam. prefix with all variables in this table.
| Name | Variable | Type | Usage |
|---|---|---|---|
| Jms ds | jms\_ds | Reference | Selected JMS data source. |
| Destination type | destination\_type | Enumerated | |
| Destination name | destination\_name | String | |
| Message type | message\_type | Enumerated | |
| Operation | operation | Enumerated | |
| Time out | time\_out | Integer | Length of time to wait for the query to return results. |
| Custom headers | custom\_headers | Array of JavaScript objects | |
| Message payload | message\_payload | String | |
| Credential tag | credential\_tag | String | List of required MID Server capabilities. |
| MidCapabilities | midCapabilities | String \(comma separated\) | |
| ValueCapabilities | valueCapabilities | Array of hashmap | Capability values used to select the MID Server. For more information, see MID Server capabilities. If there are additional capabilities that are assigned by value, use this example to customize the MID Server selection: |
JMS template post-processing parameters
Use these parameters to create a post-processing script.
| Name | Variable | Type | Usage |
|---|---|---|---|
| Status | status | String | Status of the operation (Put or Get) on the JMS destination. |
| StandardHeaders | standardHeaders | String | All the standard headers, as specified by JMS, that are obtained as part of the JMS message during a Get operation. This field is applicable only for Get operations. |
| CustomHeaders | customHeaders | String | All custom headers added by a producer or publisher application that are obtained as part of the JMS message during a Get operation. This field is applicable only for Get operations. |
| MessagePayload | messagePayload | String | Message payload that is obtained as part of the JMS message during a Get operation. This field is applicable only for Get operations. |
| EccSysID | eccSysID | String | Contains the reference ID associated with the ECC Queue input message returned by the activity. |
| ErrorMessages | errorMessages | String | Contains any error messages retrieved from the JMS command. This value is null if there are no error messages. |