Webmethods Integration Server JMS Client Developer's Guide PDF
Webmethods Integration Server JMS Client Developer's Guide PDF
Cerebra, Glue, Infravio X‐Broker, Infravio X‐Registry, Infravio, My webMethods Server, My webMethods, webMethods Access, webMethods Administrator,
webMethods Broker, webMethods Central Configuration, webMethods Dashboard, webMethods Designer, webMethods Developer, webMethods Fabric,
webMethods Glue, webMethods Infrastructure Data Collector, webMethods Infravio X‐Broker, webMethods Infravio X‐Registry, webMethods Installer,
webMethods Integration Server, webMethods logo, webMethods Mainframe, webMethods Manager, webMethods Modeler, webMethods Monitor,
webMethods Optimize for Infrastructure, webMethods Optimize for Process, webMethods Optimize, webMethods Portal, webMethods Process Engine,
webMethods Servicenet, webMethods Task Engine, webMethods Trading Networks, webMethods Workflow, and webMethods are either registered
trademarks or trademarks of webMethods, Inc.
Acrobat, Acrobat, and Reader are registered trademarks of Adobe Systems Incorporated. Amdocs and ClarifyCRM are registered trademarks of Amdocs.
Ariba is a registered trademark of Ariba, Inc. BEA, BEA WebLogic Server, Jolt, and Tuxedo are registered trademarks, and BEA WebLogic Platform is a
trademark of BEA Systems, Inc. Action Request System, BMC Software, PATROL, and Remedy are registered trademarks of BMC Software, Inc. BroadVision
is a registered trademark of BroadVision, Inc. Chem eStandards and CIDX are trademarks of CIDX, The Chemical Industry Data Exchange. SiteMinder and
Unicenter are registered trademarks of CA, Inc. PopChart is a registered trademark of CORDA Technologies, Inc. Kenan and Arbor are registered trademarks
of Alcatel‐Lucent. Data Connection and SNAP‐IX are registered trademarks of Data Connection Corporation. D&B and D‐U‐N‐S are registered trademarks of
Dun & Bradstreet Corporation. Eclipse is a trademark of Eclipse Foundation, Inc. Entrust is a registered trademark of Entrust, Inc. papiNet is a registered
trademark of the European Union and the United States. Financial Information eXchange, F.I.X, and F.I.X Protocol are trademarks of FIX Protocol Ltd.
UCCnet and eBusinessReady are registered trademarks, and 1SYNC and Transora are trademarks of GS1 US. Hewlett‐Packard, HP, HP‐UX, OpenView, PA‐
RISC, and SNAplus2 are trademarks of Hewlett‐Packard Company. i2 is a registered trademark of i2 Technologies, Inc. AIX, AS/400, CICS, ClearCase, DB2,
Domino, IBM, Informix, Infoprint, Lotus, Lotus Notes, MQSeries, OS/390, OS/400, RACF, RS/6000, SQL/400, S/390, System/390, VTAM, and WebSphere, and
z/OS are registered trademarks; and Communications System for Windows NT, DB2 Universal Database, IMS, MVS, and SQL/DS are trademarks of IBM
Corporation. InnoDB is a trademark of Innobase Oy. Itanium is a registered trademark of Intel Corporation. Linux is a registered trademark of Linus
Torvalds. W3C is a registered trademark, and X Window System is a trademark of the Massachusetts Institute of Technology. MetaSolv is a registered
trademark of Metasolv Software, Inc. ActiveX, Microsoft, Outlook, Visual Basic, Visual SourceSafe, Windows, Windows NT, and Windows Server are
registered trademarks of Microsoft Corporation. Six Sigma is a registered trademark of Motorola, Inc. Firefox and Mozilla are registered trademarks of the
Mozilla Foundation. MySQL is a registered trademark of MySQL AB. nCipher is a trademark of nCipher Corporation Ltd. Eclipse is a trademark of Eclipse
Foundation, Inc. Entrust is a registered trademark of Entrust, Inc. papiNet is a registered trademark of the European Union and the United States. Financial
Information eXchange, F.I.X, and F.I.X Protocol are trademarks of FIX Protocol Ltd. UCCnet and eBusinessReady are registered trademarks, and 1SYNC and
Transora are trademarks of GS1 US. Hewlett‐Packard, HP, HP‐UX, OpenView, PA‐RISC, and SNAplus2 are trademarks of Hewlett‐Packard Company. i2 is a
registered trademark of i2 Technologies, Inc. AIX, AS/400, CICS, ClearCase, DB2, Domino, IBM, Informix, Infoprint, Lotus, Lotus Notes, MQSeries, OS/390,
OS/400, RACF, RS/6000, SQL/400, S/390, System/390, VTAM, and WebSphere, and z/OS are registered trademarks; and Communications System for Windows
NT, DB2 Universal Database, IMS, MVS, and SQL/DS are trademarks of IBM Corporation. InnoDB is a trademark of Innobase Oy. Itanium is a registered
trademark of Intel Corporation. Teradata is a registered trademark of NCR Corporation. Netscape is a registered trademark of Netscape Communications
Corporation. ServletExec is a registered trademark, and New Atlanta is a trademark of New Atlanta Communications, LLC. SUSE is a registered trademark
of Novell, Inc. Appia is a registered trademark and Javelin Technologies is a trademark of NYFIX, Inc. CORBA is a registered trademark of Object
Management Group, Inc. JD Edwards, OneWorld, Oracle, PeopleSoft, Siebel, and Vantive are registered trademarks; and Infranet, PeopleSoft Pure Internet
Architecture, Portal, and WorldSoftware are trademarks of Oracle Corporation. Perforce is a trademark of Perforce Software. JBoss and Red Hat are
registered trademarks of Red Hat, Inc. PIP and RosettaNet are trademarks of RosettaNet, a non‐profit organization. SAP and R/3 are registered trademarks
of SAP AG. PVCS is a registered trademark of Serena Software, Inc. SWIFT and SWIFTNet are registered trademarks of Society for Worldwide Interbank
Financial Telecommunication SCRL. SPARC and SPARCStation are registered trademarks of SPARC International, Inc. BAAN and SSA are registered
trademarks; and SSA Global is a trademark of SSA Global Technologies, Inc. EJB, Enterprise JavaBeans, Java, JavaServer, JDBC, JSP, J2EE, Solaris, Sun, and
Sun Microsystems are registered trademarks; and Java Naming and Directory Interface, JavaServer Pages, SOAP with Attachments API for Java, and SunSoft
are trademarks of Sun Microsystems, Inc. Sybase is a registered trademark of Sybase, Inc. VERITAS is a registered trademark, and VERITAS Cluster Server is
a trademark of Symantec Corporation. UNIX is a registered trademark of The Open Group. Unicode is a trademark of Unicode, Inc. VeriSign is a registered
trademark of Verisign, Inc.
Software AG and all Software AG product names are either trademarks or registered trademarks of Software AG.
Other product and company names mentioned herein may be the trademarks of their respective owners.
Copyright © 2007 webMethods, Inc. All rights reserved.
Copyright © 2007 Software AG and/or its suppliers, Uhlandstrasse 12, 64297 Darmstadt, Germany. All rights reserved.
Contents
Message Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Message Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Message Acknowledgment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
The webMethods Integration Server JMS Client Developer’s Guide is designed for the
developer who is responsible for developing solutions that use webMethods Integration
Server to send and receive messages using Java Messaging Service (JMS).
This guide does the following:
Explains how to establish connections to one or more JMS providers.
Describes how to build a JMS trigger to use for receiving JMS messages.
Explains how to build services that send and receive JMS messages using built‐in
services.
This guide assumes that you are familiar with the following:
Basic concepts of webMethods architecture and terminology.
Usage of webMethods Developer to create elements and build services.
General knowledge of programming, the Java programming language, and the JMS
API.
Note: An in‐depth treatment of messaging architecture is beyond the scope of this guide,
but is available elsewhere. For information about the JMS API, please refer to the Java
Message Service, Version 1.1 specification on the Sun Microsystems Java Message Service
(JMS) Web site.
Note: With webMethods Developer, you can create Broker/local triggers and JMS triggers.
A Broker/local trigger is trigger that subscribes to and processes documents
published/delivered locally or to the Broker. A JMS trigger is a trigger that receives
messages from a destination (queue or topic) on a JMS provider and then processes those
messages. This guide discusses development and use of JMS triggers only. Where the term
triggers appears in this guide, it refers to JMS triggers. For information about creating
Broker/local triggers, see the Publish‐Subscribe Developer’s Guide.
Document Conventions
Convention Description
Bold Identifies elements on a screen.
Italic Identifies variable information that you must supply or change
based on your specific situation or environment. Identifies terms the
first time they are defined in text. Also identifies service input and
output variables.
Narrow font Identifies storage locations for services on the webMethods
Integration Server using the convention folder.subfolder:service.
Typewriter Identifies characters and values that you must type exactly or
font messages that the system displays on the console.
UPPERCASE Identifies keyboard keys. Keys that you must press simultaneously
are joined with the “+” symbol.
\ Directory paths use the “\” directory delimiter unless the subject is
UNIX‐specific.
[ ] Optional keywords or values are enclosed in [ ]. Do not type the [ ]
symbols in your own code.
Additional Information
The webMethods Advantage Web site at http://advantage.webmethods.com provides you
with important sources of information about webMethods products:
Troubleshooting Information. The webMethods Knowledge Base provides
troubleshooting information for many webMethods products.
Documentation Feedback. To provide feedback on webMethods documentation, go to
the Documentation Feedback Form on the webMethods Bookshelf.
Additional Documentation. Starting with 7.0, you have the option of downloading the
documentation during product installation to a single directory called
“_documentation,” located by default under the webMethods installation directory. In
addition, you can find documentation for all webMethods products on the
webMethods Bookshelf.
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Overview
To configure Integration Server for JMS messaging, you need to:
Create one or more JNDI provider aliases to specify where Integration Server can look
up administered objects when it needs create a connection to JMS provider or specify
a destination for sending or receiving messages.
Create one or more connection aliases that encapsulate the properties that Integration
Server needs to create a connection with the JMS provider.
Integration Server also includes various server configuration properties that you can use
to change the default server behavior. For a list of server configuration parameters related
to JMS, see Appendix A, “JMS Server Configuration Parameters”.
Note: If you connect directly to the webMethods JMS Provider using native webMethods
API, you do not need to use a JNDI provider. Instead, you can create Destinations directly
on the webMethods Broker. You do not need to create Connection Factories if you use the
native webMethods API.
1 Open Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Under JMS Configuration, click JNDI Settings.
4 Click Create JNDI Provider Alias.
5 Specify the following information for the JNDI provider alias:
Note: After you create a JNDI provider, Integration Server
Administrator displays Current Settings as the value of the
Predefined JNDI Templates field. This indicates that Integration
Server uses the currently specified settings for the JNDI
provider alias.
Security The credentials, or password, that Integration Server provides
Credentials to the JNDI provider, if the provider requires security
credentials to access the JNDI directory.
For information about whether or not the JNDI provider
requires security credentials, consult the product
documentation for the JNDI provider.
Other Properties Any additional properties the JNDI provider requires for
configuration. For example, you might need to specify the
classpath for any additional .jar or class files that the JNDI
provider needs to connect to the JNDI.
When you select a pre‐defined JNDI template, Integration
Server populates this field with any additional properties and
placeholder information required by the JNDI provider.
For more information about additional properties or classes
required by a JNDI provider and the location of those files, see
the product documentation for the JNDI provider.
6 Click Save Changes.
1 Open Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Under JMS Configuration, click JNDI Settings.
4 In the JNDI Provider Alias Definitions list, select the JNDI provider alias that you
want to edit. Integration Server Administrator displays details about the JNDI
provider alias.
5 Click Edit JNDI Provider Alias.
6 Edit the properties of the JNDI provider alias.
For more information about the fields, see “To create a JNDI provider alias” on
page 10.
7 Click Save Changes.
Important! When you delete a JNDI provider alias, any service or JMS trigger that uses a
JMS connection alias that relies on the JNDI provider alias will fail.
1 Open Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Under JMS Configuration, click JNDI Settings.
4 Locate the alias you want to delete and click the icon in the Delete field. Integration
Server displays a dialog box that prompts you to verify your action. Click OK to verify
that you want to delete the JNDI provider alias.
1 Open Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Under JMS Configuration, click JNDI Settings.
1 Open Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Under JMS Configuration, click JMS Settings.
4 Click Create JMS Connection Alias.
5 Set the following General Settings for the JMS connection alias:
NO_TRANSACTION Indicate that sessions that use this
JMS connection alias are not
transacted.
LOCAL_TRANSACTION Indicate that sessions that use this
JMS connection alias are part of a local
transaction.
XA_TRANSACTION Indicate that sessions that use this
JMS connection alias are part of an XA
transaction.
Connection Client The JMS client identifier associated with the connections
ID established by this JMS connection alias.
User (optional) User name needed to acquire a connection from the
connection factory.
For more information about whether or not the JMS provider
requires a user name and password to obtain a connection,
refer to the product documentation for the JMS provider.
Password Password needed to acquire a connection from the connection
(optional) factory.
For more information about whether or not the JMS provider
requires a user name and password to obtain a connection,
refer to the product documentation for the JMS provider.
a Configure the connection to the Broker Server that you want to use as the
webMethods JMS Provider for this JMS connection alias. For information about
configuring a connection to a Broker Server, see the webMethods Integration Server
Administrator’s Guide.
b In the Client Group field, specify the name of the client group to which you want
Integration Server to belong when it acts as a JMS client. The client group that you
specify must already exist on the Broker Server. The default is IS‐JMS.
c In the Broker List field, specify a comma delimited list of Broker Servers on which
the connection between the Integration Server (acting as the JMS client) and the
webMethods JMS Provider can exist. This provides connection failover. If a
connection failure occurs to the first Broker Server in the list, a connection attempt
will be made to the next Broker Server listed. Use the following format for each
Broker:
{Broker Name]@<host>[:port]
9 Under Advanced Settings, specify the following information for the JMS connection
alias:
Note: You can also specify the number of messages Integration
Server retrieves from the client side queue for delivery to the
JMS provider at one time. By default, Integration Server sends
25 messages at a time. For more information about the
watt.server.jms.csq.batchProcessingSize property, see
Appendix A, “JMS Server Configuration Parameters”.
10 Click Save Changes.
connection by changing the value of the watt.server.jms.connection.retryPeriod
property. For more information about this property, see Appendix A, “JMS Server
Configuration Parameters”. For information about modifying extended settings using
Integration Server Administrator, see the webMethods Integration Server Administrator’s
Guide.
1 Open Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Under JMS Configuration, click JMS Settings.
4 In the JMS Connection Alias Definitions list, select the JMS connection alias that you
want to edit. Integration Server Administrator displays details about the connection
alias.
5 Click Edit JMS Connection Alias.
6 Edit the properties of the connection alias. For more information about the fields, see
“To create a JNDI provider alias” on page 10. Note that the Connection Alias Name and
Create Connection Using fields cannot be modified.
7 Click Save Changes.
1 Open Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Under JMS Configuration, click JMS Settings.
4 In the JMS Connection Alias Definitions list, disable the alias if it is not already
disabled.
5 In the JMS Connection Alias Definitions list, do one of the following in the Enabled
column:
Click No if the alias is disabled and you want to enable it.
If Integration Server cannot enable the alias, it displays a message under the alias
indicating why Integration Server cannot enable the alias.
Click Yes if the alias is enabled and you want to disable it.
No services or JMS triggers rely on the JMS connection alias. If a JMS trigger uses a
JMS connection alias, Integration Server will prevent the JMS connection alias from
being deleted
1 Open Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Under JMS Configuration, click JMS Settings.
4 In the JMS Connection Alias Definitions list, disable the alias if it is not already
disabled.
5 Locate the alias you want to delete and click the icon in the Delete field. Integration
Server displays a dialog box that prompts you to verify your action. Click OK to verify
that you want to delete the JMS connection alias.
A durable subscriber must be used to receive messages from the topic.
For information about creating a JMS topic at the Broker and configuring it to be a shared
state client, see the webMethods Broker Administrator’s Guide. For more information abut
creating a wmjms.properties file to contain JMS provider‐specific properties, see the
webMethods Messaging Programmer’s Guide.
JMS Messaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Messaging Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
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. JMS is part of the Java 2 Platform,
Enterprise Edition (J2EE) suite. The JMS API provides messaging interfaces, but not the
implementations.
A JMS provider, such as the webMethods JMS Provider, is a messaging system that
implements the JMS message interfaces and provides administrative and control features.
It supports routing and delivery of messages through the implementation of the JMS API
on the client. A goal of JMS is to maximize the portability of JMS applications across
different JMS providers.
JMS clients are the programs or components, written 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.
Sending Clients
Integration Server
(Sender)
JMS Provider Receiving Client
Integration Server
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
Integration Server
Integration Server
(Publisher) JMS Trigger
(Subscriber)
JMS Provider
Integration Server
Integration Server
(Publisher) Topic JMS Trigger
(Subscriber)
Integration Server
Order Entry Program
(Publisher) JMS Trigger
(Subscriber)
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 either:
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.
Connections
Sessions
Message producers
Message consumers
Messages
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 queue (in a point‐to‐point application), or can be made
to both (generic connection), and 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 a J2EE
application server, in the context of a distributed transaction.
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. There are four types of destinations; only the first two (queues and
topics) are administered objects:
Queue. A queue object covers a provider‐specific queue name, and is how a client
specifies the identity of a queue to JMS methods.
Topic. A topic object covers a provider‐specific topic name, and is how a client
specifies the identity of a topic to JMS methods.
TemporaryQueue. 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.
TemporaryTopic. 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 once its use is no longer required.
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.
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.
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.
See the description of the Message interface in the Java Message Service, Version 1.1
specification for information about the complete set of message header fields and the
methods for setting and getting their data.
Properties (optional). Properties are used to add optional fields to the message header.
There are several types of message property fields.
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). JMS 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.
ObjectMessage. A message that contains a Serializable Java object.
BytesMessage. A message that contains a stream of uninterpreted bytes. This
message type is for literally encoding a body to match an existing message
format. In many cases, it will be possible to use one of the other, self‐defining,
message types instead.
Both StreamMessage and MapMessage support the same set of primitive data types.
Conversions from one data type to another are possible.
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. There are several message
acknowledgment constants:
Value Description
AUTO_ACKNOWLEDGE Automatically acknowledges the successful receipt of a
message.
CLIENT_ACKNOWLEDGE Acknowledges the receipt of a message when the client
calls the message’s acknowledge() method.
DUPS_OK_ACKNOWLEDGE Instructs the session to automatically, lazily
acknowledge the receipt of messages, which reduces
system overhead but may result in duplicate messages
being sent.
Service Description
pub.jms:acknowledge Sends an acknowledgment for a message to the JMS provider.
pub.jms:createConsumer Creates a message consumer to receive messages from
destinations on the JMS provider.
pub.jms:receive Synchronously receives a message from a queue or topic on
the JMS provider.
pub.jms:reply Sends a reply message to a requesting client.
pub.jms:send Sends a JMS message to the JMS provider.
pub.jms:sendAndWait Sends a request in the form of a JMS message to the JMS
provider and optionally, waits for a reply.
pub.jms:waitForReply Retrieves the reply message for an asynchronous request.
com.wm.app.b2b.server.jms.producer.ProducerFacade class, which will create a
javax.jms.Message. See:
com.wm.app.b2b.server.jms.producer.ProducerFacade.createBytesMessage(String)
com.wm.app.b2b.server.jms.producer.ProducerFacade.createMapMessage(String)
com.wm.app.b2b.server.jms.producer.ProducerFacade.createObjectMessage(String)
com.wm.app.b2b.server.jms.producer.ProducerFacade.createStreamMessage(String)
com.wm.app.b2b.server.jms.producer.ProducerFacade.createTextMessage(String)
The Java service calling this API must return an Object of type javax.jms.Message,
which can then be mapped to the JMSMessage/body/message input parameter of the
pub.jms:send service.
When creating the javax.jms.Message with the
com.wm.app.b2b.server.jms.producer.ProducerFacade, you can use the
javax.jms.Message setter methods to set the values of the message headers and
properties directly. You can also set the value of message headers and properties
using the input parameters of the pub.jms* service that you use to send the message. If
you set the message headers and properties both ways, the values provided to the
pub.jms* service take precedence.
Software AG recommends that you use a pub.jms* service to create and send the JMS
message. This may provide better performance on average. However, if you want to
send a StreamMessage or a MapMessage, you need to use the appropriate
com.wm.app.b2b.server.jms.producer.ProducerFacade API.
3 Invoke pub.jms:send. This service creates a JMS message (javax.jms.Message) based on
input provided to the service or takes an existing JMS message and sends it to the JMS
provider.
4 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.
Name Description
destinationName Name or lookup name of the Destination to which you want to
send the message.
Specify the lookup name of the Destination object when
the JMS connection alias uses JNDI to retrieve
administered objects.
Specify the provider‐specific name of the Destination
when the JMS connection alias uses the native
webMethods API to connect directly to the webMethods
JMS Provider.
destinationType Specifies whether the Destination is a queue or a topic. The
default is queue.
Name Description
deliveryMode Specifies the message delivery mode for the message. Specify
one of the following:
PERSISTENT provides once‐and‐only‐once delivery for the
message. The message will not be lost if a JMS provider
failure occurs.
NON_PERSISTENT provides at‐most‐once delivery for the
message. The message has no guarantee of being saved if a
JMS provider failure occurs.
The default is PERSISTENT
priority Specifies the message priority. JMS defines priority levels from
0 to 9, with 0 as the lowest priority and 9 as the highest.
The default is 4.
timeToLive Specifies the length of time, in milliseconds, that the JMS
provider retains the message.
The default is 0, meaning that the message does not expire.
JMSType Message type identifier for the message.
If you created a javax.jms.Message and you set the message header fields using the
javax.jms.Message setter 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.
Name Description
activation Specifies the activation ID for the message. A JMS trigger uses
the activation ID to join together messages it receives. For
more information about setting the activation, see “Assigning
an Activation to a JMS Message” on page 46.
uuid Specifies a universally unique identifier for a message. For
more information about setting a UUID, see “Setting the
UUID” on page 47.
If you created a javax.jms.Message and you set the message property fields using the
javax.jms.Message setter 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.
8 Add any custom properties to the JMS message.
To add a new property to JMSMessage/properties, click on the Pipeline tab.
Select a data type for the property and assign it a name. Make sure to place the new
property in the JMSMessage/properties field.
Assign a value to any custom properties that you add.
9 Map data to the body of the JMSMessage document. Specifically, map the field that contains
the data you want to included in the message body to the field in JMSMessage/body
with the appropriate data type.
string Used a field of type String for the message body content
bytes Used a one‐dimensional byte array for the message body
content.
object Used a Serializable Java object for the message body content.
data Used a Document (IData) for the JMS message body content.
Keep in mind that the IData message format can only be used
when sending a JMS message from one Integration Server to
another.
message Used a Java service to create an object of type
javax.jms.Message.
Name Description
useCSQ Indicates whether Integration Server places the sent message
in the client side queue if the JMS provider is not available at
the time the message is sent
True specifies that Integration Server writes messages to
the client side queue if the JMS provider is not available at
the time this service executes. When the JMS provider
becomes available, Integration Server sends messages
from the client side queue to the JMS provider.
False indicates that Integration Server throws an
ISRuntimeException if the JMS provider is not available at
the time this service executes
The default is True.
Name Description
connectionAliasName Name of the JMS connection alias that you want to use to
send the message.
Name Description
destinationName Name or lookup name of the Destination to which you want to
send the message.
Specify the lookup name of the Destination object when
the JMS connection alias uses JNDI to retrieve
administered objects.
Specify the provider‐specific name of the Destination
when the JMS connection alias uses the native
webMethods API to connect directly to the webMethods
JMS Provider.
destinationType Specifies whether the Destination is a queue or a topic. The
default is queue.
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.
If the JMS connection alias you specified in step 4 uses the native webMethods API to
create the connection directly on the webMethods JMS Provider, you need to specify
the destinationNameReplyTo as well as the destinationTypeReplyTo.
Name Description
destinationNameReplyTo Name or lookup name of the Destination to which you
want the reply message sent.
Specify the lookup name of the Destination object
when the JMS connection alias uses JNDI to retrieve
administered objects.
Specify the provider‐specific name of the
Destination when the JMS connection alias uses the
native webMethods API to connect directly to the
webMethods JMS Provider.
destinationTypeReplyTo Specifies whether the Destination is a queue or a topic.
The default is queue.
Name Description
timeout Time to wait (in milliseconds) for the response to arrive. If
no value is specified, the service does not wait at all.
Name Description
async Flag specifying whether this is an asynchronous or
synchronous request/reply.
True indicates that this is an asynchronous
request/reply. After sending the message,
Integration Server executes the next step in the flow
service immediately. The Integration Server does
not wait for a reply before continuing service
execution.
False indicates that this is a synchronous
request/reply. After sending the message,
Integration Server waits for a reply before executing
the next step in the flow service.
The default is False.
Name Description
useCSQ Indicates whether Integration Server places the sent message
in the client side queue if the JMS provider is not available at
the time the message is sent
True specifies that Integration Server writes messages to
the client side queue if the JMS provider is not available at
the time this service executes. When the JMS provider
becomes available, Integration Server sends messages
from the client side queue to the JMS provider.
False indicates that Integration Server throws an
ISRuntimeException if the JMS provider is not available at
the time this service executes
The default is True.
11 Invoke pub.jms:waitForReply. If you configured pub.jms:sendAndWait as an asynchronous
request/reply, you need to invoke the pub.jms:waitForReply service to retrieve the reply
message.
Specify the following input values for the pub.jms:waitForReply service.
Name Description
correlationID A unique identifier used to associate the reply message with
the initial request. Integration Server uses the value of the uuid
or JMSMessageID fields in the requesting JMS message to
correlate the response to the request
If you set the uuid in the JMS message request, you can
link the value of the uuid field from the JMSMessage
produced by pub.jms:sendAndWait to the correlationID.
If you did not specify a uuid, you can link the
JMSMessageID field from the JMSMessage produced by
pub.jms:sendAndWait to the correlationID.
timeout Optional. Time to wait (in milliseconds) for the reply to arrive.
If no value is specified, the service does not wait for a reply.
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.
Name Description
consumer The message consumer object used to receive the request
message from the JMS provider. Integration Server uses
information from the consumer to create a message producer
that will send the reply message.
message A javax.jms.Message object that contains the request message.
You can map the JMSMessage/body/message field in the request
message to the pub.jms:reply message input parameter. The
pub.jms:reply service uses the request message to determine the
replyTo destination.
trigger to listen for and then receive the message. You can use the pub.jms:receive service
to retrieve messages on demand from the JMS provider.
To listen for messages and receive them when they are available, create a JMS trigger that
listens to the destination. For more information about creating a JMS trigger, see
Chapter 4, “Working with JMS Triggers”
Name Description
connectionAliasName Name of the JMS connection alias that you want to use
to receive the message.
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 an filter that is evaluated by the
JMS provider. If a message does not meet the criteria specified in the filter, the
consumer does not receive the message. Use a message selector receive a subset of
messages from a destination.
Name Description
destinationName Name or lookup name of the Destination from which
you want to receive the message.
Specify the lookup name of the Destination object
when the JMS connection alias uses JNDI to
retrieve administered objects.
Specify the provider‐specific name of the
Destination when the JMS connection alias uses
the native webMethods API to connect directly to
the webMethods JMS Provider.
destinationType Specifies whether the Destination is a queue or a topic.
The default is queue.
If the JMS connection alias you specified in step 2a
uses the native webMethods API to create the
connection directly on the webMethods JMS Provider,
you need to specify the destinationName as well as the
destinationType.
messageSelector Optional Specifies a filter used to receive a subset of
messages from the specified destination.
The message selector must use the message selector
syntax specified in the Java Message Service
Specification Version 1.1
For more information about message selectors, see
“Creating a Message Selector” on page 56.
durableSubscriberName Optional. Name of the durable subscriber that you
want this service to create/use on the JMS provider. A
durable subscriber creates a durable subscription on
the JMS provider. If a durable subscriber of this name
already exists on the JMS provider, this service
resumes the previously established subscription.
Note: This parameter only applies when the
destinationType is set to TOPIC. If you select TOPIC, but
do not specify a durableSubscriberName, this service
creates a nondurable subscriber. If destinationType is set
to QUEUE, this parameter is ignored.
Use the following parameter to specify the acknowledgment mode.
Name Description
Name Description
noLocal Indicates whether the consumer ignores locally
published messages:
True indicates the consumer will not receive
locally published messages.
False indicates the consumer can receive locally
published messages
The default is False.
In the Pipeline tab, make sure the consumer created by the pub.jms:createConsumer
service is linked to the pub.jms:receive service input parameter consumer. Developer
should link these automatically.
Specify how long the consumer should wait to receive a message from the JMS
provider.
Name Description
timeout Specifies the time to wait, in milliseconds, for a message to be
received from the JMS provider.
If you specify 0 (zero), the consumer will not wait.
The default is 0 (zero).
Name Description
message A javax.jms.Message object that identifies the message for
which you want Integration Server to send an
acknowledgement to the JMS provider.
You can map the value of the JMSMessage/body/message field in
the JMS message retrieved by the pub.jms:receive service to this
field.
If you use the consumer created by the pub.jms:createConsumer service to receive multiple
messages, keep in mind that acknowledging a message automatically acknowledges
the receipt of all messages received in the same session. That is, all messages received
by the same consumer will be acknowledged when just one of the received messages is
acknowledged. Therefore, if the consumer receives multiple messages, invoke the
pub.jms:acknowledge service after processing all of the received messages.
Any message consumers created during the execution of a service will be closed
automatically when the service completes. If the consumer closes without
acknowledging messages, messages are implicitly recovered back to the JMS
provider.
A transaction is a logical unit of work, composed of many different processes and
involving one or more resources, that either entirely succeeds or has no effect at all.
Transactions can either be implicit or explicit.
In an implicit transaction, the transaction manager in Integration Server automatically
manages the transactions without requiring any additional services or input. In an explicit
transaction, you control the transactional units of work by defining the start and
completion boundaries of the transaction. The WmART package on Integration Server
provides built‐in services that you can use to start and complete transactions.
In some situations, you might use the built‐in service pub.art.transaction:startTransaction to start
a transaction explicitly, but then allow Integration Server to commit or roll back the
transaction implicitly based on the success or failure of the service.
For more information about transactions, see Appendix C, “Transaction Management”.
You can create a service that sends or receives JMS messages within an explicit
transaction. The service must do the following:
Use pub.art.transaction:startTransaction to start the transaction.
Create a connection to the JMS provider using a JMS connection alias with a
transaction type of LOCAL_TRANSACTION or XA_TRANSACTION, depending on
the kind of transaction.
Use pub.art.transaction:commitTransaction to commit the transaction.
Use pub.art.transaction:rollbackTransaction to roll back the transaction.
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, client side queuing
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:rollbakTransaction, 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
transactionName A String that specifies the name of the transaction to be
started. If this field is blank Integration Server will generate a
name for you.
If you do not use pub.art.transaction:startTransaction to start an explicit transaction,
Integration Server starts an implicit transaction when it executes a pub.jms:send service
that speechifies a transacted JMS connection alias.
4 Invoke pub.jms:send. 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.
Because a JMS trigger can receive multiple messages from the destinations, Integration
Server uses the activation value to identify the set of messages processed by an instance of
a join.
For an All (AND) join, Integration Server waits until it receives messages with the
same activation from each destination before executing the routing rule.
For an Only one (XOR) join, Integration Server executes the routing rule after it
receives a message from any destination in the join; however, the JMS trigger discards
messages with the same activation received from the other destinations for the
duration of the join time‐out.
For an Any (OR) join, Integration Server executes the routing rule when it receives
messages from any destination in the join. Integration Server does not use the
activation value when processing JMS triggers with an Any (OR) join.
When the JMS trigger receives messages with a different activation from one the
destinations, Integration Server treats it as another instance of the join.
Integration Server stores the activation in the activation field of a JMS message, specifically,
JMSMessage/properties/activation. The activation field is of type String.You assign an
activation to a message manually. Integration Server does not assign an activation
automatically.
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Introduction
A JMS trigger specifies the destinations (queues or topics) on a JMS provider from which
the JMS trigger would like to receive messages. The JMS trigger also contains routing
rules, which specify the service that Integration Server invokes to process a message
received by the JMS trigger.
Stage Description
Before a JMS trigger can be enabled, the trigger service must already exist on the same
Integration Server. Additionally, the signature for the trigger service must reference one of
the following specifications:
Use pub.jms:triggerSpec as the specification reference if the trigger service will process
one message at a time.
Use pub.jms:batchTriggerSpec as the specification reference if the trigger service will
process multiple messages at one time. That is, the trigger service will receive a batch
of messages as input and process all of those messages in a single execution. A trigger
that receives and processes a batch of messages is sometimes referred to as a batch
trigger.
For more information about batch triggers, see “Processing Messages in Batches” on
page 63.
A JMS trigger that contains an All (AND) or Only one (XOR) join can only have one
routing rule and cannot have a batch processing size (Max batch messages property)
greater than 1. A JMS trigger with an Any (Or) join can have multiple routing rules.
For more information about batch processing, see “Processing Messages in Batches”
on page 63.
To use All (AND) or Only one (XOR) joins, the ISInternal alias needs to point to an
external database. For more information about setting up an external database, see the
webMethods Installation Guide.
1 On the File menu, click New.
2 In the New dialog box, select Trigger, and click Next.
3 In the New Trigger dialog box, do the following:
a In the list next to Folder, select the folder in which you want to save the trigger.
b In the Name field, type a name for the trigger using any combination of letters,
and/or the underscore character. For a list of reserved words and symbols or
element names, see the webMethods Developer User’s Guide.
c Click Next.
d In the newTriggerName dialog box, select JMS Trigger and click Finish.
Developer generates the new trigger and displays it in the Developer window.
5 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. Developer 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, Developer
displays a message stating the JMS subsystem has not been configured. For
information abut creating a JMS connection alias, see “Working with JMS Connection
Aliases” on page 13.
6 Under JMS destinations and message selectors, click .
7 Use the following steps to specify the destinations from which the JMS trigger will
receive messages:
a In the Destination Name column, type the name or lookup name of the Destination
from which you want the JMS trigger to receive messages.
Specify the lookup name of the Destination object when the JMS connection alias
uses JNDI to retrieve administered objects. Specify the provider‐specific name of
the Destination when the JMS connection alias uses the native webMethods API
to connect directly to the webMethods JMS Provider.
b In the Destination Type column, select the type of destination:
Select... If...
Queue The destination is a queue.
This is the default.
Topic The destination is a topic.
Note: Using an Any (OR) join is similar to creating multiple
JMS triggers that listen to different destinations. While a JMS
trigger with an Any (OR) join will use fewer resources (a
single thread will poll each destination for messages), it may
cause a decrease in performance (it may take longer for one
thread to poll multiple destinations).
10 Under Message routing, click to add a new routing rule.
11 Create a routing rule by providing the following information:
a In the Name column, type a name for the routing rule. By default Developer
assigns the first rule the name “Rule 1”.
b 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.
Integration Server evaluates a local filter after it receives the message from the
JMS provider. For more information about creating a local filter, see “Creating a
Local Filter” on page 56.
12 In the Properties panel, set properties for the JMS trigger.
Enabled “Enabling or Disabling a JMS Trigger” on page 57
Acknowledgement mode “Setting an Acknowledgment Mode” on page 58
Join expires and Expire “Setting a Join Timeout” on page 59
after
Execution user “Specifying the Execution User” on page 61
Message processing “Specifying Message Processing” on page 62
Fatal error handling “Handling Fatal Errors for Non‐Transacted JMS
Triggers” on page 65
Transient error handling “Handling Transient Errors for Non‐Transacted JMS
Triggers” on page 66
Exactly once Chapter 6, “Exactly‐Once Processing for JMS Triggers”
Permissions webMethods Developer User’s Guide
13 On the File menu, click Save.
Notes:
When you select “Topic” as the destination type and specify a durable subscriber
name, Integration Server creates a a durable subscriber for the JMS trigger on the JMS
provider. A durable subscriber establishes a durable subscription with a unique identity
on the JMS provider. A durable subscription allows subscribers to receive all the
messages published on a topic, including those published while the subscriber is
inactive (for example, if the JMS trigger is disabled). When the associated JMS trigger
is disabled, the JMS provider holds the messages in nonvolatile storage. If a durable
subscription already exists for the specified durable subscriber on the JMS provider,
this service resumes the subscription.
When you select “Topic” as the destination type, but do not specify a durable
subscriber name, Integration Server creates a non‐durable subscriber for the JMS
trigger.
A non‐durable subscription allows subscribers to receive messages on their chosen
topic only if the messages are published while the subscriber is inactive. A non‐
durable subscription lasts the lifetime of its message consumer.
Integration Server uses a consumer to receive messages for a JMS trigger. This
consumer encapsulates the actual javax.jms.MessageConsumer and javax.jms.Session.
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. For more information about creating a local filter, see “Creating a Local
Filter” below.
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. For more information about batch processing,
see “Processing Messages in Batches” on page 63.
Note: You can suspend a JMS trigger using Integration Server
Administrator or the pub.triggers:suspendJMSTriggers service.
1 In the Navigation panel, open the JMS trigger that you want to enable or disable.
2 In the Properties panel, under General, set the Enabled property to one of the following:
Select... To...
True Enable a JMS trigger that is currently disabled.
False Disable a JMS trigger that is currently enabled.
3 On the File menu, click Save.
Notes:
When you disable a JMS trigger, Integration Server interrupts any server threads that
are processing messages. If the JMS trigger is currently processing messages,
Integration Server waits 3 seconds before forcing the JMS trigger to stop processing
messages. If it does not complete within 3 seconds, Integration Server stops the
message consumer used to receive messages for the JMS trigger and closes the JMS
consumer. At this point the server thread for the JMS trigger may continue to run to
completion. However, the JMS trigger will not be able to acknowledge the message
when processing completes. If the message is persistent, this can lead to duplicate
messages.
You can disable one or more JMS triggers using the pub.triggers:disableJMSTriggers
service.
You can enable one or more JMS triggers using the pub.triggers:enableJMSTriggers service.
You can enable, disable, and suspend one or more JMS triggers using Integration
Server Administrator. For more information, see “Enabling, Disabling, and
Suspending JMS Triggers” on page 106.
1 In the Navigation panel, open the JMS trigger for which you want to set the
acknowledgment mode.
2 In the Properties panel, under General, select one of the following for Acknowledgment
mode:
Select... To...
AUTO_ACKNOWLEDGE Automatically acknowledge the message when
it is received by the JMS trigger. Integration
Server will acknowledge the message before the
trigger completes processing. The JMS provider
cannot redeliver the message if Integration
Server becomes unavailable before message
processing completes.
CLIENT_ACKNOWLEDGE Acknowledge or recover the message only after
the JMS trigger processes the message
completely.
This is the default.
DUPS_OK_ACKNOWLEDGE Lazily acknowledge the delivery of messages.
This may result in the delivery of duplicate
messages.
3 On the File menu, click Save.
The implications of a join time‐out are different depending on the join type.
If Integration Server receives messages from all of the destinations specified in the join
before the time‐out period elapses, Integration Server executes the service specified in the
routing rule. If Integration Server doe not receive messages from all of the destinations
before the time‐out period elapses, Integration Server discards the messages and writes a
log entry.
When the time‐out period elapses, the next message that satisfies the All (AND) join causes
the time‐out period to start again.
1 In the Navigation panel, open the JMS trigger for which you want to set the join time‐
out.
2 In the Properties panel, under General, next to Join expires, select one of the following:
Select... To...
True Specify that Integration Server should stop waiting for messages
from other destinations in the join after the time‐out period
elapses.
In the Expire after property, specify the length of the join time‐out
period. The default join time‐out period is 1 day.
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.
3 On the File menu, click Save.
1 In the Navigation panel, open the JMS trigger that you want to enable or disable.
2 In the Properties panel, under General, in the Execution user property, type the name of
the user account whose credentials Integration Server uses to execute a service
associated with the JMS trigger. You can specify a locally defined user account or a
user account defined in a central or external directory.
3 On the File menu, click Save.
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.
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.
duplicate message, Integration Server does not include it in the message batch sent to the
trigger service.
Note: The watt.server.jms.trigger.maxDeliveryCount property determines the
maximum number of times the JMS provider can deliver a message to a JMS trigger.
Integration Server acknowledges all the messages received in a batch from the JMS
provider at one time. This includes messages that failed pre‐processing. According to the
Java Message Service, Version 1.1, 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.
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 the webMethods JMS Provider, Integration Server can
acknowledge individual messages that fail pre‐processing.
When configuring JMS trigger for batch processing, keep the following in mind:
The trigger service must be coded to handle multiple messages as input. That is, the
trigger service must use the pub.jms.batchTriggerSpec as the service signature.
When receiving a batch of messages, Integration Server evaluates the local filter in the
routing rule against the first message in the batch only.
The JMS trigger must not be part of a transaction. The JMS connection alias specified
by the trigger must have a transaction type of NO TRANSACTION.
A JMS trigger that contains an All (AND) or Only one (XOR) join cannot use batch
processing.
1 In the Navigation panel, open the JMS trigger for which you want to specify message
processing.
2 In the Properties panel, next to Processing mode, select one of the following:
Select... To...
Serial Specify that Integration Server should process messages received
by the trigger one after the other.
Concurrent Specify that Integration Server should process multiple messages
for this trigger at one time.
In the Max execution threads property, specify the maximum number
of messages that Integration Server can process concurrently.
4 On the File menu, click Save.
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 the 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.
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. For more
information about JMS retrieval failure events, see “Generating Events for JMS Retrieval
Failure” on page 72.
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 “Handling Fatal Errors for Transacted JMS Triggers” on page 80.
1 In the Navigation panel, open the JMS trigger for which you want to specify
document processing.
2 In the Properties panel, under Fatal error handling, set the Suspend on error property to
True if you want Integration Server to suspend the trigger when a trigger service ends
with an error. Otherwise, select False. The default is False.
3 On the File menu, click Save.
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.
You can configure transient error handling for a trigger to instruct Integration Server how
and when to retry the trigger service. The following sections provide more information
about configuring retry behavior for transient errors.
For information about configuring transient error handling for JMS triggers that are part
of a transaction, see Chapter 5, “Building a Transacted JMS Trigger”.
How to handle a retry failure. That is, you can specify what action Integration Server
takes if all the retry attempts are made and the trigger service still fails because of an
ISRuntimeException. For more information about handling retry failures, see
“Handling Retry Failure” on page 68.
The following sections provide more information about configuring the trigger service to
throw ISRuntimeExceptions, determining the best option for handling retry failure, and
configuring the retry properties for a trigger.
If the trigger service is written in Java, the service can use
com.wm.app.b2b.server.ISRuntimeException(). For more information about
constructing ISRuntimeExceptions in Java services, see the webMethods Integration
Server Java API Reference for the com.wm.app.b2b.server.ISRuntimeException class.
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 service
exception occurred. A service exception indicates that there is something functionally
wrong with the service. A service can throw a service exception using the EXIT step. For
more information about the EXIT step, see the webMethods Developer User’s Guide.
Step Description
1 Integration Server makes the final retry attempt and the trigger service fails
because of an ISRuntimeException.
2 Integration Server treats the last trigger service failure as a service
exception.
3 Integration Server rejects the message.
If the message is persistent, Integration Server returns an acknowledgement
to the JMS provider.
4 Integration Server generates a JMS retrieval failure event if the
watt.server.jms.trigger.raiseEventOnRetryFailure property is set
to true (the default).
5 If the JMS trigger is configured to suspend on error when a fatal error
occurs, Integration Server suspends the JMS trigger. Otherwise, Integration
Server processes the next message for the JMS trigger.
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 attempt and the trigger service fails
because of an ISRuntimeException.
2 Integration Server suspends the JMS trigger temporarily.
Note: The change to the trigger state is temporary. Message processing will
resume for the trigger if Integration Server restarts, the trigger is enabled or
disabled, or the package containing the trigger reloads. You can also enable
triggers manually using Integration Server Administrator or by invoking the
pub.trigger:enableJMSTriggers service.
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.
Step Description
4 Optionally, Integration Server schedules and executes a resource monitoring
service. A resource monitoring service is a service that you create to determine
whether the resources associated with a trigger service are available. A
resource monitoring service returns a single output parameter named
isAvailable.
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.
Tip! You can change the frequency with which the resource monitoring
service executes by modifying the value of the
watt.server.jms.trigger.monitoringInterval property.
6 After Integration Server resumes the JMS trigger, Integration Server passes
the message to the trigger. The trigger and trigger service process the
message just as they would any message received by the JMS trigger.
Note: At this point, the retry count is set to 0 (zero).
1 In the Navigation panel, open the JMS trigger for which you want to configure retry
behavior.
2 In the Properties panel, under Transient error handling, in the Max retry attempts field,
specify the maximum number of times Integration Server should attempt to
re‐execute the trigger service. The default is 0 retries (the trigger service does not
retry).
3 In the Retry interval property, specify the time period the Integration Server waits
between retry attempts. The default is 10 seconds.
4 Set the On retry failure property to one of the following:
Select... To...
Note: If you want Integration Server to automatically
enable the trigger when the trigger’s resources
become available, you must provide a resource
monitoring service that Integration Server can
execute to determine when to resume the trigger. For
more information about building a resource
monitoring service, see Appendix B, “Building a
Resource Monitoring Service”.
Notes:
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.
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 attempt. Each of these entries will have a status of “Retried” and an
error message of “Null”. However, if Integration Server makes the maximum retry
attempts 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
attempts:
[ISS.0014.0031D] Service serviceName failed with ISRuntimeException. Retry x of y will
begin in retryInterval milliseconds.
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, setting this property to 0
can improve the performance of services invoked by the trigger.
You can invoke the pub.flow:getRetryCount service within a trigger service to determine
the current number of retry attempts made by Integration Server and the maximum
number of retry attempts allowed for the trigger service. For more information about
the pub.flow:getRetryCount service, see the webMethods Integration Server Built‐In Services
Reference.
The maximum delivery count from the JMS provider has been met for the message
and the watt.server.jms.trigger.raiseEventOnRetryFailure property is set to
true (the default).
The watt.server.jms.trigger.maxDeliveryCount property specifies the
maximum number of times the JMS provider can deliver a message to Integration
Server. The default is 100. In a JMS message, the property JMSXDeliveryCount
specifies the number of times the JMS provider delivered the message. Most JMS
providers set this value.
While performing exactly‐once processing, the connection to the document history
database is unavailable, and transient error handling for the JMS trigger is configured
to Throw exception (non‐transacted JMS trigger) or Recover only (transacted JMS
trigger). In addition, the watt.server.jms.trigger.raiseEventOnRetryFailure
property is set to true (the default).
While performing exactly‐once processing, the document resolver service ends with
an ISRuntimeException, and transient error handling for the JMS trigger is configured
to Throw exception (non‐transacted JMS trigger) or Recover only (transacted JMS
trigger). In addition, the watt.server.jms.trigger.raiseEventOnRetryFailure
property is set to true (the default).
While performing exactly‐once processing, the document resolver service ends with
an exception other than an ISRuntimeException. In addition, the
watt.server.jms.trigger.raiseEventOnRetryFailure property is set to true (the
default).
A service that functions as an event handler for a JMS retrieval failure event should use
the pub.event:jmsReceiveErrorEvent specification as its service signature. For more information
about the pub.event:jmsReceiveErrorEvent specification, see the webMethods Integration Server
Built‐In Services Reference. For more information about building event handlers, see the
webMethods Developer User’s Guide.
1 Open Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Extended.
3 Click Edit Extended Settings.
4 Under Extended Settings, type the following:
watt.server.jms.debugTrace=true
5 Click Save Changes.
6 Suspend and then enable all JMS triggers.
For information about suspending and enabling all JMS triggers at one time, see
“Enabling, Disabling, and Suspending JMS Triggers” on page 106.
1 Open Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Extended.
3 Click Edit Extended Settings.
4 Under Extended Settings, type the following:
watt.server.jms.debugTrace.triggerName=true
Where triggerName is the fully qualified name of the trigger in the format
folder.subfolder:triggerName.
5 Click Save Changes.
6 Disable and then enable the trigger.
For more information about enabling and disabling JMS triggers using Developer, see
“Enabling or Disabling a JMS Trigger” on page 57. For information about enabling
and disabling JMS triggers using Integration Server Administrator, see “Enabling,
Disabling, and Suspending JMS Triggers” on page 106.
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.
Use the following general guidelines to build a JMS trigger that performs ordered service
execution.
Because the JMS provider cannot guarantee message order across destinations, the
JMS trigger must specify a single destination. That is, the JMS trigger cannot include a
join.
Each routing rule, except the last one, must contain a local filter. For example, you
might create a filter based on a custom property that the sending client adds to the
message. Integration Server uses the local filters to differentiate between the
messages. Without a local filter, only the first routing rule would ever execute.
Routing rules must appear in the order in which you want the messages to be
processed. Each routing rule must have a unique name.
Set the Processing mode property to serial to ensure that the Integration Server
processes the messages in the same order in which the JMS trigger receives them.
Serial processing ensures that the services that process the messages do not execute at
the same time.
Set Max batch messages to 1 (the default). When a trigger service processes a batch of
messages, Integration Server only applies the filter to the first message in the batch.
Important! Messages must be sent to JMS provider in the same order in which you want the
messages to be processed.
Integration Server rolls back the transaction if the trigger service fails with an
ISRuntimeException (a transient error). For detailed information about how
Integration Server handles a transient error within a transaction, see “Handling
Transient Errors for Transacted JMS Triggers” on page 82.
Integration Server rolls back the transaction if the trigger service fails with a Service
Exception (a fatal error). For detailed information about how Integration Server
handles a fatal error within a transaction, see “Handling Fatal Errors for Transacted
JMS Triggers” on page 80.
Because Integration Server handles the transaction implicitly, you do not need to use any
of the transaction management services, such as pub.art.transaction:startTransaction, in the
trigger service. However, if the trigger service includes a nested transaction, you can use
the transaction management services to explicitly manage the nested transaction.
Stage Description
1 Create a new JMS trigger on Integration Server.
2 Specify a JMS connection alias with a transaction type of XA
TRANSACTION or LOCAL TRANSACTION.
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.
4 Create routing rules and specify the services that Integration Server
invokes when the JMS trigger receives messages.
5 Set the following JMS trigger properties:
Enabled “Enabling or Disabling a JMS Trigger” on
page 57
Execution user “Specifying the Execution User” on page 61
Message processing “Specifying Message Processing” on page 62
Fatal error handling “Handling Fatal Errors for Transacted JMS
Triggers” on page 80
Transient error handling “Handling Transient Errors for Transacted JMS
Triggers” on page 82
Exactly once Chapter 6, “Exactly‐Once Processing for JMS
Triggers”
Permissions webMethods Developer User’s Guide
6 Test and debug the JMS trigger. For more information, see “Debugging a
JMS Trigger” on page 73.
Step Description
1 The trigger service for a transacted JMS trigger fails because of a Service
Exception.
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.
3 If the JMS trigger is configured to use a document history database for
exactly‐once processing, Integration Server adds an entry with a status of
“completed” for the message to the document history database.
Because Integration Server does not acknowledge the message when it is
rolled back, the JMS provider makes the message available for redelivery to
the JMS trigger. However, a message that causes a trigger service to end
because of a Service Exception typically does not process successfully upon
redelivery. Integration Server adds the “completed” entry so that the
message is treated as a duplicate when it is received from the JMS provider.
The message is rejected after it is resent.
If the JMS trigger does not use a document history database, Integration
Server continues to receive and attempt message processing until the
message processes successfully or the maximum delivery count has been
met. 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 watt.server.jms.trigger.maxDeliveryCount
property.
4 Integration Server suspends the JMS trigger.
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 the webMethods Integration Server Administrator’s Guide.)
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. For more information about
JMS retrieval failure events, see “Generating Events for JMS Retrieval Failure” on page 72.
1 In the Navigation panel, open the JMS trigger for which you want to specify
document processing.
2 In the Properties panel, under Fatal error handling, set the Suspend on error property to
True if you want Integration Server to suspend the trigger when a trigger service ends
with an error. Otherwise, select False. The default is False.
3 Configure exactly‐once processing for the JMS trigger. For more information about
configuring exactly‐once processing, see “Configuring Exactly‐Once Processing” on
page 99.
4 On the File menu, click Save.
The following sections provide an overview of how Integration Server acts in each
situation.
Step Description
1 The trigger service fails because of an ISRuntimeException.
2 Integration Server rolls back the entire transaction.
When the transaction is rolled back, Integration Server recovers the
message back to the JMS provider automatically. The JMS provider marks
the message as redelivered and increments the delivery count
(JMSXDeliveryCount field in the JMS message).
At this point, a JMS provider typically makes the message available for
immediate redelivery.
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, setting On transaction rollback to
Recover only could result in wasted processing.
Note: Integration Server enforces a maximum delivery count, which
determines the maximum number of time the JMS provider can deliver the
message to the JMS trigger. If the maximum delivery count has been met,
the JMS provider will not deliver the message to the JMS trigger. Instead,
the JMS provider will acknowledge and remove the message. The
maximum delivery count is controlled by the
watt.server.jms.trigger.maxDeliveryCount property.
Step Description
1 The trigger service fails because of an ISRuntimeException.
2 Integration Server rolls back the entire transaction.
When the transaction is rolled back, Integration Server recovers the message
back to the JMS provider automatically. The JMS provider marks the message
as redelivered and increments the delivery count (JMSXDeliveryCount field in
the JMS message).
3 Integration Server suspends the JMS trigger temporarily.
The JMS trigger is suspended on this Integration Server only. If the
Integration Server is part of a cluster, other servers in the cluster can retrieve
and process messages for the trigger.
Note: The change to the trigger state is temporary. Message processing will
resume for the trigger if Integration Server restarts, the trigger is enabled or
disabled, or the package containing the trigger reloads. You can also enable
triggers manually using Integration Server Administrator or by invoking the
pub.trigger:enableJMSTriggers service.
4 Optionally, Integration Server schedules and executes a resource monitoring
service. A resource monitoring service is a service that you create to determine
whether the resources associated with a trigger service are available. A
resource monitoring service returns a single output parameter named
isAvailable.
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.
Tip! You can change the frequency at which the resource monitoring service
executes by modifying the value of the
watt.server.jms.trigger.monitoringInterval property.
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
watt.server.jms.trigger.maxDeliveryCount property.
1 In the Navigation panel, open the trigger for which you want to configure transient
error handling.
2 In the Properties panel, under Transient error handling, in the On transaction rollback
property, select one of the following:
Select... To...
Recovers the message after a resource monitoring
service indicates that the resources needed by the
trigger service are available
For more information about the Suspend and recover option,
see “Overview of Suspend and Recover” on page 84.
The JMS trigger has an acknowledgement mode set to CLIENT_ACKNOWLEDGE.
Exactly‐once properties are configured for the JMS trigger.
When receiving persistent messages from the JMS provider, Integration Server and
the JMS provider lose connectivity before the JMS trigger processes and
acknowledges the message. The JMS trigger will receive the message again when the
connection is restored.
Integration Server uses duplicate detection to determine the message’s status. The
message status can be one of the following:
New. The message is new and has not been processed by the trigger.
Duplicate. The message is a copy of one already processed the trigger.
In Doubt. Integration Server cannot determine the status of the message. The trigger
may or may not have processed the message before.
To resolve the message status, Integration Server evaluates, in order, one or more of the
following:
Delivery count indicates how many times the JMS provider has delivered the message
to the JMS trigger.
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.
1 If using document history, Integration Server proceeds
to 2 to check the document history database.
If document history is not used, Integration Server
considers the message to be New. Integration Server
executes the trigger service.
>1 If using document history, Integration Server proceeds
to 2 to check the document history database.
If document history is not used, Integration Server
proceeds to 3 to execute the document resolver
service.
If neither document history nor a document resolver
service are used, Integration Server considers the
message to be In Doubt.
‐1 (Undefined) If using document history, Integration Server proceeds
to 2 to check the document history database.
If document history is not used, Integration Server
proceeds to 3 to execute the document resolver
service.
Otherwise, Integration Server considers the message to
be New. Integration Server executes the trigger service.
No. Message is New. Integration Server executes the trigger
service.
Yes. Integration Server checks the processing status of the
entry.
If the processing status indicates that message
processing completed, then Integration Server
considers the message to be a Duplicate. Integration
Server acknowledges the message, but does not
execute trigger service.
If the processing status indicates that processing
started but did not complete, Integration Server
considers the message to be In Doubt.
If provided, Integration Server proceeds to 3 to
invoke the document resolver service. Otherwise,
Integration Server considers the message to be In
Doubt. Integration Server acknowledges the
message, but does not execute the trigger service.
NEW Integration Server executes the trigger service and
acknowledges the message.
DUPLICATE Integration Server acknowledges the message, but does
not execute the trigger service.
IN DOUBT Integration Server acknowledges the message, but does
not execute the trigger service.
The following sections provide more information about each method of duplicate
detection.
Delivery Count
The delivery count indicates the number of times the JMS provider has delivered or
attempted to deliver a message to the JMS trigger. Most JMS providers track the message
delivery count in the JMS‐defined property JMSXDeliveryCount. The initial delivery is 1,
the second delivery is 2, and so forth. A delivery count other than 1 indicates that the
trigger might have received and processed (or partially processed) the message before.
For example, when Integration Server first retrieves a message for a JMS trigger, the
JMSXDeliveryCount count is 1 (one). If a resource (JMS provider or Integration Server)
shuts down before the trigger processes and acknowledges the message, Integration
Server will retrieve the message again when the connection is re‐established. The second
time Integration Server retrieves the message, the JMSXDeliveryCount will be 2. A delivery
count greater than 1 indicates that the JMS provider may have delivered the message to
the trigger before.
The following table identifies the possible delivery count values and the message status
associated with each value.
‐1 The JMS provider that delivered the message does not
maintain a JMSXDeliveryCount or there was an error when
retrieving the JMSXDeliveryCount. As a result, the delivery
count is undefined. Integration Server uses a value of ‐1 to
indicate that the delivery count is absent.
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 New and executes the trigger service.
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, setting the Detect duplicates property to
true indicates delivery count will be used as part of duplicate detection.
document history database. The existence or absence of the message’s UUID
(JMSMessageID) can indicate whether the message is new or a duplicate.
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.
Exists in a “processing” Assigns the message a status of Duplicate. The existence
entry and a “completed” of the “processing” and “completed” entries for the
entry. message’s UUID (JMSMessageID) indicate the trigger
processed the message successfully already. Integration
Server acknowledges the message, discards it, and writes
a journal log entry indicating that a duplicate message
was received.
Exists in a “processing” Cannot determine the status of the message conclusively.
entry only. The absence of an entry with a “completed” status for
the UUID (JMSMessageID) indicates that the trigger
service started to process the message, but did not finish.
The trigger service might still be executing or the server
might have unexpectedly shut down during service
execution.
If a document resolver service is specified for the JMS
trigger, Integration Server invokes it. If a document
resolver service is not specified, Integration Server
assigns the message a status of In Doubt, acknowledges
the message, and writes a journal log entry stating that
an In Doubt message was received.
Exists in a “completed” Determines the message is a Duplicate. The existence of
entry only. the “completed” entry indicates the JMS trigger
processed the message successfully already. Integration
Server acknowledges the message, discards it, and writes
a journal log entry indicating that a Duplicate message
was received.
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.
For information about configuring the document history database, refer to the webMethods
Installation Guide.
For more information about generating JMS retrieval events, see “Generating Events for
JMS Retrieval Failure” on page 72.
Note: The watt.server.idr.reaperInterval property determines the initial execution
frequency for the wm.server.dispatcher:deleteExpiredUUID service. After you define a JDBC
connection pool for Integration Server to use to communicate with the document history
database, change the execution interval by editing the scheduled service.
You can also use Integration Server Administrator to clear expired document history
entries from the database immediately.
1 Open Integration Server Administrator.
2 From the Settings menu in the Navigation panel, click Resources.
3 Click Exactly Once Statistics.
4 Click Remove Expired Document History Entries.
If the document resolver service incorrectly determines the status of a message to be
new (when it is, in fact, a duplicate), the server processes the message a second time.
If a client sends a message twice, and the second message is sent after Integration
Server removes the expired message UUID entries from the document history table,
Integration Server determines the second message is new and processes it. Because
the second message arrives after the first message’s entries have been removed from
the document history database, Integration Server does not detect the second message
as a duplicate.
If the time drift between the computers hosting a cluster of Integration Servers is
greater than the duplicate detection window for the trigger, one of the Integration
Servers in the cluster might process a duplicate message. (The size of the duplicate
detection window is determined by the History time to live property under Exactly Once.)
For example, suppose the duplicate detection window is 15 minutes and that the clock
on the computer hosting one Integration Server in the cluster is 20 minutes ahead of
the clocks on the computers hosting the other Integration Servers. A trigger on one of
the Integration Servers with a slower clock processes a message successfully at 10:00
GMT. The Integration Server adds two entries to the document history database. Both
entries use the same time stamp and both entries expire at 10:15 GMT. However, the
Integration Server with the faster clock is 20 minutes ahead of the others and 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.
In some circumstances Integration Server might not process a new, unique message
because duplicate detection determines the message is duplicate. For example:
If the sending client assigns two different messages the same UUID, the Integration
Server detects the second message as a duplicate and does not process it.
If the document resolver service incorrectly determines the status of a message to be
duplicate (when it is, in fact, new), Integration Server discards the message without
processing it.
Important! In the above examples, Integration Server functions correctly when determining
the message status. However, factors outside of the control of the Integration Server create
situations in which duplicate messages are processed or new messages are marked as
duplicates. The designers and developers of the solution need to make sure that clients
properly send messages, exactly‐once properties are optimally configured, and that
document resolver services correctly determine a message’s status.
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
“Extenuating Circumstances for Exactly‐Once Processing” on page 97. 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 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 setting 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 the webMethods Installation Guide.
1 In the Navigation panel, open the JMS trigger for which you want to configure
exactly‐once processing.
2 In the Properties panel, under Exactly Once, set the Detect duplicates property to True.
3 To use a document history database as part of duplicate detection, do the following:
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 100
6. Exactly-Once Processing for JMS Triggers
a Set the Use history property to True.
b In the History time to live property, specify how long the document history database
maintains an entry for a message processed by this trigger. This value determines
the length of the duplicate detection window.
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 On the File menu, click Save.
1 In the Navigation panel, open the trigger for which you want to configure exactly‐
once processing.
2 In the Properties panel, under Exactly Once, set the Detect duplicates property to False.
Developer disables the remaining exactly‐once properties.
3 On the File menu, click Save.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 101
6. Exactly-Once Processing for JMS Triggers
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.
1 Start webMethods Integration Server and open the Integration Server Administrator.
2 Under the Settings menu in the navigation area, click Resources.
3 Click Exactly-Once Statistics.
1 Start webMethods Integration Server and open the Integration Server Administrator.
2 Under the Settings menu in the navigation area, click Resources.
3 Click Exactly-Once Statistics.
4 Click Clear All Duplicate or In Doubt Document Statistics.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 102
Chapter 7. Managing JMS Triggers
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 103
7. Managing JMS Triggers
Introduction
Integration Server Administrator provides controls for managing JMS triggers and the
resources used by JMS triggers. Specifically, you can use the controls provided by
Integration Server Administrator to:
Increase or decrease the maximum number of server threads used for JMS triggers.
Change the maximum execution threads for concurrent JMS triggers.
Enable, disable, or suspend one ore more JMS triggers.
The following sections provide more information about managing JMS triggers.
1 Open the Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Click JMS Trigger Management.
Under Individual JMS Trigger Controls, in the Current Threads column, Integration Server
Administrator displays the number of server threads currently used to receive and
process messages for each JMS trigger. The Current Threads column displays Not
Connected if Integration Server is not connected to a JMS provider.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 104
7. Managing JMS Triggers
Reduce maximum execution threads by the same percentage across all concurrent
JMS triggers. This also decreases the rate at which concurrent JMS triggers process
messages.
1 Open the Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Click JMS Trigger Management.
4 Click Edit JMS Global Trigger Controls.
5 In the Thread Pool Throttle field, type the maximum percentage of the server thread
pool that can be used for JMS triggers. This includes threads used to retrieve messages
from the JMS provider and threads used to process messages. You must enter a value
greater than zero.
6 In the Individual Trigger Processing Throttle field, select the value, as a percentage of the
configured maximum execution threads value, at which you want to the server to
function. Integration Server applies this percentage to the maximum execution
threads value for all concurrent JMS triggers.
This value applies to concurrent JMS triggers only.
7 Click Save Changes.
Notes:
If the Thread Pool Throttle percentage does not evaluate to a whole number when
applied to the size of the server thread pool, Integration Server rounds up or down to
the nearest whole number.
Serial JMS triggers always process one message at a time. For a serial trigger,
Integration Server uses the same thread for receiving and processing a message. The
Individual Trigger Processing Throttle does not affect serial JMS triggers.
Concurrent JMS triggers use a pool of consumers to receive and process messages.
Each consumer will use a thread from the server thread pool to receive and process a
message. A concurrent JMS trigger dedicates an additional thread to managing the
pool of consumers. For example, a concurrent JMS trigger configured to process up to
10 messages at a time can use a maximum of 11 server threads.
If the percentage by which you reduce concurrent JMS trigger execution threads does
not resolve to a whole number for a JMS trigger, Integration Server rounds up or
rounds down to the nearest whole number. However, if rounding down would set the
value to 0, the Integration Server rounds up to 1. For example, if you reduce Individual
Trigger Processing Throttle to 10% of maximum, a concurrent JMS trigger with a
maximum execution threads value of 12 would have an adjusted value of 1
(Integration Server rounds 1.2 down to 1). A concurrent JMS trigger with a maximum
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 105
7. Managing JMS Triggers
execution threads value of 4 would have an adjusted value of 1 (Integration Server
rounds 0.4 up to 1).
When you reduce the Individual Trigger Processing Throttle and save your changes,
Integration Server does not meet the adjusted maximum by terminating any threads
currently executing concurrent JMS triggers. Integration Server allows server threads
processing messages for concurrent JMS triggers to execute to completion. Integration
Server waits until the number of threads executing for a concurrent JMS trigger is less
than the adjusted maximum before dispatching another server thread for that JMS
trigger.
Using the Integration Server Administrator, you can:
Enable, disable, or suspend all JMS triggers.
Enable, disable, or suspend specific JMS triggers.
You might want to change the state of all JMS triggers at once as a quick way of freeing up
server resources. This can be especially helpful in a situation in which Integration Server
is functioning under heavy load and additional resources are needed immediately.
You might want to change the state for a specific JMS trigger in the following situations:
When a back‐end system needs maintenance or is becoming unresponsive, you might
want to suspend JMS triggers that interact with the back‐end system. When the back‐
end system becomes available, you can enable the JMS triggers.
After suspending or disabling all JMS triggers, you might enable specific JMS triggers.
For example, if the server is functioning under an unusually heavy load, you might
first suspend all JMS triggers and then gradually enable JMS triggers, starting with
the JMS triggers involved in key processes.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 106
7. Managing JMS Triggers
After Integration Server suspends a serial JMS trigger automatically because a fatal
error occurred during message processing. For information about configuring a JMS
trigger for fatal error handling, see “Handling Fatal Errors for Non‐Transacted JMS
Triggers” on page 65.
The following procedure explains how to use Integration Server Administrator to change
the state of all or individual JMS triggers.
1 Open the Integration Server Administrator if it is not already open.
2 In the Settings menu of the Navigation panel, click Messaging.
3 Click JMS Trigger Management.
4 If you want to change the state of all JMS triggers, do the following:
a Under Individual JMS Trigger Controls, in the Enabled column, click edit all.
b On the Settings > Messaging > JMS Trigger Management > Edit State screen, in the New
State list, select the state that you want to apply to all JMS triggers.
5 If you want to change the state of a specific JMS trigger, do the following:
a Under Individual JMS Trigger Controls, in the row for the JMS trigger that you
want to enable, disable, or suspend, click the text in the Enabled column
b On the Settings > Messaging > JMS Trigger Management > Edit State: triggerName screen,
in the New State list, select the state that you want to apply to this JMS trigger.
6 Click Save Changes.
Notes:
If you want to disable a JMS trigger, first suspend the JMS trigger and wait for all the
processing threads complete. Then, disable the JMS trigger. You can view the number
of threads currently used by a JMS trigger on the Settings > Messaging > JMS Trigger
Management screen.
When you disable a JMS trigger, Integration Server does the following:
If the JMS trigger is waiting before making a retry attempt, Integration Server
interrupts processing for the JMS trigger.
If the JMS trigger is currently processing messages, Integration Server waits a
specified amount of time before forcing the JMS trigger to stop processing
messages. If it does not complete in the allotted time, Integration Server stops the
message consumer used to receive messages for the JMS trigger and closes the
JMS session. At this point the server thread for the JMS trigger continues to run to
completion. However, the JMS trigger will not be able to acknowledge the
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 107
7. Managing JMS Triggers
message when processing completes. If the delivery mode of the message is set to
persistent, this can lead to duplicate messages.
The time Integration Server waits between the request to disable the JMS trigger
and forcing the trigger to stop is specified by the
watt.server.jms.trigger.stopRequestTimeout property.
Because administered objects, like destinations, are configured outside of Integration
Server, disabling a JMS trigger has no impact on the subscription.
If a JMS trigger is processing messages at the time it is suspended, the JMS trigger will
complete processing of those messages. The JMS trigger also acknowledges the
messages to the JMS provider.
You can use built‐in services to enable, disable, and suspend one or more triggers. For
information about the pub.trigger:disableJMSTriggers, pub.trigger:enableJMSTriggers, and
pub.trigger:suspendJMSTriggers services, see the webMethods Integration Server Built‐In
Services Reference.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 108
Appendix A. JMS Server Configuration Parameters
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
watt.server.jms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 109
A. JMS Server Configuration Parameters
Introduction
This appendix contains a description of the JMS‐related parameters you can specify in the
server configuration file (server.cnf), which is located in the
IntegrationServer_directory\config directory. Typically you will use the Settings > Extended
screen from the Integration Server Administrator to update this file, but there might be
times when you need to edit the file directly using a text editor. If you edit the file directly,
you should first shut down the Integration Server before updating the file. After you make
the changes, restart the server.
The server uses default values for many of the parameters. If a parameter has a default, it
is listed with the description of the parameter. Many of these parameters are set as you
administer the webMethods Integration Server using the Integration Server
Administrator.
watt.server.jms
watt.server.jms.connection.pingPeriod
Specifies how often, measured in seconds, Integration Server should ping the JMS
provider. The ping serves as a keep alive request sent to the JMS provider. The default is
300 seconds (5 minutes).
Important! You must restart Integration Server for the new value to take effect.
watt.server.jms.connection.retryPeriod
Specifies the length of time, in seconds, that Integration Server waits between connection
attempts when a connection to the JMS provider or JNDI provider fails. The default is 20
seconds.
Important! You must restart Integration Server for the new value to take effect.
watt.server.jms.csq.batchProcessingSize
Specifies the maximum number of messages Integration Server retrieves from the client
side queue and then sends to the JMS provider. Integration Server places sent messages in
the client side queue when the connection to the JMS provider fails. Integration Server
begins to drain the client side queue after the connection to the JMS provider becomes
available. The default is 25.
Important! You must restart Integration Server for the new value to take effect.
watt.server.jms.debugTrace
Enables an extra level of verbose logging for JMS triggers that can be controlled globally
or at the individual JMS trigger level.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 110
A. JMS Server Configuration Parameters
To enable debugTrace logging for all JMS triggers, set the watt.server.jms.debugTrace
property to true. For this setting to take effect, you need to disable and then enable all
JMS triggers. For information about using Integration Server Administrator to enable
and disable all JMS triggers, see “Enabling, Disabling, and Suspending JMS Triggers”
on page 106.
To enable debugTrace logging for an specific JMS trigger, append the fully qualified
JMS trigger name to the watt.server.jms.debugTrace property and set that property to
true. For example, to enable debugTrace logging for the JMS trigger named
myFolder:myJMSTrigger, enter the following on the Edit Extended Settings page:
watt.server.jms.debugTrace.myFolder:myJMSTrigger=true
For this setting to take effect, you need to disable and then enable the JMS trigger
specified in the property. For information about using Integration Server
Administrator to disable and enable an individual trigger, see “Enabling, Disabling,
and Suspending JMS Triggers” on page 106.
watt.server.jms.trigger.maxDeliveryCount
Specifies the maximum number of times the JMS provider can deliver a message to
Integration Server. The default is 100.
Important! You must restart Integration Server for the new value to take effect.
watt.server.jms.trigger.maxPrefetchSize
Specifies the maximum number of messages that the webMethods JMS API will retrieve
and cache per request for a JMS trigger. Using pre‐fetch cache can speed up the retrieval of
messages from the webMethods JMS Provider. Because messages will be placed in
Integration Server memory, you may want to decrease this setting if you have JMS triggers
receiving very large messages. Otherwise, memory issues can occur. This property only
applies to JMS triggers receiving messages from the webMethods JMS Provider. The
default is 10 messages.
Integration Server checks this value when a JMS trigger starts. To apply a new value to all
JMS triggers, use Integration Server Administrator to disable and then enable JMS
triggers. For more information about enabling and disabling JMS triggers, see “Enabling,
Disabling, and Suspending JMS Triggers” on page 106.
When working in a cluster of Integration Servers, the behavior controlled by this property
might appear at first to be misleading. For example, suppose that you have a cluster of
twoIntegration Serverss. 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 1 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.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 111
A. JMS Server Configuration Parameters
watt.server.jms.trigger.monitoringInterval
Specifies the interval, measured in seconds, at which Integration Serverexecutes resource
monitoring services for JMS triggers. A resource monitoring service is a service that you
create to check the availability of resources used by a JMS trigger service. After Integration
Server suspends a JMS trigger because all retry attempts have failed, it schedules a system
task to execute the resource monitoring service assigned to the JMS trigger. The default is
60 seconds. Changes to this property take effect the next time Integration Server schedules
a system task to execute a resource monitoring service for a JMS trigger.
For more information about building resource monitoring services for JMS triggers, see
Appendix B, “Building a Resource Monitoring Service”.
watt.server.jms.trigger.pooledConsumer.timeout
Specifies the length of time, in milliseconds, that a pooled consumer should remain active.
Integration Server uses a pool of consumers to retrieve and process messages for
concurrent JMS triggers. Each consumer in the pool encapsulates an actual
javax.jms.MessageConsumer and javax.jms.Session. The default is 60,000 milliseconds (60
seconds).
Important! You must restart Integration Server for the new value to take effect.
watt.server.jms.trigger.raiseEventOnException
Indicates whether Integration Server generates a JMS retrieval failure event when a JMS
trigger experiences a fatal exception, such as a non‐transient error or a message that
cannot be reprocessed, during message processing. Specify true if you want Integration
Server to generate a JMS retrieval failure event. The default is true.
Important! You must restart Integration Server for the new value to take effect.
watt.server.jms.trigger.raiseEventOnRetryFailure
Indicates that Integration Server generates a JMS retrieval failure event when a JMS
trigger experiences a retry failure. A retry failure can occur when the JMS provider has
reached the max delivery count for a message or when an ISRuntimeException is thrown
and the JMS trigger is not configured to recover the message (for example, if retry failure
handling for a non‐transacted JMS trigger is set to “Throw exception” instead of “Suspend
and Retry Later”.) When set to true, Integration Server generates a JMS retrieval failure
event for a JMS trigger when retry failure occurs. The default is true.
Important! You must restart Integration Server for the new value to take effect.
watt.server.jms.trigger.reuseSession
Indicates whether instances of a JMS trigger use the same session on Integration Server
When this property is set to true, the JMS trigger uses a shared session. Each of the trigger
services executed by the JMS trigger will use the same session ID. When this property is
set to false, Integration Server uses a new session for each instance of a JMS trigger.
Reusing sessions for a JMS trigger might improve performance. However, this property
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 112
A. JMS Server Configuration Parameters
does not work with all adapters. If you are working with an adapter, such as the SAP
adapter, that requires the session ID to be unique, set this property to false. The default is
false.
Important! You must restart Integration Server for the new value to take effect.
watt.server.jms.trigger.stopRequestTimeout
Specifies the maximum amount of time, measured in seconds that Integration Server
waits after a JMS trigger is disabled before forcing the JMS trigger to stop processing
messages. The default is 3 seconds.
You can disable a JMS trigger by invoking the pub.trigger:disableJMSTrigger service or by using
or via the Settings > Messaging > JMS Trigger Management screens in Integration Server
Administrator. For more information about disabling JMS triggers, see “Enabling,
Disabling, and Suspending JMS Triggers” on page 106.
When you save a JMS trigger in Developer, Integration Serverstops and then restarts the
trigger. In this situation, Integration Server waits 3 seconds before forcing the JMS trigger
to stop processing messages. This value cannot be configured.
Important! You must restart Integration Server for the new value to take effect.
watt.server.jms.wmjms.lms.readTimeout
Specifies the amount of time (measured in milliseconds) that Integration Server waits for
the next portion of an input stream before throwing WmReadTimeoutException. The read
timeout only applies after Integration Server retrieves the initial piece of the input stream.
The default is 30000 milliseconds.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 113
A. JMS Server Configuration Parameters
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 114
Appendix B. Building a Resource Monitoring Service
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 115
B. Building a Resource Monitoring Service
Overview
A resource monitoring service is a service that you create to check the availability of
resources used by a trigger. Integration Server schedules a system task to execute a
resource monitoring service after it suspends a trigger. Specifically, Integration Server
suspends a trigger and invokes the associated resource monitoring service when one of
the following occurs:
During exactly‐once processing, the document resolver service ends because of an
ISRuntimeException and the
watt.server.trigger.preprocess.suspendAndRetryOnError property is set to
true (the default).
A retry failure occurs for a non‐transacted trigger and the configured retry behavior is
suspend and retry later.
A transient error occurs for a transacted JMS trigger and the configured behavior
when transaction roll back occurs is to suspend the JMS trigger and recover the
message
The same resource monitoring service can be used for multiple triggers. When the service
indicates that resources are available, Integration Server resumes all the triggers that use
the 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.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 116
Appendix C. Transaction Management
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 117
C. 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 committed 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 119.
However, there are cases where users need to explicitly control the transactional units of
work. Examples of these cases are provided in “Implicit and Explicit Transactions” on
page 119.
To support transactions, the Integration Server relies on a built‐in J2EE‐based 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.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 118
C. 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 the Integration Server to manage XA transactions, see the
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.
When the top‐level flow service completes, the transaction is completed and is either
committed or rolled back, depending on the status (success or failure) of the top‐level flow
service or the JMS trigger service.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 119
C. Transaction Management
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 the webMethods Developer
User’s Guide.
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.
Note: With explicit transactions, you must be sure to call either a
pub.art.transaction:commitTransaction or pub.art.transaction:rollbackTransaction for each
pub.art.transaction:startTransaction; otherwise you will have dangling transactions that will
require you to reboot the Integration Server. You must also ensure that the
startTransaction is outside the SEQUENCE.
A new explicit transaction context can be started within a transaction context, provided
that you ensure that the transactions within the transaction 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 forth.
For example, consider the following is 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
The following example shows an invalid construct:
pub.art.transaction:startTransaction
pub.art.transaction:startTransaction
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 on using the pub.flow:getLastError
service, see the webMethods Developer User’s Guide.
For more information about designing and using flows, see the webMethods Developer
User’s Guide.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 120
C. Transaction Management
Service Description
pub.art.transaction:commitTransaction Commits an explicit transaction. It must be used
in conjunction with the
pub.art.transaction:startTransaction service. If it does
not have a corresponding
pub.art.transaction:startTransaction service, your flow
service will receive a run time error
pub.art.transaction:rollbackTransaction Rolls back an explicit transaction. It must be used
in conjunction with the
pub.art.transaction:startTransaction service. If it does
not have a corresponding
pub.art.transaction:startTransaction service, your flow
service will receive a run time error.
pub.art.transaction:setTransactionTimeout Manually sets a transaction timeout interval for
implicit and explicit transactions. When you use
this service, you are temporarily overriding the
Integration Server transaction timeout interval.
pub.art.transaction:startTransaction Starts an explicit transaction. It must be used in
conjunction with either a
pub.art.transaction:commitTransaction service or
pub.art.transaction:rollbackTransaction service. If it does
not have a corresponding
pub.art.transaction:commitTransaction service or
pub.art.transaction:rollbackTransaction service, your
flow service will receive a run time error.
For more information about the transaction management services, including detailed
descriptions of the service signatures, see the webMethods Integration Server Built‐In
Services Reference.
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 121
C. Transaction Management
webMethods Integration Server JMS Client Developer’s Guide Version 7.1 122