Working with JMS Connection Aliases
A JMS connection alias specifies the information that Integration Server needs to establish an active connection between Integration Server and the JMS provider. Integration Server uses a JMS connection alias to send messages to and receive messages from the JMS provider.
Connecting to webMethods Broker with the Native webMethods API
When you use webMethods Broker as the JMS provider, you can configure a JMS connection alias to use the native webMethods API. The native webMethods API provides a way to connect the Integration Server directly to the webMethods Broker acting as the JMS provider. This eliminates the need for connection factories. Destinations can be created directly on the Broker and do not need to be stored in a JNDI provider. Consequently, you do not need to use a JNDI provider if all JMS connection aliases specify that the connection to webMethods Broker should be made using the native webMethods API.
If you choose to use webMethods Broker but do not want to connect natively (using the native webMethods API), you still need to use a JNDI provider.
Predefined JMS Connection Aliases
Integration Server includes predefined JMS connection aliases. Integration Server creates the aliases the first time Integration Server starts. If the aliases existed in an Integration Server that was migrated from a previous version, Integration Server keeps the existing aliases. That is, Integration Server does not overwrite the previous alias definition.
Integration Server has the following predefined JMS connection aliases:
| JMS Connection Alias | Description |
|---|---|
|
DEFAULT_IS_JMS
_CONNECTION |
A JMS connection alias
that defines a connection to Universal Messaging using the predefined JNDI provider alias
DEFAULT_IS_JNDI_PROVIDER. Integration Server configures this JMS connection alias when you launch the Integration Server the first time. This connection alias is disabled by default. |
|
PE_NON
TRANSACTIONAL_ ALIAS |
A JMS connection alias
for the Process Engine that establishes a connection to Universal Messaging using the predefined JNDI provider alias DEFAULT_IS_JNDI_PROVIDER. Integration Server configures this alias when you launch your Integration Server the first time. Note:
Integration Server creates this alias even if the Process Engine is not installed.
|
Creating a JMS Connection Alias
About this task
When you create a JMS connection alias, keep the following points in mind:
-
You can use JNDI to retrieve administered objects (Connection Factories and Destinations) and then use the Connection Factory to create a connection. If you intend to use a JNDI provider, you need to configure one or more JNDI provider aliases before creating a JMS connection alias.
- or -
You can use the native webMethods API to create the connection directly on the webMethods Broker. Because you can create Destinations at the Broker, you do not need to configure a JNDI provider alias if you intend to use the native webMethods API.
Note that if you elect to use the webMethods Broker but do not want to connect natively, you will need to use a JNDI provider and configure one or more JNDI provider aliases.
- Each JMS connection alias has an associated transaction type. Within Integration Server, certain functionality must be completed within a non-transacted session. For example, to use Integration Server to send or receive large message streams, you must specify a JMS connection alias whose transaction type is set to NO_TRANSACTION.
- When configuring a JMS connection alias
from an on-premise Integration Server to a Universal Messaging server in the cloud, you need to modify
the custom_wrapper.conf configuration file to include
com.softwareag.um.jndi.cf.url.override=true. Specifically, modify the custom_wrapper.conf file to include:wrapper.java.additional.n=-Dcom.softwareag.um.jndi.cf.url.override=trueWhere n is the next available wrapper.java.additional number.
To create a JMS connection alias
Procedure
Allowing Destinations to Be Managed through the JMS Connection Alias and Designer
You can configure the JMS connection alias to enable Designer users to manage destinations and durable subscribers when working with JMS triggers. When the JMS connection alias is configured for managing destinations (i.e., the Enable Destination Management with Designer check box is selected), you can use Designer to create and modify destinations and durable subscribers on webMethods Broker or Software AG Universal Messaging.
To manage destinations on Broker, the following must be true
- The JMS connection alias must use Broker as the JMS provider.
- Broker must be Broker version 7.1 or higher.
-
The versions of following three Broker jar files installed on Integration Server must be the 8.0 SP1 or higher versions of the files.
- Software AG_directory /common/lib/wm-brokerclient.jar
- Software AG_directory /common/lib/wm-jmsclient.jar
- Software AG_directory /common/lib/wm-jmsnaming.jar
To manage destinations on Universal Messaging, the following must be true:
- The JMS connection alias must use Universal Messaging as the JMS provider.
- The Universal Messaging version must be supported with this version of Integration Server. For information about supported versions, see Supported JMS Providers.
For more information about using Designer to modify Destinations on the Broker or Universal Messaging, see webMethods Service Development Help .
Allowing Multiple Connections for a JMS Connection Alias
You can configure a JMS connection alias to instruct Integration Server to create a separate connection to the JMS provider for each JMS trigger that uses the alias. Creating separate connections for individual triggers can improve performance, especially when processing a high volume of messages across many triggers.
By default, an alias creates a single connection to the JMS provider, and each JMS trigger that uses the alias shares the same connection. Integration Server uses this same connection to send JMS messages when executing pub.jms* services that specify the JMS connection alias.
If you select the Create New Connection per Trigger check box when configuring a JMS connection alias, Integration Server creates a new connection to the JMS provider for each JMS trigger that uses the alias. These connections are in addition to the connection that Integration Server uses for sending JMS messages. Therefore, if a JMS connection alias is associated with 3 JMS triggers, there will be a total of 4 connections associated with the alias.
When an alias creates a separate connection for each trigger, you can configure the associated concurrent JMS triggers to obtain multiple connections to the JMS provider, thereby noticeably improving trigger throughput. Keep in mind, however, that each connection used by the trigger requires a dedicated Integration Server thread, regardless of the current throughput.
Integration Server supports creating and using multiple connections for a single JMS connection alias with the supported JMS providers. For a list of supported JMS providers, see Supported JMS Providers.
To use multiple connections for a single JMS connection alias when using webMethods Broker as the JMS provider, the following must be true:
- webMethods Broker must be webMethods Broker version 7.1 or higher.
-
The versions of following three webMethods Broker jar files installed on Integration Server must be the 8.0 SP1 or higher versions of the files.
- Software AG_directory /common/lib/wm-brokerclient.jar
- Software AG_directory /common/lib/wm-jmsclient.jar
- Software AG_directory /common/lib/wm-jmsnaming.jar
For more information about configuring JMS triggers, see the webMethods Service Development Help in Software AG Designer.
About the Connection Client ID
The connection client ID is the JMS client identifier associated with the connections established by a JMS connection alias. The connection client ID that Integration Server uses for a connection created from a JMS connection alias depends on one or more of the following:
- The value of the Connection Client ID field for the JMS connection alias.
- The connection client ID specified in the Connection Factory used by the JMS connection alias.
- Whether the JMS connection alias is configured to create a new connection for each JMS trigger. That is, whether or not the Create New Connection per Trigger check box is selected.
Using the above information, Integration Server determines the connection client ID as follows:
- If only the JMS connection alias specifies the connection client ID, Integration Server uses this value for any connections created from the alias. When connecting to the webMethods Broker natively (the Create Connection Using list is set to Native webMethods API), Integration Server always uses the connection client ID from the JMS connection alias.
- If only the Connection Factory specifies the connection client ID, Integration Server uses this value for any connections created from the alias.
- If the JMS connection alias and the Connection Factory specify the connection client ID, Integration Server uses the value in the Connection Factory. This is true when working with all JMS providers, including the webMethods Broker.
- When the Create New Connection per Trigger check box is not selected, each JMS trigger that uses the JMS connection alias will use the same connection. Each connection will have the same connection client ID.
- When the Create New Connection per
Trigger check box is selected, each JMS trigger that
uses the JMS connection alias will create its own connection to
the JMS provider.
- If Integration Server uses the connection client ID in the Connection Factory, each connection for a JMS trigger will have the same connection client ID.
- If Integration Server uses the connection client ID from the JMS connection alias, each connection for a JMS trigger will be unique to the JMS trigger. The connection client ID will consist of the value of the Connection Client ID field in the JMS connection alias plus the fully qualified name of the JMS trigger.
Creating a Dedicated Listener for Receiving Replies
Integration Server includes the ability to create a dedicated consumer for receiving replies to a published request. You configure this functionality per JMS messaging connection alias.
When the pub.jms:sendAndWait service executes a synchronous request-reply, Integration Server sends the request message to the JMS provider and waits for a reply. By default Integration Server creates a new JMS MessageConsumer for each reply message. In many situations, creating one MessageConsumer per response does not impact performance. However, in some situations, such as when many threads invoke pub.jms:sendAndWait concurrently, creating a MessageConsumer for every expected response can impact performance.
To address this, Integration Server includes an option named Enable Request-Reply Listener for Temporary Queue that, when selected, creates a single dedicated MessageConsumer for receiving synchronous replies sent by the JMS connection alias. If Integration Server uses a single consumer to retrieve all synchronous replies for requests sent by a particular JMS connection alias, when executing pub.jms:sendAndWait service, Integration Server assigns a unique value to the new wm_tag field used as a property in the JMS message, specificallyJMSMessage/properties/wm_tag. When using pub.jms:reply to reply to a JMS message request for which wm_tag is populated, the replying Integration Server maps the value of wm_tag to JMSMessage/header/JMSCorrelationID field in the reply message.
To use a dedicated consumer to retrieve replies to all requests sent using a particular JMS connection alias, the following must be true:
- The JMS connection
alias used to send the request must have the following configured:
- The Create Temporary Queue check box must be selected.
- The Enable Request-Reply Listener for Temporary Queue check box must be selected. This is a new option for a JMS connection alias.
- The pub.jms:sendAndWait invocation:
- Must be synchronous (the async input parameter must be set to false).
- Must not specify a value for the destinationNameReplyTo input parameter.
Configuring Producer Caching for Sending JMS Messages
When sending a JMS message, Integration Server creates and closes a new JMS Session object and a JMS MessageProducer object for each message. This can introduce overhead for some JMS providers. To improve performance when sending JMS messages, you can configure producer-side pooling. For each JMS connection alias, Integration Server can create the following:
- A default session pool containing JMS Session objects. When a default session pool is defined for a JMS connection alias, Integration Server draws from a pool of open JMS Sessions for sending a JMS message instead of opening and closing a JMS Session for each JMS message. Integration Server uses the default session pool only when sending a message to a destination that does not have its own pool. When using the default session pool, Integration Server creates a new MessageProducer each time it sends a JMS message.
- Destination-specific pools for sending
JMS messages to specific destinations. Integration Server creates a pool for each specified destination.
The composition of a destination-specific pool varies depending
on the transaction type of the JMS connection alias.
- For a non-transacted JMS connection alias, an entry in a destination-specific pool consists of a Session object and a MessageProducer object. When sending a JMS message to one of the specified destinations, Integration Server uses a Session object and MessageProducer object from the pool instead of creating and closing a Session object and MessageProducer object for each JMS message.
- For a transacted JMS connection alias,
an entry in a destination-specific pool contains a Session object.
When sending a JMS message to one of the specified destinations, Integration Server uses a Session object from the pool
instead of creating and closing a Session object for each JMS message. Integration Server creates a new MessageProducer each time
it sends a JMS message. Note: Integration Server supports session caching for transacted JMS connection aliases when the JMS provider is Universal Messaging or WebSphere MQ 7.5. For information about Universal Messaging versions supported with this version of Integration Server, see Supported JMS Providers.
You can specify the minimum and maximum sizes for the default session pool and all destination pools. Additionally, you can identify the destinations for which Integration Server creates specific pools. If the JMS connection alias specifies the use of a connection factory object to connect to the JMS provider, you specify a single list of destinations. If the JMS connection alias specifies the Native webMethods API for connecting to the webMethods Broker, you must specify separate lists for the queues and topics for which you want Integration Server to create destination pools.
Consider the following examples that explain how Integration Server creates session and destination pools based on the information specified for transacted and non-transacted connection aliases:
Example of creating session and destination pools for a non-transacted JMS connection alias
Suppose that a non-transacted JMS connection alias named "myAlias" connects to the webMethods Broker using the Native webMethods API and the fields are set as described in the following table.:
| Field | Value |
|---|---|
| Minimum Pool Size | 1 |
| Maximum Pool Size | 10 |
| Minimum Pool Size per Destination | 1 |
| Maximum Pool Size per Destination | 5 |
| Queue List | myQueue1; myQueue2 |
| Topic List | myTopic |
| Idle Timeout | 70000 |
Using the above information, Integration Server creates a default session pool with a minimum size of 1 and a maximum size of 10. This pool contains JMS Session objects only. Integration Server uses an entry from the pool when sending a message to destination that does not have its own pool.
Integration Server also creates three destination pools: one each for the queues myQueue1 and myQueue2, and one for the topic myTopic. Each of these pools has a maximum size of 5 pool entries. Messages sent to the destinations myQueue1, myQueue2, or myTopic will use an entry (a Session object and MessageProducer object) from the pool created for the destination. Messages sent to other destinations will use a Session from the default session pool.
An entry in the default or destination-specific pools expires after the entry has been inactive for over 70000 milliseconds (70 seconds).
Example of creating session and destination pools for a transacted JMS connection alias
Suppose that a transacted JMS connection alias named "myAlias1" connects to WebSphere MQ 7.5 using JNDI and the fields are set as described in the following table:
| Field | Value |
|---|---|
| Minimum Pool Size | 1 |
| Maximum Pool Size | 15 |
| Minimum Pool Size per Destination | 1 |
| Maximum Pool Size per Destination | 10 |
| Destination Lookup Name List | myQueue1; myQueue2; myTopic1 |
| Idle Timeout | 80000 |
Using the above information, Integration Server creates a default session pool with a minimum size of 1 and a maximum size of 15. This pool contains JMS Session objects only. Integration Server uses an entry from the pool when sending a message to destination that does not have its own pool.
Integration Server also creates three destination pools: one each for the queues myQueue1 and myQueue2, and one for the topic myTopic1. Each of these pools has a maximum size of 10 pool entries. Messages sent to the destinations myQueue1, myQueue2, or myTopic1 will use an entry (a Session object) from the pool created for the destination. Messages sent to other destinations will use a Session from the default session pool.
An entry in the default or destination-specific pools expires after the entry has been inactive for over 80000 milliseconds (80 seconds).
Configuring Automatic Retry when Sending JMS Messages Using the pub.jms:send Service
You can configure a JMS connection alias so that Integration Server automatically retries a pub.jms:send service that uses the JMS connection alias if the service fails because of a transient error. To configure automatic retry for instances of the pub.jms:send service that use a particular JMS connection alias to send messages to the JMS provider, you specify the following for the alias:
- Maximum number of retry attempts. The Max Retry Count field determines the maximum number of times that Integration Server will retry a particular pub.jms:send service. A Max Retry Count of 0 indicates that automatic retry is disabled for the JMS connection alias.
- Interval between retry attempts. The Retry Interval field determines the number of milliseconds that Integration Server waits between retry attempts. The default interval is 1000 milliseconds (1 second).
The JMS connection alias must also meet the following criteria for a pub.jms:send service that uses the alias to be retried after a transient error:
- The JMS connection alias must be enabled.
- The JMS connection alias must have a transaction type of NO_TRANSACTION. Integration Server will not retry a pub.jms:send service that is executed as part of a transaction.
- If the JMS connection alias specifies the Broker as the JMS provider, the JMS connection alias must not use a cluster connection factory to which the multisend guaranteed policy is applied.
| Stage | Description |
|---|---|
| 1 | Execution of the pub.jms:send service fails because of a transient error. |
| 2 |
Integration Server waits the length of the retry interval. Note: If Integration Server begins to shut down while waiting to
retry, Integration Server interrupts the waiting period and retries
the service.
Note: If the JMS connection
alias becomes disabled while Integration Server waits to retry, Integration Server interrupts the retry process. Depending
on whether the client side queue is enabled for the JMS connection
alias, either writes the JMS message to the client side queue or
throws the original exception that caused the pub.jms:send service
to fail. For more information, see the description for stage 5,
which follows.
|
| 3 | Integration Server re-executes the pub.jms:send service. |
| 4 | If the pub.jms:send service
fails again because of a transient error Integration Server repeats steps 2 and 3 until one of the
following occurs:
|
| 5 |
If retry failure occurs, Integration Server will do one of the following depending on whether or not the JMS connection alias uses a client side queue:
Note: A client
side queue is in use if the JMS connection alias has a Maximum CSQ Size value
greater than 0 (zero) and the useCSQ input parameter
is set to true for the pub.jms:send service.
|
About Retrying the pub.jms:send Service when Software AG Universal Messaging Is the JMS Provider
When the JMS connection alias is configured to retry the pub.jms:send service upon transient error and Universal Messaging is the JMS provider, Integration Server may make some changes to the local instance of the Universal Messaging connection factory to prevent or at least delay an exception from being thrown by Integration Server. Integration Server makes changes so that if Integration Server loses its connection to the Universal Messaging cluster, Integration Server does not throw an exception right away. Instead, Universal Messaging suppresses the exception for a period of time. During this time, Universal Messaging attempts to restore the cluster quorum. Concurrently, Integration Server attempts to re-establish a connection to Universal Messaging. During this delay, Integration Server is not notified of the exception and the JMS connection alias will not be stopped. However, JMS triggers that use the JMS connection alias will not receive any messages. Additionally, any pub.jms:send services that were in the midst of using the JMS connection alias to send a message will be retried based on the retry interval and retry count set for the JMS connection alias. If Universal Messaging cannot restore a cluster quorum, Integration Server throws the exception. At this point, any JMS trigger that uses the JMS connection alias will be stopped and any services that send JMS messages using the JMS connection alias will throw exceptions immediately. Integration Server then attempts to reconnect to Universal Messaging.
Integration Server makes changes to the Universal Messaging connection factory if the connection factory has a MaxReconAttempts property set to -1. (A value of -1 is the default and suggests that the MaxReconAttempts value has not been changed on Universal Messaging.) Integration Server makes the following changes to the local instance of the Universal Messaging connection factory:
- Sets ConxExceptionOnFailure to true.
- Sets MaxReconAttempts to 35.
- Sets ReconnectInterval to 2000 milliseconds.
Integration Server makes changes to the local instance of the Universal Messaging connection factory only. The ConnectionFactory will not be changed on the JNDI provider, which means that other clients that use the ConnectionFactory will not be impacted.
To prevent Integration Server from making changes to the local instance of the Universal Messaging connection factory, use the Universal Messaging Enterprise Manager to set the MaxReconAttempts property to a value greater than -1.
Editing a JMS Connection Alias
About this task
After you create a JMS connection alias, you might need to modify properties of the alias you created or a default alias. For example, you might want to reduce the amount of memory that the client side queue can occupy by decreasing the maximum number of messages that can be placed in the client side queue. You can edit any properties of a JMS connection alias with the exception of the alias name.
Keep the following information in mind when editing a JMS connection alias:
- You must disable a JMS connection alias before you can edit it.
- Because Integration Server uses the connection client ID as the first part of the durable subscriber name, changing the connection client ID results in the creation of durable subscribers for triggers that use the alias. The durable subscribers that use the old connection client ID as part of the name are not automatically removed from Universal Messaging. Old durable subscribers might contain messages and continue to receive messages.
To edit a JMS connection alias
Procedure
- Open Integration Server Administrator if it is not already open.
- In the Settings menu of the Navigation panel, click Messaging.
- Under JMS Configuration, click JMS Settings.
- In the JMS Connection Alias Definitions list, select the JMS connection alias that you want to edit. Integration Server Administrator displays details about the connection alias.
- Click Edit JMS Connection Alias.
- Edit the properties of the connection alias. For more information about the fields, see Creating a JNDI Provider Alias. Note that the Connection Alias Name field cannot be modified.
- Click Save Changes.
Enabling and Disabling a JMS Connection Alias
About this task
When a JMS connection alias is enabled, Integration Server can use the alias to obtain connections, send messages, and receive messages on behalf of services and JMS triggers. When a connection alias is disabled, Integration Server suspends all JMS triggers that use the alias. Additionally, any services that use a disabled JMS connection alias to send or receive messages will end in error.
To enable or disable a JMS connection alias
Procedure
Deleting a JMS Connection Alias
About this task
Before you delete a JMS connection alias, make sure of the following:
- The JMS connection alias is disabled.
- No services or JMS triggers rely on the JMS connection alias. If a JMS trigger uses a JMS connection alias, Integration Server will prevent the JMS connection alias from being deleted.
To delete a JMS connection alias
Procedure
- Open Integration Server Administrator if it is not already open.
- In the Settings menu of the Navigation panel, click Messaging.
- Under JMS Configuration, click JMS Settings.
- In the JMS Connection Alias Definitions list, disable the alias if it is not already disabled.
-
Locate the alias you want to
delete and click
in the Delete column. Integration Server displays a dialog box that prompts you
to verify your action. Click OK to verify
that you want to delete the JMS connection alias.
Specifying a Connection Monitoring Period
Integration Server periodically checks the state of an active connection to the JMS provider. You can configure how frequently Integration Server checks the connection status using the watt.server.jms.connection.monitorPeriod property. The default is 45 seconds.
If the connection between Integration Server and the JMS provider fails, Integration Server attempts to re-establish the connection automatically after a 20 second delay. You can configure how long Integration Server waits between attempts to re-establish the connection by changing the value of the watt.server.jms.connection.retryPeriod property
For more information about server configuration parameters, see Server Configuration Parameters.
Specifying a Retry Interval for Failed Connections
When a connection between Integration Server and the JMS provider fails, Integration Server attempts to re-establish the connection automatically after a 20 second delay. You can configure how long Integration Server waits between attempts to re-establish the connection by changing the value of the watt.server.jms.connection.retryPeriod property. For more information about this property, see watt.server..
Specifying a Keep-Alive Interval
Integration Server periodically pings the JMS provider to keep the connection between the Integration Server and the JMS provider active. The ping acts as a keep-alive request. By default, Integration Server pings the JMS provider every 300 seconds. You can configure how frequently Integration Server pings the JMS provider by changing the value of the watt.server.jms.connection.pingPeriod property. For more information about this property, see watt.server..