10-4 Using Integration Server To Build A Client For Jms
10-4 Using Integration Server To Build A Client For Jms
for JMS
Innovation Release
Version 10.4
April 2019
This document applies to webMethods Integration Server and Software AG Designer Version 10.4 and to all subsequent releases.
Specifications contained herein are subject to change and these changes will be reported in subsequent release notes or new editions.
Copyright © 2007-2019 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or
its affiliates and/or their licensors.
The name Software AG and all Software AG product names are either trademarks or registered trademarks of Software AG and/or
Software AG USA Inc. and/or its subsidiaries and/or its affiliates and/or their licensors. Other company and product names mentioned
herein may be trademarks of their respective owners.
Detailed information on trademarks and patents owned by Software AG and/or its subsidiaries is located at
hp://softwareag.com/licenses.
Use of this software is subject to adherence to Software AG's licensing conditions and terms. These terms are part of the product
documentation, located at hp://softwareag.com/licenses and/or in the root installation directory of the licensed product(s).
This software may include portions of third-party products. For third-party copyright notices, license terms, additional rights or
restrictions, please refer to "License Texts, Copyright Notices and Disclaimers of Third Party Products". For certain specific third-party
license restrictions, please refer to section E of the Legal Notices available under "License Terms and Conditions for Use of Software AG
Products / Copyright and Trademark Notices of Software AG Products". These documents are part of the product documentation, located
at hp://softwareag.com/licenses and/or in the root installation directory of the licensed product(s).
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with
Software AG.
Table of Contents
Introduction to JMS.......................................................................................................................11
JMS Messaging........................................................................................................................ 12
Messaging Styles......................................................................................................................12
Point-to-point (PTP) Messaging........................................................................................ 12
Publish-Subscribe Messaging........................................................................................... 13
Durable Subscriptions................................................................................................ 14
Non-durable Subscriptions......................................................................................... 14
JMS API Programming Model..................................................................................................14
Administered Objects.........................................................................................................15
Types of Administered Objects.................................................................................. 15
Connection Factories.......................................................................................... 15
Destinations.........................................................................................................16
Connections....................................................................................................................... 16
Sessions............................................................................................................................ 16
Message Producer............................................................................................................ 17
Message Consumer...........................................................................................................17
Message Selector.......................................................................................................17
Messages...........................................................................................................................17
Message Structure..................................................................................................... 17
Message Acknowledgment.........................................................................................18
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 3
M
Table of Contents
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 4
M
Table of Contents
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 5
M
Table of Contents
Automatic Load Balancing Configuration for Durable Subscribers when Using the
webMethods Broker.........................................................................................................118
Consuming JMS Messages in Order with Multiple Consumers............................................. 119
Consuming JMS Messages in Order Using the webMethods Broker............................. 119
Transaction Management............................................................................................................137
Transaction Management Overview....................................................................................... 138
Transactions.....................................................................................................................138
Transaction Types........................................................................................................... 138
XA Transactions....................................................................................................... 139
Implicit and Explicit Transactions.................................................................................... 139
Implicit Transactions.................................................................................................139
Explicit Transactions.................................................................................................140
Built-In Transaction Management Services............................................................................141
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 6
M
Odd Header
Using webMethods Integration Server to Build a Client for JMS is for the developer who is
responsible for developing solutions that use webMethods Integration Server to send
and receive messages using the Java Message Service (JMS) standard.
This guide explains:
How to build services that send and receive JMS messages using built-in services.
How to create and configure JMS triggers for receiving JMS messages
How Integration Server works with cluster policies when sending JMS messages.
How to configure JMS triggers to consume messages from a destination in a load-
balanced fashion.
This guide assumes that you are familiar with the following:
Basic concepts of webMethods architecture and terminology.
Usage of Designer to create elements and build services.
General knowledge of programming, the Java programming language, and the JMS
API.
How to establish connections to one or more JMS providers by creating JMS
connection aliases. For more information about creating a JMS connection alias, see
webMethods Integration Server Administrator’s Guide.
Note: This guide describes features and functionality that may or may not be
available with your licensed version of webMethods Integration Server For
information about the licensed components for your installation, see the
Settings > License page in the webMethods Integration Server Administrator.
Document Conventions
Convention Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 7
M
Even Header
Convention Description
Italic Identifies:
Variables for which you must supply values specific to your own
situation or environment.
New terms the first time they occur in the text.
References to other documentation sources.
Monospace Identifies:
font
Text you must type in.
Messages displayed by the system.
Program code.
{} Indicates a set of choices from which you must choose one. Type
only the information inside the curly braces. Do not type the { }
symbols.
... Indicates that you can type multiple options of the same type.
Type only the information. Do not type the ellipsis (...).
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 8
M
Odd Header
You can find product information on the Software AG Empower Product Support
website at “hps://empower.softwareag.com”.
To submit feature/enhancement requests, get information about product availability,
and download products, go to “Products”.
To get information about fixes and to read early warnings, technical papers, and
knowledge base articles, go to the “Knowledge Center”.
If you have any questions, you can find a local or toll-free number for your country
in our Global Support Contact Directory at “hps://empower.softwareag.com/
public_directory.asp” and give us a call.
Software AG TECHcommunity
You can find documentation and other technical information on the Software AG
TECHcommunity website at “hp://techcommunity.softwareag.com”. You can:
Access product documentation, if you have TECHcommunity credentials. If you do
not, you will need to register and specify "Documentation" as an area of interest.
Access articles, code samples, demos, and tutorials.
Use the online discussion forums, moderated by Software AG professionals, to
ask questions, discuss best practices, and learn how other customers are using
Software AG technology.
Link to external websites that discuss open standards and web technology.
Data Protection
Software AG products provide functionality with respect to processing of personal data
according to the EU General Data Protection Regulation (GDPR). Where applicable,
appropriate steps are documented in the respective administration documentation.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 9
M
Even Header
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 10
M
Odd Header
Introduction to JMS
1 Introduction to JMS
■ JMS Messaging ............................................................................................................................ 12
■ Messaging Styles ......................................................................................................................... 12
■ JMS API Programming Model ..................................................................................................... 14
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 11
M
Even Header
Introduction to JMS
JMS Messaging
The Java Message Service (JMS) is a Java API that allows applications to communicate
with each other using a common set of interfaces. The JMS API provides messaging
interfaces, but not the implementations.
A JMS provider, such as Software AG Universal Messaging or webMethods Broker, is a
messaging system that supports the JMS message interfaces and provides administrative
and control features. It supports the routing and delivery of JMS messages.
JMS clients are the programs or components, wrien in Java, that produce and consume
messages.
Messaging Styles
A messaging style refers to how messages are produced and consumed. JMS supports
the publish-subscribe (pub-sub) and point-to-point (PTP) messaging styles.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 12
M
Odd Header
Introduction to JMS
Publish-Subscribe Messaging
In publish-subscribe messaging, message producers and consumers are known as
publishers and subscribers.
The central concept in the publish-subscribe messaging is a destination called a topic.
Message publishers send messages of specified topics. Clients that want to receive that
type of message subscribe to the topic.
The publishers and subscribers never communicate with each other directly. Instead,
they communicate by exchanging messages through a JMS provider.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 13
M
Even Header
Introduction to JMS
Publishers and subscribers have a timing dependency. Clients that subscribe to a topic
can consume only messages published after the client has created a subscription. In
addition, the subscriber must continue to be active to consume messages.
The messaging APIs relax this dependency by making a distinction between durable
subscriptions and non-durable subscriptions.
Durable Subscriptions
Durable subscriptions allow subscribers to receive all the messages published on a
topic, including those published while the subscriber is inactive. When the subscribing
applications are not running, the messaging provider holds the messages in nonvolatile
storage. It retains the messages until one of the following occurs:
The subscribing application becomes active, identifies itself to the provider, and
sends an acknowledgment of receipt of the message.
The expiration time for the messages is reached.
Non-durable Subscriptions
Non-durable subscriptions allow subscribers to receive messages on their chosen topic only
if the messages are published while the subscriber is active. You generally use this type
of subscription for any kind of data that is time sensitive, such as financial information.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 14
M
Odd Header
Introduction to JMS
Administered Objects
Administered objects are pre-configured objects that an administrator creates for use with
JMS client programs. Administered objects serve as the bridge between the client code
and the JMS provider.
By design, the messaging APIs separate the task of configuring administered objects
from the client code. This architecture maximizes portability: the provider-specific
work is delegated to the administrator rather than to the client code. However, the
implementation must supply its own set of administrative tools to configure the
administered objects.
JMS administered objects are stored in a standardized namespace called the Java
Naming and Directory Interface (JNDI). JNDI is a Java API that provides naming and
directory functionality to Java applications. JNDI provides a way to store and retrieve
objects by a user supplied name.
Connection Factories
A connection factory is the object a client uses to create a connection with a JMS provider.
It encapsulates the set of configuration parameters that a JMS administrator defines for a
connection.
The type of connection factory determines whether a connection is made to a topic
(in a publish-subscribe application), a connection is make to a queue (in a point-to-
point application), or a connection can be made to both (generic connection). The
connection factory type also determines whether messages are managed like elements in
a distributed transaction in the client application.
You use XA-based connection factories in JMS applications managed by an application
server, in the context of a distributed transaction.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 15
M
Even Header
Introduction to JMS
Destinations
Destinations are the objects that a client uses to specify the target of messages it
produces and the source of messages it consumes. These objects specify the identity of
a destination to a JMS API method. Four types of destinations exist; only the first two
(queues and topics) are administered objects.
Queue. An object that covers a provider-specific queue name. This object is how a
client specifies the identity of a queue to JMS methods.
Topic. An object that covers a provider-specific topic name. This object is how a client
specifies the identity of a topic to JMS methods.
Temporary Queue. A queue object created for the duration of a particular connection
(or QueueConnection). It can only be consumed by the connection from which it was
created.
Temporary Topic. A topic object that is created for the duration of a particular
connection (or TopicConnection). It can only be consumed by the connection from
which it was created.
Connections
A connection object is an active connection from a client to its JMS provider. In JMS,
connections support concurrent use. A connection serves the following purposes:
A connection encapsulates an open connection with a JMS provider. It typically
represents an open TCP/IP socket between a client and the service provider software.
The creation of a connection object is the point where client authentication takes
place.
A connection object can specify a unique client identifier.
A connection object supports a user-supplied ExceptionListener object.
A connection should always be closed when it is no longer needed.
Sessions
A session object is a single-threaded context for producing and consuming messages. If a
client uses different threads for different paths of message execution, then a session must
be created for each of the threads.
A session is used to create message producers, message consumers, temporary topics,
and temporary queues; it also supplies provider-optimized message factories.
In JMS, a session provides the context for grouping a set of send and receive messages
into a transactional unit.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 16
M
Odd Header
Introduction to JMS
Message Producer
A message producer is an object that a session creates to send messages to a destination (a
topic or a queue).
Message Consumer
A message consumer is an object that a session creates to receive messages sent to a
destination. A message consumer allows a client to register interest in a destination,
which manages the delivery of messages to the registered consumers of that destination.
Message Selector
A client may want to receive subsets of messages. A message selector allows a client to
filter the messages it wants to receive by use of a SQL92 string expression in the message
header. That expression is applied to properties in the message header (not to the
message body content) containing the value to be filtered.
If the SQL expression evaluates to true, the message is sent to the client; if the SQL
expression evaluates to false, it does not send the message.
Messages
Messages are objects that communicate information between client applications.
Following are descriptions of several key concepts related to JMS messages.
Message Structure
Messages are composed of the following parts:
Header. All messages support the same set of header fields. Header fields contain
predefined values that allow clients and providers to identify and route messages.
Each of the fields supports its own set and get methods for managing data. Some
fields are set automatically by the send and publish methods, whereas others must
be set by the client.
Examples of header fields include:
JMSDestination, which holds a destination object representing the
destination to which the message is to be sent.
JMSMessageID, which holds a unique message identifier value and is set
automatically.
JMSCorrelationID, which is used to link a reply message with its requesting
message. This value is set by the client application.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 17
M
Even Header
Introduction to JMS
JMSReplyTo, which is set by the client and takes as a value a Destination object
representing where the reply is being sent. If no reply is being sent, this field is
set to null.
Properties (optional). Properties are used to add optional fields to the message header.
Several types of message property fields exist:
Application-specific properties are typically used to hold message selector values.
Message selectors are used to filter and route messages.
Standard properties. The API provides some predefined property names that
a provider may support. Support for the JMSXGroupID and JMSXGroupSeq is
required; however, support for all other standard properties is optional.
Provider-specific properties are unique to the messaging provider and typically
refer to internal values.
Body (optional). The JMS standard defines various types of message body formats
that are compatible with most messaging styles. Each form is defined by a message
interface.
StreamMessage. A message whose body contains a stream of Java primitive
values. It is filled and read sequentially.
MapMessage. A message whose body contains a set of name-value pairs where
names are Strings and values are Java primitive types. The entries can be
accessed sequentially by enumerator or randomly by name. The order of the
entries is undefined.
TextMessage. A message whose body contains a java.lang.String.
Message Acknowledgment
A message is not considered to be successfully consumed until it is acknowledged.
Depending on the session acknowledgment mode, the messaging provider may send
a message more than once to the same destination. Several message acknowledgment
constants exist.
Value Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 18
M
Odd Header
Introduction to JMS
Value Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 19
M
Even Header
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 20
M
Odd Header
Working with JMS Triggers
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 21
M
Even Header
Working with JMS Triggers
A JMS trigger subscribes to destinations (queues or topics) on a JMS provider and then
specifies how Integration Server processes messages the JMS trigger receives from those
destinations. Integration Server and Designer support two types of JMS triggers:
Standard JMS triggers use routing rules to specify which services can process messages
received by the trigger. The trigger service in the routing rule receives the entire JMS
message as an IData.
SOAP- JMS triggers are used to receive JMS messages that contain SOAP messages.
When a SOAP-JMS trigger receives a message, Integration Server extracts the SOAP
message from the JMS message and passes the SOAP message to the internal web
services stack. The web services stack processes the message according to the web
service descriptor specified in the SOAP-JMS request.
Note: Information about using Integration Server for JMS is located in webMethods
Integration Server Administrator’s Guide, webMethods Service Development Help,
and Using webMethods Integration Server to Build a Client for JMS.
webMethods Integration Server Administrator’s Guide contains information
about how to configure Integration Server to work with a JMS provider,
how to create a WS endpoint trigger, and how to manage JMS triggers at
run time.
webMethods Service Development Help includes this “Working with JMS
Triggers” topic which provides procedures for using Designer to create
JMS triggers and set JMS trigger properties.
Using webMethods Integration Server to Build a Client for JMS contains
information such as how to build services that send and receive JMS
messages, how Integration Server works with cluster policies when
sending JMS messages, and detailed information regarding how
Integration Server performs exactly-once processing. For completeness,
Using webMethods Integration Server to Build a Client for JMS also includes
the “Working with JMS Triggers” topic that appears in webMethods Service
Development Help.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 22
M
Odd Header
Working with JMS Triggers
SOAP-JMS trigger receives JMS messages from a destination (queue or topic) on the
JMS provider. Note that a SOAP-JMS trigger can specify a message selector which
limits the messages the SOAP-JMS trigger receives from that destination. Integration
Server extracts the SOAP message and passes it to the internal web services stack for
processing. Integration Server also retrieves JMS message properties that it passes
to the web services stack, including targetService, soapAction, contentType, and
JMSMessageID. These properties specify the web service descriptor and operation
for which the SOAP request is intended. The web services stack then processes the
SOAP message according to the web service descriptor (for example, executing request
handlers) and invokes the web service operation specified in the SOAP request message.
A SOAP-JMS trigger is associated with one or more provider web service descriptors via
a provider web service endpoint alias. The provider web service endpoint alias specifies
the SOAP-JMS trigger that receives messages from destinations on the JMS provider.
The provider web service endpoint alias is assigned to a JMS binder in a provider web
service descriptor. In this way, SOAP-JMS triggers act as listeners for provider web
service descriptors.
Note: Even though a SOAP-JMS trigger is associated with one or more provider web
service descriptors, the SOAP-JMS trigger can pass any SOAP-JMS message to
the web services stack for processing.
The properties assigned to the SOAP-JMS trigger determine how Integration Server
acknowledges the message, provides exactly-once processing, or handles transient or
fatal errors.
While SOAP-JMS triggers and standard JMS triggers share many properties and
characteristics, some properties available to standard JMS triggers are not available to
SOAP-JMS triggers, specifically:
SOAP-JMS triggers can subscribe to one destination only. Consequently, SOAP-JMS
triggers do not have joins. Designer does not display the Join expires and Expire after
properties for a SOAP-JMS trigger.
SOAP-JMS triggers use web services to process the payload of the JMS message.
Designer does not display the Message Routing table for SOAP-JMS triggers.
SOAP-JMS triggers cannot be used to perform ordered service execution. Standard
JMS triggers use multiple routing rules and local filters to perform ordered service
execution. Because SOAP-JMS triggers do not use routing rules, SOAP-JMS triggers
cannot be used to perform ordered service execution.
A SOAP-JMS trigger, specifically a connection for a SOAP-JMS trigger, can process
only one message at a time. Batch processing is not available for SOAP-JMS triggers.
Designer does not display the Max batch processing property for SOAP-JMS triggers.
A transacted SOAP-JMS trigger (one that executes as part of a transaction) has
additional requirements and limitations when used with web service descriptors. For
more information, see the Web Services Developer’s Guide.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 23
M
Even Header
Working with JMS Triggers
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 24
M
Odd Header
Working with JMS Triggers
If you use a JNDI provider to store JMS administered objects, the Connection
Factories that you want the JMS trigger to use to consume messages must already
exist.
If you use a JNDI provider to store JMS administered objects and the JMS provider
is not webMethods Broker, the destinations (queues and topics) from which this JMS
trigger will receive messages must already exist.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 25
M
Even Header
Working with JMS Triggers
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 26
M
Odd Header
Working with JMS Triggers
6. In the Select a JMS connection alias for triggerName dialog box, select the JMS
connection alias that you want this JMS trigger to use to receive messages from the
JMS provider. Click OK.
Designer sets the Transaction type property to match the transaction type specified for
the JMS connection alias.
If a JMS connection alias has not yet been configured on Integration Server, Designer
displays a message stating the JMS subsystem has not been configured. For
information abut creating a JMS connection alias, see webMethods Integration Server
Administrator’s Guide.
7. In the JMS trigger type list, select one of the following:
Select To...
8. Under JMS destinations and message selectors, specify the destinations from which
the JMS trigger will receive messages. For more information, see “Adding JMS
Destinations and Message Selectors to a JMS Trigger” on page 28.
Note: For SOAP-JMS triggers, you can specify one destination only.
9. If you selected multiple destinations, select the join type. The join type determines
whether Integration Server needs to receive messages from all, any, or only one of
destinations to execute the trigger service.
All (AND) Integration Server to invoke the trigger service when the
trigger receives a message from every destination within
the join time-out period. The messages must have the same
activation.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 27
M
Even Header
Working with JMS Triggers
Only one (XOR) Integration Server to invoke the trigger service when it
receives a message from any of the specified destinations.
For the duration of the join time-out period, the Integration
Server discards any messages with the same activation that
the trigger receives from the specified destinations.
10. If this is a standard JMS trigger, under Message routing, add routing rules. For more
information, see “Adding Routing Rules to a Standard JMS Trigger” on page 33.
11. In the Properties view, set properties for the JMS trigger.
12. Enter comments or notes, if any, in the Comments tab.
13. Click File > Save.
Note: If you do not see and the Enable Destination Management with Designer
option is enabled for the JMS connection alias, refresh the package that
contains the JMS trigger.
If the Order By mode for the selected destination does not match the existing
message processing mode, Designer prompts you to change the processing
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 28
M
Odd Header
Working with JMS Triggers
mode. This situation can occur only when the JMS provider is webMethods
Broker.
For instructions for creating a destination, see “Creating a Destination on the JMS
Provider” on page 30.
4. In the Destination Name column, in the Destination Type column, select the type of
destination:
Select... If...
5. In the JMS Message Selector column, click . In the Enter JMS Message Selector
dialog box, enter the expression that you want to use to receive a subset of messages
from this destination and click OK.
For more information about creating a JMS message selector, see “Creating a
Message Selector” on page 33.
6. If you specified the destination type as Topic (Durable Subscriber), in the Durable
Subscriber Name column, do one of the following:
Enter a name for the durable subscriber.
If the JMS connection alias creates a connection on webMethods Broker or
Universal Messaging, click to select from a list of existing durable subscribers
for the topic. In the Durable Subscriber List dialog box select the durable
subscriber and click OK.
If the durable subscriber that you want this JMS trigger to use does not exist, you
can create it by entering in the name in the Durable Subscriber Name column. The
name must be unique for the connection where the connection name is the client
ID of the JMS connection alias. webMethods Broker or Universal Messaging, will
create the durable subscriber name using the client ID of the JMS connection alias
and the specified durable subscriber name.
7. If you want the JMS trigger to ignore messages sent using the same JMS connection
alias as the JMS trigger, select the check box in the Ignore Locally Published column.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 29
M
Even Header
Working with JMS Triggers
This property applies only when the Destination Type is Topic or Topic (Durable
Subscriber).
Note: If the JMS connection alias specified for this trigger has the Create New
Connection per Trigger option enabled, then Ignore Locally Published will
not work. For the JMS trigger to ignore locally published messages, the
publisher and subscriber must share the same connection. When the JMS
connection alias uses multiple connections per trigger, the publisher and
subscriber will not share the same connection.
8. Repeat this procedure for each destination from which you want the JMS trigger to
receive messages.
9. Click File > Save.
Notes:
If you specify a new durable subscriber name and the JMS connection alias that
the JMS trigger uses to retrieve messages is configured to manage destinations,
Integration Server creates a durable subscriber for the topic when the JMS trigger is
first enabled.
If you specify a destination type of Topic (Durable Subscriber) but do not specify a
durable subscriber name, Designer changes the destination type to Topic when you
save the JMS trigger.
Note: Prior to version 9.5 SP1, Software AG Universal Messaging was named
webMethods Nirvana.
The JMS connection alias used by the JMS trigger must be configured to manage
destinations.
The JMS connection alias must be enabled when you work with the JMS trigger.
If the JMS connection alias creates a connection on a webMethods Broker in a
webMethods Broker cluster, you will not be able to create a destination at the
webMethods Broker.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 30
M
Odd Header
Working with JMS Triggers
Select... To...
Durable Subscriber Name A name for the durable subscriber. The name must be
unique for the connection, where the connection name
is the client ID of the JMS connection alias. The JMS
provider (webMethods Broker, Universal Messaging,
or Nirvana) will create the durable subscriber name
using the client ID of the JMS connection alias and the
specified durable subscriber name.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 31
M
Even Header
Working with JMS Triggers
Select... To...
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 32
M
Odd Header
Working with JMS Triggers
Note: If you want to filter on the contents of the JMS message body, write a local
filter. Integration Server evaluates a local filter after the JMS trigger receives
the message from the JMS provider. Only standard JMS triggers can use local
filters.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 33
M
Even Header
Working with JMS Triggers
2. In the Trigger Seings tab, under Message routing, click to add a new routing
rule.
3. In the Name column, type a name for the routing rule. By default Designer assigns
the first rule the name “Rule 1”.
4. In the Service column, click to navigate to and select the service that you want to
invoke when Integration Server receives messages from the specified destinations.
5. In the Local Filter column, click to enter the filter that you want Integration Server
to apply to messages this JMS trigger receives. For more information about creating a
local filter, see “Creating a Local Filter” on page 34.
6. Click File > Save.
Note that even though the properties field is a child of the JMSMessage document, the
JMSMessage document does not need to appear in the filter expression.
The following filter matches those messages where the data document within the
JMSMessage /body document contains a field named myField whose value is “A”:
%body/data/myField% == "A"
Note: When receiving a batch of messages, Integration Server evaluates the local
filter against the first message in the batch only. Integration Server does not
apply the filter to subsequent messages in the batch. For more information
about batch processing, see “About Batch Processing for Standard JMS
Triggers” on page 45.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 34
M
Odd Header
Working with JMS Triggers
Note: Prior to version 9.5 SP1, Software AG Universal Messaging was named
webMethods Nirvana.
For a complete list of the requirements for using Designer to manage destinations
and durable subscribers on the JMS provider, see webMethods Integration Server
Administrator’s Guide.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 35
M
Even Header
Working with JMS Triggers
Note: If another client, such as another JMS trigger, currently connects to the queue
or durable subscriber that you want to modify or remove, then Integration
Server cannot update or remove the queue or durable subscriber. If the
JMS provider is webMethods Broker, updates must be made through My
webMethods. If the JMS provider is Universal Messaging, updates must be
made through Universal Messaging Enterprise Manager. If the JMS provider
is Nirvana, updates must be made through Nirvana Enterprise Manager.
For more information about managing destinations and durable subscriptions on the
JMS provider, see “Managing Destinations and Durable Subscribers on the JMS Provider
through Designer ” on page 35.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 36
M
Odd Header
Working with JMS Triggers
Integration Server evaluates the routing rules in the same order in which the rules
appear in the editor. It is possible that a message could satisfy more than one routing
rule. However, Integration Server executes only the service associated with the first
satisfied routing rule and ignores the remaining routing rules. Therefore, the order in
which you list routing rules on the editor is important.
You might want to use multiple routing rules to control service execution when a
service that processes a message depends on successful execution of another service.
For example, to process a purchase order, you might create one service that adds a new
customer record to a database, another that adds a customer order, and a third that bills
the customer. The service that adds a customer order can only execute successfully if the
new customer record has been added to the database. Likewise, the service that bills the
customer can only execute successfully if the order has been added. You can ensure that
the services execute in the necessary order by creating a trigger that contains one routing
rule for each expected message.
Important: Messages must be sent to JMS provider in the same order in which you want
the messages to be processed.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 37
M
Even Header
Working with JMS Triggers
Note: If you disable a SOAP-JMS trigger that acts as a listener for one or more
provider web service descriptors, Integration Server will not retrieve any
messages for those web service descriptors.
Select... To...
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 38
M
Odd Header
Working with JMS Triggers
Enabled The JMS trigger is available. A JMS trigger must be enabled for it
to receive and process messages.
An enabled trigger can have a status of “Not Running” which
means that it would not receive and process messages. Reasons
that an enabled JMS trigger can be disabled include: a disabled
JMS connection alias, an exception thrown by the trigger, and
trigger failure at startup. JMS trigger status can be seen on the
Settings > Messaging > JMS Trigger Management page in Integration
Server Administrator.
Suspended The JMS trigger is running and connected to the JMS provider.
Integration Server has stopped message retrieval, but continues
processing any messages it has already retrieved. Integration
Server enables the JMS trigger automatically upon server restart
or when the package containing the JMS trigger reloads.
Note: The Acknowledgement mode property is not available for transacted JMS
triggers. That is, if the JMS connection alias is of type XA_TRANSACTION
or LOCAL_TRANSACTION, Designer does not display the Acknowledgement
mode property.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 39
M
Even Header
Working with JMS Triggers
Select... To...
Note: You need to specify a join time-out only when the join type is All (AND) or Only
one (XOR). You do not need to specify a join time-out for an Any (OR) join.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 40
M
Odd Header
Working with JMS Triggers
Note: You need to specify a join time-out only when the join type is All (AND) or Only
one (XOR). You do not need to specify a join time-out for an Any (OR) join.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 41
M
Even Header
Working with JMS Triggers
Select... To...
False Specify that the join does not expire. Integration Server should
wait indefinitely for messages from the additional destinations
specified in the join condition. Set the Join expires property to
False only if you are confident that all of the messages will be
received eventually.
Important:
A join is persisted across server restarts.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 42
M
Odd Header
Working with JMS Triggers
Serial Processing
In serial processing, Integration Server processes messages received by a JMS trigger
one after the other in the order in which the messages were received from the JMS
provider. Integration Server uses a single thread for receiving and processing a message
for a serial JMS trigger. Integration Server evaluates the first message it receives,
determines which routing rule the message satisfies, and executes the service specified
in the routing rule. Integration Server waits for the service to finish executing before
processing the next message received from the JMS provider.
If you want to process messages in the same order in which JMS clients sent the
messages to the JMS provider, you will need to configure the JMS provider to ensure
that messages are received by the JMS trigger in the same order in which the messages
are published.
For information about using serial JMS triggers in a cluster to process messages from
a single destination in publishing order, see the Using webMethods Integration Server to
Build a Client for JMS.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 43
M
Even Header
Working with JMS Triggers
Tip: If your trigger contains multiple routing rules to handle a group of messages
that must be processed in a specific order, use serial processing.
Concurrent Processing
In concurrent processing, Integration Server processes messages received from the
JMS provider in parallel. That is, Integration Server processes as many messages for
the JMS triggers as it can at the same time, using a separate server thread to process
each message. Integration Server does not wait for the service specified in the routing
rule to finish executing before it begins processing the next message. You can specify
the maximum number of messages Integration Server can process concurrently. This
equates to specifying the maximum number of server threads that can process messages
for the JMS trigger at one time.
Concurrent processing provides faster performance than serial processing. Integration
Server processes the received messages more quickly because it can process more than
one message for the trigger at a time. However, the more messages Integration Server
processes concurrently, the more server threads it dispatches, and the more memory the
message processing consumes.
Additionally, for JMS triggers with concurrent processing, Integration Server does not
guarantee that messages are processed in the order in which they are received.
A concurrent trigger can connect to the JMS provider through multiple connections,
which can increase trigger throughout. For more information about multiple
connections, refer to “Using Multiple Connections to Retrieve Messages for a Concurrent
JMS Trigger” on page 46.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 44
M
Odd Header
Working with JMS Triggers
2 and Max execution threads is set to 10, each connection will have 5 threads plus 1, for a
total of 12 threads.
Integration Server acknowledges all the messages received in a batch from the JMS
provider at one time. This includes messages that failed pre-processing. As described by
the Java Message Service standard, when a client acknowledges one message, the client
acknowledges all of the messages received by the session. Because Integration Server
uses a consumer that includes a javax.jms.MessageConsumer and a javax.jms.Session,
when Integration Server acknowledges one message in the batch, it effectively
acknowledges all the messages received in the batch.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 45
M
Even Header
Working with JMS Triggers
If a batch of messages is not acknowledged or they are recovered back to the JMS
provider, the JMS provider can redeliver all of the messages in the batch to the JMS
trigger. However, when using webMethods Broker, Integration Server can acknowledge
individual messages that fail pre-processing.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 46
M
Odd Header
Working with JMS Triggers
The JMS trigger must receive messages from a queue or from a topic with a durable
subscriber. JMS triggers that receive messages from non-durable subscribers (topics)
cannot use multiple connections.
The JMS trigger must not have the Ignore locally published option selected when
the JMS connection alias is configured to use the Create New Connection per Trigger
option. For the JMS trigger to ignore locally published messages, the publisher and
subscriber must share the same connection. When the JMS connection alias uses
multiple connections per trigger, the publisher and subscriber will not share the
same connection.
The JMS connection alias used by the JMS trigger must be configured to create an
individual connection for each trigger. To configure a JMS alias to create individual
connections for each JMS trigger, select the Create New Connection per Trigger option
on the Settings > Messaging > JMS Settings > JMS Connection Alias screen on Integration
Server Administrator.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 47
M
Even Header
Working with JMS Triggers
Note: This prefetch cache can be used with JMS triggers that receive messages from
webMethods Broker only. webMethods Broker is deprecated.
The use of the prefetch cache for a JMS trigger and the number of messages Integration
Server might retrieve with each request are determined by the Max prefetch size property
for the JMS trigger and the value of the wa.server.jms.trigger.maxPrefetchSize
parameter.
When the Max prefetch size property is greater than 0, Integration Server uses the
prefetch cache with the JMS trigger. The Max prefetch size property value specifies the
number of messages that Integration Server might retrieve and cache for the trigger.
The default is 10.
When the Max prefetch size property is set to -1, Integration Server uses the prefetch
cache with the JMS trigger. The wa.server.jms.trigger.maxPrefetchSize parameter
value determines how many messages Integration Server might retrieves and cache
for the JMS trigger.
When the Max prefetch size property is set to 0, Integration Server does not use the
prefetch cache with the JMS trigger.
When the prefetch cache is in use and the number of messages retrieved by Integration
Server is greater than one, the same server thread might process all of the messages
retrieved by the prefetch request. This is true even for concurrent JMS triggers. The first
thread for the concurrent JMS trigger processes the first set of prefetched messages. The
second thread for the concurrent JMS trigger processes the second set of prefetched
messages.
For example, suppose that the number of available messages is 22, Max execution threads
is 4, and Max prefetch size is 10. In the initial request for messages, the first server thread
may retrieve 10 messages. The same server thread will process these first 10 messages.
The second server thread may retrieve 10 messages, all of which will be processed by the
second server thread. The third server thread may retrieve the remaining 2 messages,
both of which will be processed by the third server thread. While the concurrent JMS
trigger can use up to 4 server threads, Integration Server might use only 3 server threads
to retrieve and process messages due to the way in which a JMS trigger processes
prefetched messages. A concurrent JMS trigger will use all of the configured execution
threads to process messages only when the number of messages on the webMethods
Broker is greater than the number of messages that can be prefetched.
Note: When you are working with a cluster of Integration Servers, the prefetch
behavior might appear at first to be misleading. For example, suppose
that you have a cluster of two Integration Servers. Each Integration Server
contains the same JMS trigger. Twenty messages are sent to a destination from
which JMS trigger receives messages. It might be expected the JMS trigger
on Integration Server 1 will receive the first message, the JMS trigger on
Integration Server 2 will receive the second message, and so forth. However,
what may happen is that the JMS trigger on Integration Server 1 will receive
the first 10 messages and the JMS trigger on Integration Server 2 will receive
the second 10 messages.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 48
M
Odd Header
Working with JMS Triggers
Select... To...
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 49
M
Even Header
Working with JMS Triggers
Select... To...
3. If you want this trigger to perform batch processing, next to Max batch messages,
specify the maximum number of messages that the trigger service can receive at one
time. If you do not want the trigger to perform batch processing, leave this property
set to 1. The default is 1.
4. If you want this trigger to use multiple connections to receive messages from the JMS
provider, next to Connection count, specify the number of connections you want the
JMS trigger to make to the JMS provider. The default is 1.
5. If you want Integration Server to use the prefetch cache with this JMS trigger, in the
Properties view, under webMethods Broker(deprecated) do one of the following for Max
prefetch size:
Specify the number of messages you want Integration Server to retrieve and
cache for this JMS trigger. The default is 10 messages.
Specify -1 if you want the value of wa.server.jms.trigger.maxPrefetchSize
parameter to determine how many messages Integration Server retrieves and
caches for the JMS trigger.
Specify 0 if you do not want to use the prefetch cache with this JMS trigger.
6. Click File > Save.
If the destination is Queue or Topic (Durable Subscriber) and the JMS trigger is
connected to the queue or durable subscriber, Designer prompts you to update the
corresponding destination on the webMethods Broker with the changed shared state
order mode, click Yes to update the destination. Click No to skip the destination
update. Note that messages might be lost while Designer and Integration Server
make the update because Integration Server deletes and recreates the subscription as
part of the update.
Note: A JMS trigger is connected to the webMethods Broker when the specified
JMS connection alias is enabled and connected to the webMethods Broker.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 50
M
Odd Header
Working with JMS Triggers
If a trigger service ends because of an exception, and you configured the JMS trigger
to suspend on fatal errors, Integration Server suspends the trigger and acknowledges
the message to the JMS provider. The JMS trigger remains suspended until one of the
following occurs:
You enable the trigger using the pub.trigger:enableJMSTriggers service.
You enable the trigger using Integration Server Administrator.
Integration Server restarts or the package containing the trigger reloads. (When
Integration Server suspends a trigger because of a fatal error, Integration Server
considers the change to be temporary. For more information about temporary
vs. permanent state changes for triggers, see webMethods Integration Server
Administrator’s Guide.)
Automatic suspension of a trigger can be especially useful for serial triggers that are
designed to process a group of messages in a particular order. If the trigger service
ends in error while processing the first message, you might not want the trigger to
proceed with processing the subsequent messages in the group. If Integration Server
automatically suspends the trigger, you have an opportunity to determine why the
trigger service did not execute successfully.
Important: If you disable or suspend a SOAP-JMS trigger that acts as a listener for one
or more provider web service descriptors, Integration Server will not retrieve
any messages for those web service descriptors until the trigger is enabled.
You can handle the exception that causes the fatal error by configuring Integration
Server to generate JMS retrieval failure events for fatal errors and by creating an
event handler that subscribes to JMS retrieval failure events. Integration Server passes
the event handler the contents of the JMS message as well as information about the
exception.
Integration Server handles fatal errors for transacted JMS differently than for non-
transacted JMS triggers. For information about fatal error handling for transacted JMS
triggers, see “Fatal Error Handling for Transacted JMS Triggers” on page 65.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 51
M
Even Header
Working with JMS Triggers
Note: A web service connector that sends a JMS message can throw an
ISRuntimeException, such as when the JMS provider is not available.
However, Integration Server automatically places the ISRuntimeException
in the fault document returned by the web service connector. If you want
the parent flow service to catch the transient error and re-throw it as an
ISRuntimeException, you must code the parent flow service to check the fault
document for an ISRuntimeException and then throw an ISRuntimeException
explicitly.
You can also configure Integration Server and/or a JMS trigger to handle transient errors
that occur during trigger preprocessing. The trigger preprocessing phase encompasses
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 52
M
Odd Header
Working with JMS Triggers
the time from when a trigger first receives a message from it’s local queue on Integration
Server to the time the trigger service executes.
For more information about transient error handling for trigger preprocessing, see
“Transient Error Handling During Trigger Preprocessing” on page 111.
Note: Integration Server does not apply the SOAP-JMS trigger transient error
handling behavior to service handlers executed as part of processing web
services. Integration Server treats all errors thrown by service handler as
fatal errors.
The maximum number of retry aempts Integration Server should make for each
trigger service.
The time interval between retry aempts.
How to handle a retry failure. That is, you can specify what action Integration
Server takes if all the retry aempts are made and the trigger service or web service
operation still fails because of an ISRuntimeException. For more information about
handling retry failures, see “Handling Retry Failure” on page 54.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 53
M
Even Header
Working with JMS Triggers
When a service invokes a pub.jms* service that sends a JMS message and the service fails
because a resource needed by the pub.jms* service is not available, Integration Server
automatically detects and propagates an ISRuntimeException.
Adapter services built on Integration Server 6.0 or later, and based on the ART
framework, detect and propagate exceptions that signal a retry if a transient error is
detected on their back-end resource. This behavior allows for the automatic retry when
the service functions as a trigger service.
Note: Integration Server does not retry a trigger service that fails because a
ServiceException occurred. A ServiceException indicates that there is
something functionally wrong with the service. A service can throw a
ServiceException using the EXIT step.
Step Description
1 Integration Server makes the final retry aempt and the trigger service or
web service operation fails because of an ISRuntimeException.
2 Integration Server treats the last trigger service or web service operation
failure as a ServiceException.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 54
M
Odd Header
Working with JMS Triggers
Step Description
In summary, the default retry failure behavior (Throw exception) rejects the message and
allows the trigger to continue with message processing when retry failure occurs for a
trigger service.
Step Description
1 Integration Server makes the final retry aempt and the trigger service or
web service operation fails because of an ISRuntimeException.
3 Integration Server recovers the message back to the JMS provider. This
indicates that the required resources are not ready to process the message
and makes the message available for processing at a later time. For serial
triggers, it also ensures that the message maintains its position at the top
of trigger queue.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 55
M
Even Header
Working with JMS Triggers
Step Description
Tip: You can change the frequency with which the resource
monitoring service executes by modifying the value of the
wa.server.jms.trigger.monitoringInterval property.
In summary, the Suspend and retry later option provides a way to resubmit the message
programmatically. It also prevents the trigger from retrieving and processing other
messages until the cause of the transient error condition has been remedied.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 56
M
Odd Header
Working with JMS Triggers
Note: If you do not configure service retry for a trigger, set the Max retry attempts
property to 0. Because managing service retries creates extra overhead, seing
this property to 0 can improve the performance of services invoked by the
trigger.
Select... To...
Suspend and retry later Specify that Integration Server should recover the
message back to the JMS provider and suspend the
trigger when the last allowed retry aempt ends
because of an ISRuntimeException.
5. If you selected Suspend and retry later, then in the Resource monitoring service
property specify the service that Integration Server should execute to determine the
availability of resources associated with the trigger service. Multiple triggers can use
the same resource monitoring service. For information about building a resource
monitoring service, see Using webMethods Integration Server to Build a Client for JMS.
6. Click File > Save.
Notes:
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 57
M
Even Header
Working with JMS Triggers
Standard JMS triggers and services can both be configured to retry. When a trigger
invokes a service (that is, the service functions as a trigger service), Integration
Server uses the trigger retry properties instead of the service retry properties.
SOAP-JMS triggers and services used as operations in provider web service
descriptors can both be configured to retry. When a web service operation processes
a message received by a SOAP-JMS trigger, Integration Server uses the trigger retry
properties instead of the service (operation) retry properties.
Integration Server does not retry service handlers invoked by a SOAP-JMS trigger.
When Integration Server retries a trigger service and the trigger service is configured
to generate audit data on error, Integration Server adds an entry to the audit log for
each failed retry aempt. Each of these entries will have a status of “Retried” and an
error message of “Null”. However, if Integration Server makes the maximum retry
aempts and the trigger service still fails, the final audit log entry for the service
will have a status of “Failed” and will display the actual error message. Integration
Server makes the audit log entry regardless of which retry failure option the trigger
uses.
Integration Server generates the following journal log message between retry
aempts:
[ISS.0014.0031D] Service serviceName failed with ISRuntimeException. Retry x of y
will begin in retryInterval milliseconds.
You can invoke the pub.flow:getRetryCount service within a trigger service to determine
the current number of retry aempts made by Integration Server and the maximum
number of retry aempts allowed for the trigger service. For more information about
the pub.flow:getRetryCount service, see the webMethods Integration Server Built-In Services
Reference.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 58
M
Odd Header
Working with JMS Triggers
Note: For detailed information about exactly-once processing for messages received
by JMS triggers, see Using webMethods Integration Server to Build a Client for
JMS.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 59
M
Even Header
Working with JMS Triggers
process duplicates of a message, you should not configure exactly-once processing for
the trigger.
Keep the following points in mind when configuring exactly-once processing:
Integration Server can perform exactly-once processing for persistent messages only.
The sending client must set the JMSDeliveryMode to persistent.
The JMS trigger must specify CLIENT_ACKNOWLEDGE for the acknowledgement mode.
You do not need to configure all three methods of duplicate detection. However,
if you want to ensure exactly-once processing, you must use a document history
database or implement a custom solution using the document resolver service.
A document history database offers a simpler approach than building a custom
solution and will typically catch all duplicate messages. There may be exceptions
depending on your implementation. For more information about these exceptions,
see “Building a Transacted JMS Trigger” on page 61. To minimize these
exceptions, it is recommended that you use a history database and a document
resolver service.
Stand-alone Integration Servers cannot share a document history database. Only a
cluster of Integration Servers or a non-clustered group of Integration Servers can
(and must) share a document history database.
Make sure the duplicate detection window set by the History time to live property is
long enough to catch duplicate messages but does not cause the document history
database to consume too many server resources. If sending JMS clients reliably send
messages once, you might use a smaller duplicate detection window. If the JMS
clients are prone to sending duplicate messages, consider seing a longer duplicate
detection window.
If you intend to use a document history database as part of duplicate detection, you
must first install the document history database component and associate it with a
JDBC connection pool. For instructions, see Installing Software AG Products.
Note: For detailed information about exactly-once processing for messages received
by JMS triggers, see Using webMethods Integration Server to Build a Client for
JMS.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 60
M
Odd Header
Working with JMS Triggers
4. To use a service that you create to resolve the status of In Doubt messages, specify
that service in the Document resolver service property.
5. Click File > Save.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 61
M
Even Header
Working with JMS Triggers
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 62
M
Odd Header
Working with JMS Triggers
Stage 3 Specify the destination (queues or topics) on the JMS provider from
which you want to receive messages. You also specify any message
selectors that you want the JMS provider to use to filter messages for the
JMS trigger.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 63
M
Even Header
Working with JMS Triggers
Stage 4 For a standard JMS trigger, create routing rules and specify the services
that Integration Server invokes when the JMS trigger receives messages.
SOAP-JMS triggers do not use routing rules.
Fatal error handling > Specifies whether you want Integration Server
Suspend on error to suspend the trigger when a trigger service
ends with an error. Select True or False.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 64
M
Odd Header
Working with JMS Triggers
Stage 6 Test and debug the JMS trigger. For more information, see “Debugging
a JMS Trigger” on page 61.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 65
M
Even Header
Working with JMS Triggers
Step Description
2 Integration Server rolls back the entire transaction and Integration Server
recovers the message back to the JMS provider. The JMS provider marks the
message as redelivered and increments the value of the JMSXDeliveryCount
property in the JMS message.
5 The JMS trigger remains suspended until one of the following occurs:
You enable the trigger using the pub.trigger:enableJMSTriggers service.
You enable the trigger using Integration Server Administrator.
Integration Server restarts or the package containing the trigger reloads.
(When Integration Server suspends a trigger because of a fatal error,
Integration Server considers the change to be temporary. For more
information about temporary vs. permanent state changes for triggers, see
webMethods Integration Server Administrator’s Guide.)
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 66
M
Odd Header
Working with JMS Triggers
You can handle the exception that causes the fatal error by configuring Integration
Server to generate JMS retrieval failure events for fatal errors and by creating an event
handler that subscribes to JMS retrieval failure events. Integration Server passes the
contents of the JMS message and exception information to the event handler.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 67
M
Even Header
Working with JMS Triggers
A transient error occurs on the back-end resource for an adapter service. Adapter
services built on Integration Server 6.0 or later, and based on the ART framework,
detect and propagate exceptions that signal a retry automatically if a transient error
is detected on their back-end resource.
Note: A web service connector that sends a JMS message can throw an
ISRUntimeException, such as when the JMS provider is not available.
However, Integration Server automatically places the ISRuntimeException
in the fault document returned by the web service connector. If you want
the parent flow service to catch the transient error and re-throw it as an
ISRuntimeException, you must code the parent flow service to check the fault
document for an ISRuntimeException and then throw an ISRuntimeException
explicitly.
You can specify one of the following transient error handling options for a transacted
JMS trigger:
Recover only. After a transaction is rolled back, Integration Server receives the
message from the JMS provider almost immediately. This is the default.
Suspend and recover. After a transaction is rolled back, Integration Server suspends the
JMS trigger and receives the message from the JMS provider at a later time.
You can also configure Integration Server and/or a JMS trigger to handle transient errors
that occur during trigger preprocessing. The trigger preprocessing phase encompasses
the time from when a trigger first receives a message from it’s local queue on Integration
Server b to the time the trigger service executes.
For more information about transient error handling for trigger preprocessing, see
“Transient Error Handling During Trigger Preprocessing” on page 111.
Step Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 68
M
Odd Header
Working with JMS Triggers
Step Description
3 Integration Server receives the same message from the JMS provider and
processes the message.
Because Integration Server receives the message almost immediately after
transaction roll back, it is likely that the temporary condition that caused the
ISRuntimeException has not resolved and the trigger service will end with a
transient error again. Consequently, seing On transaction rollback to Recover
only could result in wasted processing.
Step Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 69
M
Even Header
Working with JMS Triggers
Step Description
5 If the resource monitoring service indicates that the resources are available
(that is, the value of isAvailable is true), Integration Server enables the
trigger. Message processing and message retrieval resume for the JMS
trigger.
If the resource monitoring service indicates that the resources are not
available (that is, the value of isAvailable is false), Integration Server waits
a short time interval (by default, 60 seconds) and then re-executes the
resource monitoring service. Integration Server continues executing the
resource monitoring service periodically until the service indicates the
resources are available.
6 After Integration Server resumes the JMS trigger, Integration Server receives
the message from the JMS provider and processes the message.
Note: If the maximum delivery count has been met, the JMS provider will
not deliver the message to the JMS trigger. The maximum delivery
count determines the maximum number of time the JMS provider
can deliver the message to the JMS trigger. It is controlled by the
wa.server.jms.trigger.maxDeliveryCount property.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 70
M
Odd Header
Working with JMS Triggers
For more information about transient error handling for trigger preprocessing, see
“Transient Error Handling During Trigger Preprocessing” on page 111.
Use the following procedure to configure how Integration Server responds when a
transaction is rolled back due to a transient error that occurs during processing of a
transacted JMS trigger.
Select... To...
Recover only Specify that Integration Server recovers the message after a
transaction is rolled back due to a transient error.
This is the default.
Suspend and Specify that Integration Server does the following after a
recover transaction is rolled back due to a transient error:
Suspends the JMS trigger
Recovers the message after a resource monitoring service
indicates that the resources needed by the trigger service are
available.
3. If you selected Suspend and recover, in the Resource monitoring service property, specify
the service that Integration Server should execute to determine the availability of
resources associated with the trigger service or web service operation. Multiple
triggers can use the same resource monitoring service.
4. Click File > Save.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 71
M
Even Header
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 72
M
Odd Header
Sending and Receiving JMS Messages
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 73
M
Even Header
Sending and Receiving JMS Messages
Service Description
pub.jms:sendAnd Wait Sends a request in the form of a JMS message to the JMS
provider and, optionally, waits for a reply.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 74
M
Odd Header
Sending and Receiving JMS Messages
Note: If you want to send multiple JMS messages to the same destination, use
pub.jms:sendBatch. For more information about the pub.jms:sendBatch services,
see the webMethods Integration Server Built-In Services Reference.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 75
M
Even Header
Sending and Receiving JMS Messages
The JMS connection alias indicates how Integration Server connects to the JMS
provider. The alias also specifies whether the alias uses a client side queue and if
Integration Server will retry the pub.jms:send service automatically if the service fails
because of a transient error.
Name Description
connectionAliasName Name of the JMS connection alias that you want to use
to send the message.
Name Description
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 76
M
Odd Header
Sending and Receiving JMS Messages
Name Description
If you created a javax.jms.Message and you set the message header fields using the
javax.jms.Message seer methods, you do not need to provide inputs to the fields
in JMSMessage/header . If you do set message header fields using both approaches,
Integration Server uses the values provided as input to the pub.jms:send service.
7. Set values for the Integration Server-specific properties.
The properties fields are optional fields added to the message header and are
often used to hold message selector values. Integration Server adds the following
properties to JMS messages it sends. You can set these values as follows.
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 77
M
Even Header
Sending and Receiving JMS Messages
If you created a javax.jms.Message and you set the message property fields using the
javax.jms.Message seer methods, you do not need to provide inputs to the fields in
JMSMessage/properties . If you do set message property fields using both approaches,
Integration Server uses the values provided as input to the pub.jms:send service.
For information about seing the JMS_WMClusterNodes property, see “Overriding
the Cluster Policy when Sending JMS Messages” on page 129.
8. Add any custom properties to the JMS message.
string Used a field of type String for the message body content.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 78
M
Odd Header
Sending and Receiving JMS Messages
executes. If you want to use the client side queue with this implementation of the
pub.jms:send service, the JMS connection alias specified for connectionAliasName must
be configured to have a client side queue. A JMS connection alias has a client side
queue if the Maximum CSQ Size property for the alias is set to a value other than 0
(zero).
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 79
M
Even Header
Sending and Receiving JMS Messages
the requesting flow service must invoke the pub.jms:waitForReply service. If the timeout
elapses before the pub.jms:waitForReply service receives a reply, the pub.jms:waitForReply
service returns a null document indicating that the request timed out.
A service that contains multiple asynchronous send and wait invocations allows the
service to send all the requests before collecting the replies. This approach can be more
efficient than sending a request, waiting for a reply, and then sending the next request.
Name Description
connectionAliasName Name of the JMS connection alias that you want to use to
send the message.
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 80
M
Odd Header
Sending and Receiving JMS Messages
Name Description
webMethods API to connect directly to the
webMethods Broker.
6. Specify the destination to which message recipients should send the reply message.
(Optional)
If you do not specify a destination for reply messages, Integration Server uses a
temporaryQueue to receive the reply. A temporaryQueue is a queue object created for
the duration of a particular connection.
When using pub.jms:sendAndWait to issue a request/reply, you must specify a queue
as the value of the destinationNameReplyTo parameter. In a request/reply scenario,
it is possible that the message consumer created to receive the reply might be
created after the reply message is sent. (In a synchronous request/reply, the
pub.jms:sendAndWait service creates the message consumer. In an asynchronous
request/reply, the pub.jms:waitForReply service or a custom solution, such as a JMS
trigger, creates the message consumer.) If the reply destination is a queue, a message
consumer can receive messages published to the queue regardless of whether
the message consumer was active at the time the message was published. If the
destination is a topic, a message consumer can receive only messages published
when the message consumer was active. If the reply is sent to a topic before the
message consumer is created, the message consumer will not receive the reply.
Consequently, when creating a request/reply, the destinationNameReplyTo parameter
should specify the name or lookup name of a queue.
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 81
M
Even Header
Sending and Receiving JMS Messages
The timeout indicates how long Integration Server waits for a reply message. The
timeout parameter only applies to synchronous send and wait requests.
Name Description
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 82
M
Odd Header
Sending and Receiving JMS Messages
If the client side queue is in use, the reply destination must be a queue that is not
temporary. Consequently, if useCSQ is set to true, values must be specified for the
destinationNameReplyTo and destinationTypeReplyTo input parameters.
Name Description
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 83
M
Even Header
Sending and Receiving JMS Messages
Name Description
Note: If the pub.jms:sendAndWait service executes and the message is sent directly
to the JMS provider (i.e., it is not sent to the client side queue), the
JMSMessage\header\JMSMessageID contains a unique identifier assigned
by the JMS provider. If the JMSMessageID field is null, after the service
executes, the JMS provider was not available at the time the service
executed. Integration Server wrote the message to the client side queue.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 84
M
Odd Header
Sending and Receiving JMS Messages
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 85
M
Even Header
Sending and Receiving JMS Messages
1. Follow the steps for sending a JMS message as described in “How to Send a JMS
Message” on page 74.
2. When seing the values for the header fields in the JMS message, specify one of the
following for the replyTo field.
If the JMS connection alias used by the pub.jms:send service connects to the JMS
provider using JNDI, set replyTo to be the lookup name of the destination lookup
object name.
If the JMS connection alias used by the pub.jms:send service connects to the JMS
provider using a native Broker connection, set JMSMessage/header/replyTo
to the Broker queue name. That is, if the JMS connection alias specifies the
webMethods Broker as the JMS provider and uses the native webMethods API to
connect directly to the Broker, specify the name of the queue on the Broker that
should receive replies to the message.
Note: When using the native webMethods API to connect to the Broker, the
JMSMessage/header/replyTo destination must be a queue. Topics are not
supported.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 86
M
Odd Header
Sending and Receiving JMS Messages
If the sender of the request message did not specify a uuid , the replying Integration
Server uses the JMSMessageID from the request message as the JMSCorrelationID of
the reply message.
The pub.jms:reply service sends the reply message using the same connection that was
used to retrieve the message.
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 87
M
Even Header
Sending and Receiving JMS Messages
Name Description
b. Specify the destination from which you want to receive the message.
Specify the messages that you want the consumer to receive by selecting a
destination and by creating a message selector. A message selector is a filter that
the JMS provider evaluates. If a message does not meet the criteria specified in
the filter, the consumer does not receive the message. Use a message selector to
receive a subset of messages from a destination.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 88
M
Odd Header
Sending and Receiving JMS Messages
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 89
M
Even Header
Sending and Receiving JMS Messages
Name Description
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 90
M
Odd Header
Sending and Receiving JMS Messages
Name Description
3. Invoke pub.jms:receive.
This service uses the consumer created by the pub.jms:createConsumer service to receive
messages from the specified destination.
In the Pipeline view, make sure the consumer created by the pub.jms:createConsumer
service is linked to the pub.jms:receive service input parameter consumer . Designer
should link these automatically.
Specify how long the consumer should wait to receive a message from the JMS
provider.
Name Description
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 91
M
Even Header
Sending and Receiving JMS Messages
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 92
M
Odd Header
Sending and Receiving JMS Messages
Keep the following points in mind when building services that send or receive JMS
messages within a transaction:
To send or receive JMS messages within a transaction, you must install and enable
the WmART package. (This is true even if you intend to use Integration Server to
manage all transactions implicitly.)
To use pub.jms:send or pub.jms:sendAndWait within a transaction, the client side queue
cannot be used (the useCSQ parameter must be set to false).
To use pub.jms:sendAndWait within a transaction, the request/reply must be
asynchronous (the async parameter must be set to true). If async is set to false,
Integration Server throws a JMSSubsystemException when the service executes.
If you do not specifically invoke pub.art.transaction:commitTransaction or
pub.art.transaction:rollbackTransaction, Integration Server implicitly commits the
transaction when the services within the transaction are successful. Integration
Server implicitly rolls back the transaction when one of the services within the
transaction fails with any type of exception.
Name Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 93
M
Even Header
Sending and Receiving JMS Messages
This service takes the JMS message you created and sends it to the JMS provider.
5. Specify the JMS connection alias.
The JMS connection alias indicates how Integration Server connects to the JMS
provider.
Name Description
connectionAliasName Name of the JMS connection alias that you want to use to
send the message.
The specified JMS connection alias must have a
transaction type of LOCAL_TRANSACTION or
XA_TRANSACTION, depending on the kind of
transaction.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 94
M
Odd Header
Sending and Receiving JMS Messages
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 95
M
Even Header
Sending and Receiving JMS Messages
The JMS message originated in a back-end system that assigned a unique identifier
to the message data. You can map the value assigned by the system to the
JMSMessage/properties/uuid field. A JMS trigger that receives the message can use the
assigned UUID to filter out duplicate messages from a back-end system.
A JMS message is part of a request/reply. If you specify the uuid when sending the
request, the replying Integration Server will use the uuid as the JMSCorrelationID
of the reply message. If you do not specify a uuid , the replying Integration Server
uses the JMSMessageID of the request message as the JMSCorrelationID of the reply
message.
The maximum length of a UUID is 96 characters. Integration Server does not assign a
UUID automatically.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 96
M
Odd Header
Exactly-Once Processing for JMS Triggers
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 97
M
Even Header
Exactly-Once Processing for JMS Triggers
Note: Exactly-once processing typically only provides value for JMS triggers that
receive messages from queues or JMS triggers that receive messages from
topics using durable subscribers.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 98
M
Odd Header
Exactly-Once Processing for JMS Triggers
Document history database maintains a record of all persistent message IDs processed
by JMS triggers that have an acknowledgment mode of CLIENT_ACKNOWLEDGE and
for which exactly-once processing is configured.
Document resolver service is a service created by a user to determine the message
status. The document resolver service can be used instead of or in addition to the
document history database.
The steps that Integration Server takes to determine a message’s status depend on the
exactly-once properties configured for the JMS trigger. For more information about
configuring exactly-once properties, see webMethods Service Development Help.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 99
M
Even Header
Exactly-Once Processing for JMS Triggers
UUID or Action
JMSMessageID
Exists?
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 100
M
Odd Header
Exactly-Once Processing for JMS Triggers
Notes:
When a transacted JMS trigger fails because of a transient error and the document
history database is configured and enabled, Integration Server considers the message
to be New the next time it is received.
When a transacted JMS trigger fails because of a fatal error and the document history
database is configured and enabled, Integration Server rejects the message the next
time it is received and generates a JMS retrieval failure event.
When a transacted JMS trigger fails because of a fatal or transient error and the
document history database is neither configured nor enabled, Integration Server
does not send a JMS retrieval failure event the next time the message is received.
Integration Server sends a JMS retrieval failure event if the maximum delivery count
is eventually reached.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 101
M
Even Header
Exactly-Once Processing for JMS Triggers
The following table identifies the possible delivery count values and the message status
associated with each value.
1 This is the first time the JMS trigger received the message.
If the JMS trigger uses a document history to perform
duplicate detection, Integration Server checks the document
history database to determine the message status. If no other
methods of duplicate detection are configured, Integration
Server assigns the message a status of New and executes the
trigger service.
>1 The JMS provider has delivered the message more than
once. The trigger might or might not have processed the
message before. The delivery count does not provide enough
information to determine whether the trigger processed the
message before.
If other methods of duplicate detection are configured
for this trigger (document history database or document
resolver service), Integration Server uses these methods
to determine the message status. If no other methods of
duplicate detection are configured, Integration Server assigns
the message a status of In Doubt and acknowledges the
message.
Integration Server uses delivery count to determine message status whenever you enable
exactly-once processing for a JMS trigger. That is, seing the Detect duplicates property to
true indicates delivery count will be used as part of duplicate detection.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 102
M
Odd Header
Exactly-Once Processing for JMS Triggers
Does not exist Assigns the message a status of New and executes
the trigger service. The absence of the UUID
(JMSMessageID ) indicates that the trigger has not
processed the message before.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 103
M
Even Header
Exactly-Once Processing for JMS Triggers
Note: Integration Server also considers a message to be In Doubt when the value of
the message’s UUID (or JMSMessageID ) exceeds 96 characters. If specified,
Integration Server executes the document resolver service to determine the
message’s status. Otherwise, the Integration Server logs the message as In
Doubt.
If you want to use document history to ensure exactly-once processing for some or all
of your JMS triggers, you or the server administrator must create the Document History
database component and connect it to a JDBC connection pool. For information about
configuring the document history database, refer to Installing Software AG Products.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 104
M
Odd Header
Exactly-Once Processing for JMS Triggers
You can also use Integration Server Administrator to clear expired document history
entries from the database immediately.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 105
M
Even Header
Exactly-Once Processing for JMS Triggers
exists where checking the delivery count and the message history database might not
conclusively determine whether a trigger processed a message before. For example:
If a duplicate message arrives before the trigger finishes processing the original
message, the document history database does not yet contain an entry that indicates
processing completed. Integration Server assigns the second message a status of In
Doubt. Typically, this is only an issue for long-running trigger services.
If Integration Server fails before completing message processing, the JMS provider
redelivers the message. However, the document history database contains only
an entry that indicates message processing started. Integration Server assigns the
redelivered message a status of In Doubt.
You can write a document resolver service to determine the status of messages received
during these windows. How the document resolver service determines the message
status is up to the developer of the service. Ideally, the writer of the document resolver
service understands the semantics of all the applications involved and can use the
message to determine the message status conclusively. If processing an earlier copy of
the message left some application resources in an indeterminate state, the document
resolver service can also issue compensating transactions.
If provided, the document resolver service is the final method of duplicate detection.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 106
M
Odd Header
Exactly-Once Processing for JMS Triggers
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 107
M
Even Header
Exactly-Once Processing for JMS Triggers
might reap the entries from the document history database before one of the other
Integration Servers in the cluster does.
If the Integration Server with the faster clock removes the entries before 15 minutes
have elapsed and a duplicate of the message arrives, the Integration Servers in the
cluster will treat the message as a new message.
Note: Time drift occurs when the computers that host the clustered servers
gradually develop different date/time values. Even if the administrator
synchronizes the computer date/time when configuring the cluster, the
time maintained by each computer can gradually differ as time passes. To
alleviate time drift, synchronize the cluster node times regularly.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 108
M
Odd Header
Exactly-Once Processing for JMS Triggers
JDBC pool, traverse the network, and query the database to determine whether the
trigger processed the message.
If querying the document history database is inconclusive or if the server does not
maintain a document history for the trigger, invocation of the document resolver service
will also consume resources, including a server thread and memory.
The more duplicate detection methods that are configured for a trigger, the higher the
quality of service. However, each duplicate detection method can lead to a decrease in
performance.
If a trigger does not need exactly-once processing (for example, the trigger service
simply requests or retrieves data), consider leaving exactly-once processing disabled
for the trigger. However, if you want to ensure exactly-once processing, you must use a
document history database or implement a custom solution using the document resolver
service.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 109
M
Even Header
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 110
M
Odd Header
Transient Error Handling During Trigger Preprocessing
■ Server and Trigger Properties that Affect Transient Error Handling During Trigger
Preprocessing ................................................................................................................................... 112
■ Overview of Transient Error Handling During Trigger Preprocessing ........................................ 113
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 111
M
Even Header
Transient Error Handling During Trigger Preprocessing
Trigger preprocessing encompasses the time from when a trigger first receives a
message (document) from its local queue on Integration Server to the time Integration
Server invokes the trigger service. Transient errors can occur during this time. A
transient error is an error that arises from a temporary condition that might be resolved
or corrected quickly, such as the unavailability of a resource due to network issues or
failure to connect to a database. For example, if a document history database is used for
exactly-once processing, the unavailability of the database may cause a transient error.
Because the condition that caused the trigger preprocessing to fail is temporary, the
trigger preprocessing might complete successfully if Integration Server waits and then
re-aempts trigger preprocessing. To allow the preprocessing to complete successfully,
Integration Server provides some properties and seings for transient error handling.
Note: The On Retry Failure trigger property also determines how Integration
Server handles retry failure for a trigger service.
The On Transaction Rollback property for a transacted JMS trigger. When set to
Suspend and recover, Integration Server suspends a transected JMS trigger that
encounters a transient error during trigger preprocessing.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 112
M
Odd Header
Transient Error Handling During Trigger Preprocessing
For a detailed explanation about how Integration Server uses these property seings
when a transient error occurs during trigger preprocessing, see “Overview of Transient
Error Handling During Trigger Preprocessing” on page 113.
Step Description
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 113
M
Even Header
Transient Error Handling During Trigger Preprocessing
Step Description
provider, and uses the audit subsystem to log the document. This may
result in message loss.
3 Integration Server does one of the following once the trigger is suspended:
If the transient error (ISRuntimeException) is caused by a SQLException
(which indicates that an error occurred while reading to or writing from
the database), Integration Server suspends the trigger and schedules
a system task that executes an internal service that monitors the
connection to the document history database. Integration Server resumes
the trigger and re-executes it when the internal service indicates that the
connection to the document history database is available.
If the transient error (ISRuntimeException) is caused by a
ConnectionException (which indicates that document history
database is not enabled or is not properly configured), and the
wa.server.trigger.preprocess.monitorDatabaseOnConnectionException
property is set to true, Integration Server schedules a system task
that executes an internal service that monitors the connection to the
document history database. Integration Server resumes the trigger and
re-executes it when the internal service indicates that the connection to
the document history database is available.
If the transient error (ISRuntimeException)
is caused by a ConnectionException and the
wa.server.trigger.preprocess.monitorDatabaseOnConnectionException
property is set to false, Integration Server does not schedule a system
task to check for the database's availability and will not resume the
trigger automatically. You must manually resume the trigger after
configuring the document history database properly.
If the transient error (ISRuntimeException) is caused by some other type
of exception, Integration Server suspends the trigger and schedules a
system task to execute the trigger's resource monitoring service (if one
is specified). When the resource monitoring service indicates that the
resources used by the trigger are available, Integration Server resumes
the trigger and again receives the message from the messaging provider.
If a resource monitoring service is not specified, you will need to resume
the trigger manually (via Integration Server Administrator or the
pub.trigger* services).
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 114
M
Odd Header
Consuming JMS Messages Concurrently in a Load-Balanced Fashion
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 115
M
Even Header
Consuming JMS Messages Concurrently in a Load-Balanced Fashion
Introduction
You may want to your JMS triggers to consume messages from a destination in a
load-balanced fashion. To load balance message consumption, you can use multiple
consumers on one or more Integration Servers to retrieve and process messages
concurrently.
Within Integration Server, the ability to receive messages from a destination in a load-
balanced fashion is important in two situations:
Concurrent JMS triggers
When a concurrent JMS trigger receives messages from the JMS provider, it creates
multiple consumers. Each consumer receives a message from the JMS provider,
processes the message, and acknowledges the message to the JMS provider. Each
consumer needs to consume a message from the same destination but not process
any duplicate messages.
A cluster of Integration Servers
The same JMS trigger, running on multiple Integration Servers, needs to consume
messages from the same destination without processing any duplicate messages.
The Java Message Service standard does not supply semantics for consuming messages
from a destination in a load-balanced fashion. However, it does state that a client can
have multiple sessions in which each session is an independent consumer and producer
of messages. Regarding the type of destination used by each messaging style, the Java
Message Service standard makes the following provisions:
Queues (point-to-point messaging). While the Java Message Service standard does not
supply the semantics for multiple consumers receiving messages concurrently, it
does not prohibit a JMS provider from supporting it. Most JMS providers support
load balancing of messages from a queue across multiple consumers. However,
review your JMS provider’s documentation to determine how to consume messages
from a queue concurrently. For information about using the webMethods Broker
to consume messages from a queue concurrently, see “Consuming JMS Messages
Concurrently from the webMethods Broker ” on page 117.
Topics (publish-subscribe messaging). The Java Message Service standard specifies that
each subscriber to the same topic receives each message. The standard does not
provide semantics regarding how to concurrently consume messages published to
a topic in a load-balanced fashion. Some JMS providers work around this limitation
by offering a proprietary extension to the JMS API. Review your JMS provider’s
documentation to determine how to consume messages from a topic concurrently.
For information about how to configure JMS triggers and the webMethods Broker
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 116
M
Odd Header
Consuming JMS Messages Concurrently in a Load-Balanced Fashion
Note: Non-durable subscribers (i.e., JMS triggers that subscribe to topics but
do not specify a durable subscriber) cannot receive messages in a load-
balanced fashion. A JMS trigger using a non-durable subscriber will
process duplicates. Therefore, make sure to set Max execution threads to
1 when seing message processing properties for a JMS trigger that
specifies a non-durable subscriber. This behavior may vary with other JMS
providers. For more information about configuring message processing,
see webMethods Service Development Help.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 117
M
Even Header
Consuming JMS Messages Concurrently in a Load-Balanced Fashion
sharing for a queue or durable subscriber, use the Broker user interface in My
webMethods. You can also configure state sharing as part of creating the destination
or durable subscriber in Designer. For more information about configuring queues
and durable subscribers, see Administering webMethods Broker.
If the JMS trigger specifies a JMS connection alias that is configured to manage
destinations on the webMethods Broker, Integration Server and Designer can
configure state sharing for the durable subscriber automatically.
The JMS connection alias must be configured identically on all of the Integration
Servers across which you are load-balancing message consumption.
Important: If the JMS connection alias is not configured to manage destinations, you
must use the Broker interface in My webMethods to manage the destinations
and durable subscribers used with JMS triggers.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 118
M
Odd Header
Consuming JMS Messages Concurrently in a Load-Balanced Fashion
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 119
M
Even Header
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 120
M
Odd Header
Using JMS Trigger Groups
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 121
M
Even Header
Using JMS Trigger Groups
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 122
M
Odd Header
Using JMS Trigger Groups
Universal Messaging provides a JMS connection factory that can be used to send
messages to multiple Universal Messaging servers in a round-robin fashion. Using
round-robin to distribute the messages across Universal Messaging servers helps
to balance the messaging load and can improve message throughput. However, the
connection factory for Universal Messaging JMS Round Robin Publishing works with
message producers only. Message consumers, such as JMS triggers, cannot consume
messages in a round-robin fashion using the round-robin connection factory. On
Integration Server, you can work around this limitation by creating:
A JMS connection alias for each server in the Universal Messaging cluster.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 123
M
Even Header
Using JMS Trigger Groups
A JMS trigger for each destination (queue or topic) on a server in the Universal
Messaging cluster using one of the JMS connection aliases. Repeat this for each JMS
connection alias. That is, create JMS trigger for each Universal Messaging server and
destination combination.
For example, consider a Universal Messaging cluster that consists of 3 servers
with 50 queues on each server. On Integration Server, you would create 3 JMS
connection aliases (one for each server in the Universal Messaging cluster) and 150
JMS triggers (50 destinations multiplied by 3 servers in the Universal Messaging
cluster). This can be time consuming and error prone. Additionally it does not
scale. Supposed you add another server to the Universal Messaging cluster. On
Integration Server you need to add one more JMS connection alias and 50 more JMS
triggers. To facilitate the quick addition of new JMS triggers, use the methods in the
com.wm.app.b2b.server.jms.consumer.JMSTriggerGroupFacade class to create a
new JMS trigger by copying an existing JMS trigger. You can specify a different JMS
connection alias for use with the new trigger. You can copy a specific trigger, all the JMS
triggers in a particular package, all the JMS triggers that use a particular JMS connection
alias.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 124
M
Odd Header
Working with Cluster Policies
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 125
M
Even Header
Working with Cluster Policies
Introduction
When using the webMethods Broker as a JMS provider, Integration Server can send and
receive JMS messages in accordance with a cluster policy. The cluster policy, which is
applied to the cluster connection factory used by a JMS connection alias, determines
the Broker to which the message is sent. Integration Server automatically handles
sending and receiving JMS messages using the cluster connection factory. However,
the multisend guaranteed and multisend best effort cluster policies have specific
requirements for the JMS client sending the message. The following sections provide
more information about how Integration Server acts as the JMS client for these policies
and explain how to override a cluster policy when sending a JMS message.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 126
M
Odd Header
Working with Cluster Policies
Note: When sending a JMS message as part of a transaction, client side queuing
cannot be used. The useCSQ input parameter for the pub.jms:send and
pub.jms:sendAndWait services must be set to false when sending JMS messages
in a transaction. If the useCSQ input parameter is set to true and the sending
service executes within an explicit or implicit transaction, Integration Server
throws a ServiceException.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 127
M
Even Header
Working with Cluster Policies
Integration Server will retry up to two times to send the message using different
combinations of Brokers. If the minimum number of Brokers is not available after the
final retry aempt, Integration Server throws an ISRuntimeException.
If a fatal error occurs while Integration Server is sending messages to multiple
Brokers, Integration Server throws a ServiceException and the sending service fails.
For example, an invalid destination lookup name or invalid connection factory name
results in a ServiceException and thus a fatal error.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 128
M
Odd Header
Working with Cluster Policies
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 129
M
Even Header
Working with Cluster Policies
Note: When overriding the policy for a series of JMS messages, the messages do not
need to be sent within the same flow service. Information about the Broker
that received the initial message needs to be captured after the initial message
is sent and then used when sending subsequent messages. This can be done
across multiple services as long as each sending service uses the same cluster
connection factory. For the sake of simplicity, the following steps explain how
to send the messages in a single flow service.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 130
M
Odd Header
Working with Cluster Policies
1. Create the flow service that will send the JMS messages.
2. Insert a service to send the first JMS message.
Send the JMS message by invoking the pub.jms:send or pub.jms:sendAndWait service. For
more information about sending JMS messages, see “Sending and Receiving JMS
Messages” on page 73.
If you use the pub.jms:sendAndWait service to perform an asynchronous request-reply,
you also need to invoke pub.jms:waitForReply to retrieve the reply message.
3. In the pipeline, add a new String variable to Pipeline Out.
4. Map the value of the JMS_WMClusterNodes output parameter to a new String
variable in the pipeline.
If you sent the message using... Then map this to the new String...
Notes:
Make sure to code the service to handle any ISRuntimeExceptions thrown as a
result of a Broker Server exception for invalid data or as the result of unavailable
Brokers. For more information, see “Exceptions when Overriding Cluster Policies”
on page 132.
When overriding a multisend guaranteed policy and using a connection transaction
type of NO_TRANSACTION, if one of the Brokers is not available while Integration
Server is sending the message, Integration Server does not retry sending the message
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 131
M
Even Header
Working with Cluster Policies
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 132
M
Odd Header
Building a Resource Monitoring Service
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 133
M
Even Header
Building a Resource Monitoring Service
Service Requirements
A resource monitoring service must do the following:
Use the pub.trigger:resourceMonitoringSpec as the service signature.
Check the availability of the resources used by the document resolver service and
all the trigger services associated with a trigger. Keep in mind that each condition in
a trigger can be associated with a different trigger service. However, you can only
specify one resource monitoring service per trigger.
Return a value of “true” or “false” for the isAvailable output parameter. The author
of the resource monitoring service determines what criteria makes a resource
available.
Catch and handle any exceptions that might occur. If the resource monitoring service
ends because of an exception, Integration Server logs the exception and continues
as if the resource monitoring service returned a value of “false” for the isAvailable
output parameter.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 134
M
Odd Header
Building a Document Resolver Service
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 135
M
Even Header
Building a Document Resolver Service
Service Requirements
The document resolver service must do the following:
Use pub.jms:documentResolverSpec as the service signature if the service is for a JMS
trigger. Use pub.publish:documentResolverSpec as the service signature if the service is for
a webMethods messaging trigger. Integration Server passes the document resolver
service values for each of the variables declared in the input signature. Integration
Server passes the document resolver service values for each of the variables declared
in the input signature.
Return a status of NEW, DUPLICATE, or IN_DOUBT. Integration Server uses the
status to determine whether or not to process the message.
Catch and handle any exceptions that might occur, including an
ISRuntimeException. For information about how Integration Server proceeds with
duplicate detection when an exception occurs, see “Document Resolver Service for a
JMS Trigger” on page 105 and “Document Resolver Service and Exceptions for a JMS
Trigger” on page 106.
Determine how far message processing progressed. If necessary, the document
resolver service can issue compensating transactions to reverse the effects of a
partially completed transaction.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 136
M
Odd Header
Transaction Management
C Transaction Management
■ Transaction Management Overview .......................................................................................... 138
■ Built-In Transaction Management Services ............................................................................... 141
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 137
M
Even Header
Transaction Management
Transactions
Integration Server considers a transaction to be one or more interactions with one or
more resources that are treated as a single logical unit of work. The interactions within
a transaction are either all commied or all rolled back. For example, if a transaction
includes multiple database inserts, and one or more inserts fail, all inserts are rolled
back.
Transaction Types
Integration Server supports the following kinds of transactions:
A local transaction (LOCAL_TRANSACTION), which is a transaction to a resource’s
local transaction mechanism
An XAResource transaction (XA_TRANSACTION), which is a transaction to a
resource’s XAResource transaction mechanism
Integration Server can automatically manage both kinds of transactions without
requiring the user to do anything. For more information about implicit transactions, see
“Implicit and Explicit Transactions” on page 139.
However, in some cases, users need to explicitly control the transactional units of
work. Examples of these cases are provided in “Implicit and Explicit Transactions” on
page 139.
To support transactions, Integration Server relies on a built-in Java EE transaction
manager. The transaction manager is responsible for beginning and ending transactions,
maintaining a transaction context, enlisting newly connected resources into existing
transactions, and ensuring that local and XAResource transactions are not combined in
illegal ways.
The transaction manager only manages operations performed by adapter services, a
transacted JMS trigger, or a built-in JMS service that uses a transacted JMS connection
alias.
Important: You cannot step or trace a flow that contains a transacted adapter service or a
transacted JMS service.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 138
M
Odd Header
Transaction Management
XA Transactions
If an XA transactional connection throws an exception during a service transaction and
the exception results in an inconsistent state, you may need to resolve the transaction
using the tools provided with the database.
For information about using Integration Server to manage XA transactions, see
webMethods Integration Server Administrator’s Guide.
Implicit Transactions
With implicit transactions, Integration Server automatically manages both local and
XAResource transactions without requiring you to explicitly do anything. That is, the
Integration Server starts and completes an implicit transaction with no additional service
calls required by the user.
A transaction context, which the transaction manager uses to define a unit of work,
starts when one of the following occurs:
An adapter service is encountered during flow service execution. The connection
required by the adapter service is registered with the newly created context and used
by the adapter service. If another adapter service is encountered, the transaction
context is searched to see if the connection is already registered. If the connection
is already registered, the adapter service uses this connection. If the connection
is not registered, a new connection instance is retrieved and registered with the
transaction.
Integration Server uses a transacted JMS connection alias to receive messages
from the JMS provider for a JMS trigger. A JMS connection alias is considered to
be transacted when it has a transaction type of XA TRANSACTION or LOCAL
TRANSACTION.
A built-in JMS service that uses a transacted JMS connection alias to connect to the
JMS provider is encountered during flow service execution.
Note that if the top-level flow service invokes another flow, services in the child flow use
the same transaction context.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 139
M
Even Header
Transaction Management
When the top-level flow service completes, the transaction is completed and is either
commied or rolled back, depending on the status (success or failure) of the top-level
flow service or the JMS trigger service.
A single transaction context can contain any number of XA_TRANSACTION
connections but no more than one LOCAL_TRANSACTION connection.
For more information about designing and using flows, see webMethods Service
Development Help.
Explicit Transactions
You use explicit transactions when you need to explicitly control the transactional units
of work. To do this, you use additional services, known as built-in services, in your flow.
A transaction context starts when the pub.art.transaction:startTransaction service is executed.
The transaction context is completed when either the pub.art.transaction:commitTransaction
or pub.art.transaction:rollbackTransaction service is executed. As with implicit transactions, a
single transaction context can contain any number of XA_TRANSACTION connections
but no more than one LOCAL_TRANSACTION connection.
A new explicit transaction context can be started within a transaction context, provided
that you ensure that the transactions within the context are completed in the reverse
order they were started. That is, the last transaction to start should be the first
transaction to complete, and so on.
The following example shows a valid construct:
pub.art.transaction:startTransaction
pub.art.transaction:startTransaction
pub.art.transaction:startTransaction
pub.art.transaction:commitTransaction
pub.art.transaction:commitTransaction
pub.art.transaction:commitTransaction
Note: You can use the pub.flow:getLastError service in the SEQUENCE to retrieve the
error information when a sequence fails. For more information about using
the pub.flow:getLastError service, see webMethods Integration Server Built-In Services
Reference.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 140
M
Odd Header
Transaction Management
For more information about designing and using flows, see webMethods Service
Development Help.
Service Description
For more information about the transaction management services, including detailed
descriptions of the service signatures, see webMethods Integration Server Built-In Services
Reference.
Using webMethods Integration Server to Build a Client for JMS Version 10.4 (Innovation Release) 141