--- title: Create a JMS activity description: Create a custom JMS activity to retrieve or send messages to external systems using the Java Messaging Service.Configure your system to use Java Messaging Service \(JMS\) with a custom Orchestration JMS activity.You use execution parameters to create the input process script in the Preprocessing form.Use these parameters to create a post-processing script. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/servicenow-platform/orchestration/t\_CreateAJMSActivity.html release: australia product: Orchestration classification: orchestration topic_type: task last_updated: "2026-03-12" reading_time_minutes: 6 breadcrumb: [Orchestration custom activity templates, Orchestration activity designer, Classic Orchestration, ServiceNow AI Platform Additional Capabilities, Extend ServiceNow AI Platform capabilities] --- # 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 1. Create or verify your [JMS credential](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/r_JMSCredentialsForm.md) . 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. 2. Create or verify your [JMS connection](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/t_CreateAJMSActivity.md) . Your JMS connection must be configured with valid JMS credentials set up before you can create a JMS activity. 3. Create a [custom activity](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/integrate-applications/create-custom-activities.md). This action creates a custom activity using a template. 4. After setting up [general properties](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/General-Flds-Templates.md) and [creating input variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/CreateInputVariables.md), 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. - **Topic**: Message is used for publish and subscribe communication.
**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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/automap-output-variable-inputs.md) to generate outputs and parsing rules - If you do not use auto-mapping, you can manually [create output variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/t_CreateAnOutputVariable.md) and [create parsing rules](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/t_CreateAParsingRule.md) **Parent Topic:**[Orchestration custom activity templates](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/c_ActivityDesignerComponents.md) ## 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 1. Navigate to **MID Server** > **JAR Files**. 2. 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.
3. 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.jar` file. 4. Navigate to **Orchestration** > **Credentials & Connections** > **JMS Connection Factory**. 5. 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`.
6. Navigate to **Orchestration** > **Credentials**. 7. 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/r_JMSCredentialsForm.md) [JMS credentials](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/r_JMSCredentialsForm.md). 8. 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown). If there are additional capabilities that are assigned by value, use this example to customize the MID Server selection:``` var valueCapability = {'NEW_MID_CAPABIILTY':'NEW_MID_CAPABILITY_VALUE'}; executionParam.valueCapabilities.push(valueCapability); ```
## 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.|