Tib Ems Users Guide
Tib Ems Users Guide
User’s Guide
Software Release 6.0
July 2010
Important Information
SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED
OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED
ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED
SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR
ANY OTHER PURPOSE.
USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A
LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE
AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER
LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE
SOFTWARE (AND WHICH IS DUPLICATED IN LICENSE.PDF) OR IF THERE IS NO SUCH SOFTWARE
LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED
IN THE “LICENSE” FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS
AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN
AGREEMENT TO BE BOUND BY THE SAME.
This document contains confidential information that is subject to U.S. and international copyright laws and
treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO
Software Inc.
TIB, TIBCO, TIBCO Adapter, Predictive Business, Information Bus, The Power of Now, TIBCO ActiveEnterprise,
TIBCO Hawk, TIBCO Rendezvous, TIBCO Enterprise, TIBCO Enterprise Message Service, TIBCO SmartSockets
and the TIBCO logo are either registered trademarks or trademarks of TIBCO Software Inc. in the United States
and/or other countries.
EJB, JAVA EE, J2EE, and all Java-based trademarks and logos are trademarks or registered trademarks of Sun
Microsystems, Inc. in the U.S. and other countries.
All other product and company names and marks mentioned in this document are the property of their
respective owners and are mentioned for identification purposes only.
THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL
OPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME
TIME. SEE THE README.TXT FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A
SPECIFIC OPERATING SYSTEM PLATFORM.
THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS.
CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE
INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE
IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN
THIS DOCUMENT AT ANY TIME.
THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR
INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING
BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES.
Copyright © 1997-2010 TIBCO Software Inc. ALL RIGHTS RESERVED.
TIBCO Software Inc. Confidential Information
| iii
Contents
Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxv
Changes from the Previous Release of this Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
TIBCO Enterprise Message Service Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Other TIBCO Product Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Third Party Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviii
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
How to Contact TIBCO Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxii
Chapter 1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
JMS Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
JMS Message Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Point-to-Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Publish and Subscribe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Multicast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
EMS Destination Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Client APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Sample Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
TIBCO Rendezvous Java Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Administering the Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
User and Group Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Using TIBCO Hawk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Fault Tolerance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Integrating With Third-Party Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Transaction Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 2 Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
EMS Extensions to JMS Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
JMS Message Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
JMS Message Header Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
EMS Message Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
JMS Message Bodies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Maximum Message Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Message Priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Message Delivery Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
PERSISTENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
NON_PERSISTENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
RELIABLE_DELIVERY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
How EMS Manages Persistent Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Persistent Messages Sent to Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Persistent Messages Published to Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Persistent Messages and Synchronous File Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Store Messages in Multiple Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Store Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Default Store Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Configuring Multiple Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Understanding mstore Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Character Encoding in Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Supported Character Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Sending Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Message Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
About Message Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Setting Message Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Message Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
NO_ACKNOWLEDGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
EXPLICIT_CLIENT_ACKNOWLEDGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Message Selectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Data Type Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Synchronous and Asynchronous Message Consumption. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Chapter 3 Destinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Destination Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Destination Names. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Static Destinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Dynamic Destinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .593
Figures
Tables
Preface
TIBCO Enterprise Message Service™ software lets application programs send and
receive messages according to the Java Message Service (JMS) protocol. It also
integrates with TIBCO Rendezvous and TIBCO SmartSockets messaging
products.
Topics
This section itemizes the major changes from the previous release of this guide.
mstores
TIBCO Enterprise Message Service now offers a new type of message store, called
mstore. This store type is designed to recover quickly after a failover. For details
on the mstore feature, see mstores on page 30.
Redelivery Delay
A new destination property has been added to this release of TIBCO Enterprise
Message Service. The r e d e l i v e r y d e l a y property can be used to determine how
long the EMS server waits before retuning an unacknowledged message to the
message queue. For details about the new property, see r e d e l i v e r y d e l a y on
page 67.
Feature Enhancements
The following enhancements are documented in the sections shown:
• It is now possible to cursor through the list returned by the s h o w t o p i c s and
s h o w q u e u e s commands. For more information, see the command
descriptions for s h o w q u e u e s and s h o w t o p i c s .
• You can now quickly start the EMS server with the default configuration
using scripts. See Start Using the Default Configuration on page 102.
Related Documentation
Typographical Conventions
Convention Use
TIBCO_HOME Many TIBCO products must be installed within the same home directory. This
directory is referenced in documentation as TIBCO_HOME. The value of
ENV_HOME
TIBCO_HOME depends on the operating system. For example, on Windows
EMS_HOME systems, the default value is C : \ t i b c o .
Other TIBCO products are installed into an installation environment.
Incompatible products and multiple instances of the same product are installed
into different installation environments. The directory into which such products
are installed is referenced in documentation as ENV_HOME. The value of
ENV_HOME depends on the operating system. For example, on Windows
systems the default value is C:\tibco.
TIBCO Enterprise Message Service installs into a directory within TIBCO_HOME.
This directory is referenced in documentation as EMS_HOME. The value of
EMS_HOME depends on the operating system. For example on Windows
systems, the default value is C : \ t i b c o \ e m s \ 6 . 0 .
code font Code font identifies commands, code examples, filenames, pathnames, and
output displayed in a command window. For example:
Use M y C o m m a n d to start the TIBCO foo process.
• In large code samples, to indicate the parts of the sample that are of
particular interest.
• In command syntax, to indicate the default value. For example, if no
parameter is specified, M y C o m m a n d is enabled:
MyCommand [enable | disable]
Convention Use
italic font Italic font is used in the following ways:
• To indicate a document title. For example: See TIBCO BusinessWorks Concepts
for more details.
• To introduce new terms For example: A portal page may contain several
portlets. Portlets are mini-applications that run in a portal.
• To indicate a variable in a command or code syntax that you must replace.
For example: M y C o m m a n d pathname
Key Key name separated by a plus sign indicate keys pressed simultaneously. For
combinations example: Ctrl+C.
Key names separated by a comma and space indicate keys pressed one after the
other. For example: Esc, Ctrl+Q.
Convention Use
[ ] An optional item in a command or code syntax.
For example:
MyCommand [optional_parameter] required_parameter
| A logical ’OR’ that separates multiple items of which only one may be chosen.
For example, you can select only one of the following parameters:
MyCommand para1 | param2 | param3
{ } A logical group of items. Other syntax notations may appear within each logical
group.
For example, the following command requires two parameters, which can be
either p a r a m 1 and p a r a m 2 or p a r a m 3 and p a r a m 4 :
MyCommand {param1 param2} | {param3 param4}
In the next example, the command requires two parameters. The first parameter
can be either p a r a m 1 or p a r a m 2 and the second can be either p a r a m 3 or p a r a m 4 :
MyCommand {param1 | param2} {param3 | param4}
In the next example, the command can accept either two or three parameters.
The first parameter must be p a r a m 1 . You can optionally include p a r a m 2 as the
second parameter. And the last parameter is either p a r a m 3 or p a r a m 4 .
MyCommand param1 [param2] {param3 | param4}
For comments or problems with this manual or the software it addresses, please
contact TIBCO Support Services as follows.
• For an overview of TIBCO Support Services, and information about getting
started with TIBCO Product Support, visit this site:
http://www.tibco.com/services/support
• If you already have a valid maintenance or support contract, visit this site:
http://support.tibco.com
Entry to this site requires a username and password. If you do not have a
username, you can request one.
Chapter 1 Overview
This chapter contains a general overview of Java Message Service (JMS) and
TIBCO Enterprise Message Service concepts.
Topics
JMS Overview
Java Message Service 1.1 (JMS) is a Java framework specification for messaging
between applications. Sun Microsystems developed this specification, in
conjunction with TIBCO and others, to supply a uniform messaging interface
among enterprise applications.
Using a message service allows you to integrate the applications within an
enterprise. For example, you may have several applications: one for customer
relations, one for product inventory, and another for raw materials tracking. Each
application is crucial to the operation of the enterprise, but even more crucial is
communication between the applications to ensure the smooth flow of business
processes. Message-oriented-middleware (MOM) creates a common
communication protocol between these applications and allows you to easily
integrate new and existing applications in your enterprise computing
environment.
The JMS framework (an interface specification, not an implementation) is
designed to supply a basis for MOM development. TIBCO Enterprise Message
Service implements JMS and integrates support for connecting other message
services, such as TIBCO Rendezvous and TIBCO SmartSockets. This chapter
describes the concepts of JMS and its implementation in TIBCO Enterprise
Message Service. For more information on JMS requirements and features, see the
following sources:
• Java Message Service specification, available through
http://java.sun.com/products/jms/index.html.
• Java Message Service by Richard Monson-Haefel and David A. Chappell,
O’Reilly and Associates, Sebastopol, California, 2001.
JMS Compliance
TIBCO Enterprise Message Service 6.0 has passed Sun Microsystem Technology
Compatibility Kit (TCK) for Java Message Service 1.1 (JMS 1.1). Therefore, EMS
6.0 is compliant with the JMS 1.1 specification.
JMS is based on creation and delivery of messages. Messages are structured data
that one application sends to another. The creator of the message is known as the
producer and the receiver of the message is known as the consumer. The TIBCO
EMS server acts as an intermediary for the message and manages its delivery to
the correct destination. The server also provides enterprise-class functionality
such as fault-tolerance, message routing, and communication with other
messaging systems, such as TIBCO Rendezvous® and TIBCO SmartSockets®.
Figure 1 illustrates an application producing a message, sending it by way of the
server, and a different application receiving the message.
Point-to-Point
Point-to-point messaging has one producer and one consumer per message. This
style of messaging uses a queue to store messages until they are received. The
message producer sends the message to the queue; the message consumer
retrieves messages from the queue and sends acknowledgement that the message
was received.
More than one producer can send messages to the same queue, and more than
one consumer can retrieve messages from the same queue. The queue can be
configured to be exclusive, if desired. If the queue is exclusive, then all queue
messages can only be retrieved by the first consumer specified for the queue.
Exclusive queues are useful when you want only one application to receive
messages for a specific queue. If the queue is not exclusive, any number of
receivers can retrieve messages from the queue. Non-exclusive queues are useful
for balancing the load of incoming messages across multiple receivers. Regardless
of whether the queue is exclusive or not, only one consumer can ever consume
each message that is placed on the queue.
Figure 2 illustrates point-to-point messaging using a non-exclusive queue. Each
message consumer receives a message from the queue and acknowledges receipt
of the message. The message is taken off the queue so that no other consumer can
receive it.
TIBCO EMS
Server
TIBCO EMS
Server Subsecribe to
Topic
Message Send Message Message
Producer Topic Consumers
Deliver Message
Acknowledge
(if necessary)
EMS Client EMS Clients
Multicast
Multicast messaging allows one message producer to send a message to multiple
subscribed consumers simultaneously. As in the publish and subscribe messaging
models, the message producer addresses the message to a topic. Instead of
delivering a copy of the message to each individual subscriber over TCP,
however, the EMS server broadcasts the message over Pragmatic General
Multicast (PGM). A daemon running on the machine with the subscribed EMS
client receives the multicast message and delivers it to the message consumer.
Multicast is highly scalable because of the reduction in bandwidth used to
broadcast messages, and because of reduced EMS server resources used.
However, multicast does not guarantee message delivery to all subscribers.
local hosts
Multicast Daemon
tibemsmcd
TIBCO EMS
Server Broadcast
Message
Deliver
Message Send Message Multicast Message
Producer Topic
Subscribe to
Topic
EMS Client
Message
Consumer
EMS Client
For more information about multicast, see Chapter 13, Using Multicast, on
page 345.
Client APIs
Sample Code
EMS includes several example programs. These examples illustrate various
features of EMS. You may wish to view these example programs when reading
about the corresponding features in this manual. The examples are included in
the s a m p l e s subdirectory of the EMS installation directory.
For more information about running the examples, see Chapter 4, Getting Started,
on page 87.
Administration
The server can provide various statistics Chapter 17, Monitoring Server
at the desired level of detail. Activity, on page 421
Security
For communication security between servers and clients, and between servers
and other servers, you must explicitly configure SSL within EMS.
Secure Sockets Layer (SSL) is a protocol for transmitting encrypted data over the
Internet or an internal network. SSL works by using public and private keys to
encrypt data that is transferred over the SSL connection. Most web browsers
support SSL, and many Web sites and Java applications use the protocol to obtain
confidential user information, such as credit card numbers.
EMS supports SSL between the following components:
• between an EMS client and the EMS server
• between the administration tool and the EMS server
• between the administration APIs and the EMS server
• between routed servers
• between fault-tolerant servers
See Chapter 18, Using the SSL Protocol, on page 441 for more information about
SSL support in EMS.
Fault Tolerance
You can configure EMS servers as primary and backup servers to provide fault
tolerance for your environment. The primary and backup servers act as a pair,
with the primary server accepting client connections and performing the work of
handling messages, and the secondary server acting as a backup in case of failure.
When the active server fails, the backup server assumes operation and becomes
the primary active server.
See Chapter 19, Fault Tolerance, on page 461 for more information about the
fault-tolerance features of EMS.
Routing
EMS provides the ability for servers to route messages between each other. Topic
messages can be routed across multiple hops, provided there are no cycles (that is,
the message can not be routed to any server it has already visited). Queue
messages can travel at most one hop to any other server from the server that owns
the queue.
EMS stores and forwards messages in most situations to provide operation when
a route is not connected.
See Chapter 20, Working With Routes, on page 485 for more information about
the routing features of EMS.
Transaction Support
TIBCO Enterprise Message Service can integrate with Java Transaction API (JTA)
compliant transaction managers. EMS implements all interfaces necessary to be
JTA compliant. The EMS C API is compliant with the X/Open XA specification.
The EMS .NET API supports Microsoft Distributed Transaction Coordinator (MS
DTC). Transactions created using MSDTC in a .NET client are seen as XA
transactions in C and Java clients.
Chapter 2 Messages
Topics
The JMS specification details a standard format for the header and body of a
message. Properties are provider-specific and can include information on specific
implementations or enhancements to JMS functionality. See EMS Message
Properties on page 19 for the list of message properties that are specific to EMS.
In addition to the EMS message properties, EMS provides a select number of
extensions to JMS. These are:
• The JMS standard specifies two delivery modes for messages, P E R S I S T E N T
and N O N _ P E R S I S T E N T. EMS also includes a R E L I A B L E _ D E L I V E R Y mode that
eliminates some of the overhead associated with the other delivery modes. See
R E L I A B L E _ D E L I V E R Y on page 25.
JMS messages have a standard structure. This structure includes the following
sections:
• Header (required)
• Properties (optional)
• Body (optional)
JMSCorrelationID message client This ID can be used to link messages, such as linking a
response message to a request message. Entering a
value in this field is optional. The JMS Correlation ID
has a recommended maximum of 4 KB. Higher values
may result in the message being rejected.
JMSRedelivered JMS provider If this field is set, it is possible that the message was
delivered to the client earlier, but not acknowledged at
that time.
More
Property Description Info
JMS_TIBCO_CM_PUBLISHER Correspondent name of an 394
RVCM sender for messages
imported from TIBCO
Rendezvous.
More
Property Description Info
JMS_TIBCO_DISABLE_SENDER Specifies that the user name of 21
the message sender should not
be included in the message, if
possible.
TextMessage A java.lang.String.
Message Priority
The J M S D e l i v e r y M o d e message header field defines the delivery mode for the
message. JMS supports P E R S I S T E N T and N O N _ P E R S I S T E N T delivery modes for
both topic and queue. EMS extends these delivery modes to include a
R E L I A B L E _ D E L I V E R Y mode.
You can set the default delivery mode for the Message Producer, as described in
Configuring a Message Producer on page 323. This default delivery mode can be
overridden by the client when sending a message, as described in Sending
Messages on page 332.
PERSISTENT
As shown in Figure 5, when a producer sends a P E R S I S T E N T message, the
producer must wait for the server to reply with a confirmation. The message is
persisted on disk by the server. This delivery mode ensures delivery of messages
to the destination on the server in almost all circumstances. However, the cost is
that this delivery mode incurs two-way network traffic for each message or
committed transaction of a group of messages.
EMS Client
NON_PERSISTENT
Sending a N O N _ P E R S I S T E N T message omits the overhead of persisting the
message on disk to improve performance.
If a u t h o r i z a t i o n is disabled on the server, the server does not send a
confirmation to the message producer.
If a u t h o r i z a t i o n is enabled on the server, the default condition is for the
producer to wait for the server to reply with a confirmation in the same manner as
when using P E R S I S T E N T mode.
EMS Client
RELIABLE_DELIVERY
EMS extends the JMS delivery modes to include reliable delivery. Sending a
R E L I A B L E _ D E L I V E R Y message omits the server confirmation to improve
performance regardless of the a u t h o r i z a t i o n setting.
EMS Client
As described in Message Delivery Modes on page 24. JMS defines two message
delivery modes, P E R S I S T E N T and N O N _ P E R S I S T E N T, and EMS defines a
R E L I A B L E _ D E L I V E R Y mode.
TIBCO EMS
Server
Disk
Other
Consumers
TIBCO EMS
Server
Subscribe
Message Publish to Topic
Producer Message Topic Durable
Consumer
EMS Clients
This behavior is consistent with the JMS specification because durable subscribers
to a topic cause published messages to be saved. Additionally, subscribers to a
topic that have a fault-tolerant connection need to receive messages from the
secondary server after a failover. However, non-durable subscribers without a
fault-tolerant connection that re-connect after a server failure are considered
newly created subscribers and are not entitled to receive any messages created
prior to the time they are created (that is, messages published before the
subscriber re-connects are not resent).
Each EMS server writes persistent messages to a store file. To prevent two servers
from using the same store file, each server restricts access to its store file for the
duration of the server process. For details on how EMS manages shared store
files, see How EMS Manages Access to Shared Store Files on page 113.
As described in Message Delivery Modes on page 24, the EMS server writes
P E R S I S T E N T messages to disk while waiting for confirmation of receipt from the
subscriber. Messages are persisted to a store. The EMS server can write messages
to different types of stores: file-based stores, mstores, and database stores.
By default, the EMS server writes persistent messages to file-based stores. There
are three default store files, as described in Default Store Files on page 30. You can
configure the system to change the default store files and locations, and also to
store persistent messages to one or more store files, filtering them by destination.
Stores are defined in the s t o r e s . c o n f configuration file, and associated with a
destination using the s t o r e destination property.
Stores have properties that allow you to control how the server manages the store
files. For example:
• When using file-based stores:
— Preallocate disk space for the store file.
— Truncate the file periodically to relinquish disk space.
— Specify whether messages are written synchronously or asynchronously.
• Store messages in a database.
With the multiple stores feature, you can configure your messaging application to
store messages in different locations for each application, or to create separate
files for related destinations. For example, you can create one store for messages
supporting Marketing, and one for messages supporting Sales. Because stores are
configured in the server, they are transparent to clients.
The EMS Administration Tool allows administrators to review the system’s
configured stores and their settings by using the s h o w s t o r e s and s h o w s t o r e
commands.
Store Types
TIBCO Enterprise Message Service allows you to configure several different types
of stores, described here.
File-Based Stores
The EMS server stores persistent messages in file-based stores. You can use the
default store files, or create your own file-based stores. You direct the EMS server
to write messages to these store files by associating a destination with a store.
File-based stores are enabled by default, and the server automatically defines
three default stores, described below. You do not need to do anything in order to
use the default stores.
The section Configuring Multiple Stores on page 31 describes how to change store
settings or create custom stores.
mstores
The mstore is designed to recover quickly after a failover. When mstores are in
use, the EMS server starts quickly, but may run more slowly until the mstore
cache is fully loaded. This is because the EMS server continually monitors the
store in the background. The server reads through the mstore incrementally and
discards stale data, such as purged and expired messages.
As a result, expired and purged messages are not immediately removed from the
mstore, and may remain in the store longer than they would in a file-based or
database store—although they are not delivered to the consumer. These messages
are discarded during the periodic scans of the store. The scanning behavior is
determined by parameter settings in the store configuration, and is further
described in Understanding mstore Intervals on page 32.
Because of this behavior, querying the server for a total pending message count
may return an inaccurate value. However, querying specific destinations returns
an accurate count.
The section Configuring Multiple Stores on page 31 describes the mstore
configuration process.
Database Stores
The EMS server can store messages in one or more database instances. Database
stores must be configured to use a supported database. See Chapter 10, Using
Database Stores for a full description of this feature.
Note that the $ s y s . m e t a store may not be reconfigured to use the m s t o r e type.
File-Based Stores When using file-based stores, you can also change store associations
dynamically using the s e t p r o p t o p i c or s e t p r o p q u e u e command in the
EMS Administration Tool.
mstores When using mstores, you cannot dynamically change the mstore associations
after they have been set. In order to change a destination’s s t o r e property
from a store of the type m s t o r e :
a. Stop the EMS server.
b. Empty the associated mstore of messages from the destination.
c. Change the store association by manually editing the destination’s store
property in the t o p i c s . c o n f or q u e u e s . c o n f file.
d. Restart the EMS server.
Once mstores are enabled for a destination, you cannot dynamically change
the s t o r e property value using s e t p r o p or a d d p r o p . To change the s t o r e
property, you must stop the server, empty the mstore, manually make the
change, and restart.
The mstore stores data in multiple files. As a result, mstores cannot operate in
o u t o f s p a c e conditions. In order to prevent an o u t o f s p a c e situation
from arising, we recommend ensuring that there is at least twice as much disk
space available for the mstore as needed to hold the maximum amount of data
that might be stored in it.
Multiple destinations can be mapped to the same store, either explicitly or using
wildcards. Even if no stores are configured, the server sends persistent messages
that are not associated with a store to default stores. See Default Store Files for
more information.
For details about the s t o r e parameter, see s t o r e on page 70.
affect message transmission rates in the EMS server. If the EMS server
performance is negatively affected by the size of the mstore, you can tune the
mstore parameter values to spread mstore background activity over a longer
period of time, thereby decreasing the associated read rates.
• scan_target_interval — the maximum amount of time allowed before
each message in the store is examined.
For example, if the s c a n _ t a r g e t _ i n t e r v a l is 24 hours, each section of the
mstore will be examined at least once every day. Because purged and expired
messages are not removed from the mstore until they are examined by this
background process, this means that it can take up to 24 hours before a
message is removed from the queue following a purge command (making
underlying storage space available for re-use).
• scan_iter_interval — the length of time between each increment of
background activity.
For example, if the s c a n _ i t e r _ i n t e r v a l is 10 seconds, the EMS server begins
examining a new section of the mstore every 10 seconds. The amount of data
read in each increment is dependent on the total size of the store and the
length of the s c a n _ t a r g e t _ i n t e r v a l . The server must examine enough data
in each interval to fully traverse the store within the target interval.
Example
For example, assume that s c a n _ i t e r _ i n t e r v a l is 10 seconds,
scan_target_interval is 1 day (86,400 seconds), and the mstore contains 9 GBs
of data. Every 10 seconds, the EMS server will examine about 1 MB of data. This
produces an average read rate of about 100 KB/sec, which is unlikely to produce
performance degradation with most modern storage mediums.
If EMS server performance does slow, you may need to increase the
scan_target_interval value in order to spread the background activity over
longer period of time. You can monitor the settings for problems using the s h o w
s t o r e command and checking the ratio of "Discard scan bytes" to "Discard scan
interval". For best results, this ratio should be kept below 20% of the disk
processing capacity for each mstore. Consider this ratio in relation to your storage
medium's overall data transfer capacity, so as to make sure that the background
activity does not occupy an excessive amount of the system's resources.
Nearly all character sets include unprintable characters. EMS software does not
prevent programs from using unprintable characters. However, messages
containing unprintable characters (whether in headers or data) can cause
unpredictable results if you instruct EMS to print them. For example, if you
enable the message tracing feature, EMS prints messages to a trace log file.
Sending Messages
When a client sends a message, the message stores the character encoding name
used for strings in that message. Java clients represent strings using Unicode. A
message created by a Java client that does not specify an encoding will use UTF-8
as the named encoding within the message. UTF-8 uses up to four bytes to
represent each character, so a Java client can improve performance by explicitly
using a single-byte character encoding, if possible.
Java clients can globally set the encoding to use with the s e t E n c o d i n g method or
the client can set the encoding for each message with the s e t M e s s a g e E n c o d i n g
method. For more information about these methods, see the TIBCO Enterprise
Message Service Java API Reference.
Typically, C clients manipulate strings using the character encoding of the
machine on which they are running.
Message Compression
Message compression is supported in .NET clients when using the install package
for Visual C++ 8 / .NET 2.0. .NET in the Visual C++ 7 / .NET 1.1 package does
not support compression.
Compressed messages are handled transparently. The client code only sets the
J M S _ T I B C O _ C O M P R E S S property. The client does not need to take any other action.
The client automatically decompresses any compressed messages it receives.
Message Acknowledgement
The interface specification for JMS requires that message delivery be guaranteed
under many, but not all, circumstances. Figure 10 illustrates the basic structure of
message delivery and acknowledgement.
meanwhile the server might redeliver messages. This mode reduces session
overhead. Should JMS fail, the consumer may receive duplicate messages.
EMS extends the JMS acknowledge modes to include:
• NO_ACKNOWLEDGE
• EXPLICIT_CLIENT_ACKNOWLEDGE
• EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE
NO_ACKNOWLEDGE
N O _ A C K N O W L E D G E mode suppresses the acknowledgement of received messages.
After the server sends a message to the client, all information regarding that
message for that consumer is eliminated from the server. Therefore, there is no
need for the client application to send an acknowledgement to the server about
the received message. Not sending acknowledgements decreases the message
traffic and saves time for the receiver, therefore allowing better utilization of
system resources.
EXPLICIT_CLIENT_ACKNOWLEDGE
E X P L I C I T _ C L I E N T _ A C K N O W L E D G E is like C L I E N T _ A C K N O W L E D G E except it
acknowledges only the individual message, rather than all messages received so
far on the session.
One example of when E X P L I C I T _ C L I E N T _ A C K N O W L E D G E would be used is when
receiving messages and putting the information in a database. If the database
insert operation is slow, you may want to use multiple application threads all
doing simultaneous inserts. As each thread finishes its insert, it can use
E X P L I C I T _ C L I E N T _ A C K N O W L E D G E to acknowledge only the message that it is
currently working on.
EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE
E X P L I C I T _ C L I E N T _ D U P S _ O K _ A C K N O W L E D G E is like D U P S _ O K _ A C K N O W L E D G E except
it ’lazily" acknowledges only the individual message, rather than all messages
received so far on the session.
Message Selectors
A message selector is a string that lets a client program specify a set of messages,
based on the values of message headers and properties. A selector matches a
message if, after substituting header and property values from the message into
the selector string, the string evaluates to t r u e . Consumers can request that the
server deliver only those messages that match a selector.
The syntax of selectors is based on a subset of the SQL92 conditional expression
syntax.
Identifiers
Identifiers can refer to the values of message headers and properties, but not to
the message body. Identifiers are case-sensitive.
Basic Syntax An identifier is a sequence of letters and digits, of any length, that begins with a
letter. As in Java, the set of letters includes _ (underscore) and $ (dollar).
Illegal Certain names are exceptions, which cannot be used as identifiers. In particular,
N U L L , T R U E , F A L S E , N O T, A N D , O R , B E T W E E N , L I K E , I N , I S , and E S C A P E are defined to
have special meaning in message selector syntax.
Value Identifiers refer either to message header names or property names. The type of
an identifier in a message selector corresponds to the type of the header or
property value. If an identifier refers to a header or property that does not exist in
a message, its value is N U L L .
Literals
String Literal A string literal is enclosed in single quotes. To represent a single quote within a
literal, use two single quotes; for example, ' l i t e r a l ' ' s ' . String literals use the
Unicode character encoding. String literals are case sensitive.
Exact Numeric An exact numeric literal is a numeric value without a decimal point, such as 5 7 ,
Literal - 9 5 7 , and + 6 2 ; numbers in the range of l o n g are supported.
Approximate An approximate numeric literal is a numeric value with a decimal point (such as
Numeric Literal 7 . , - 9 5 . 7 , and + 6 . 2 ), or a numeric value in scientific notation (such as 7 E 3 and
- 5 7 . 9 E 2 ); numbers in the range of d o u b l e are supported. Approximate literals
use the floating-point literal syntax of the Java programming language.
Expressions
Arithmetic Arithmetic expressions are composed of numeric literals, identifiers (that evaluate
Expression to numeric literals), arithmetic operations, and smaller arithmetic expressions.
Operators
Comparison Comparison operators: = , > , > = , < , < = , < > (not equal).
Operators
These operators can compare only values of comparable types. (Exact numeric
values and approximate numerical values are comparable types.) Attempting to
compare incomparable types yields f a l s e . If either value in a comparison
evaluates to N U L L , then the result is unknown (in SQL 3-valued logic).
Comparison of string values is restricted to = and < > . Two strings are equal if and
only if they contain the same sequence of characters.
Comparison of boolean values is restricted to = and < > .
White Space
White space is any of the characters space, horizontal tab, form feed, or line
terminator—or any contiguous run of characters in this set.
bool byte short char int long float double string byte[]
bool X X
byte X X X X X
short X X X X
char X X
int X X X
long X X
float X X X
double X X
string X X X X X X X X
byte[] X
Chapter 3 Destinations
Topics
Destination Overview
Destination Names
A destination name is a string divided into elements, each element separated by
the dot character (.). The dot character allows you to create multi-part destination
names that categorize destinations.
For example, you could have an accounting application that publishes messages
on several destinations. The application could prefix all messages with ACCT,
and each element of the name could specify a specific component of the
application. ACCT.GEN_LEDGER.CASH, ACCT.GEN_LEDGER.RECEIVABLE,
and ACCT.GEN_LEDGER.MISC could be subjects for the general ledger portion
of the application.
Separating the subject name into elements allows applications to use wildcards
for specifying more than one subject. See Wildcards on page 74 for more
information. The use of wildcards in destination names can also be used to define
"parent" and "child" destination relationships, where the child destinations inherit
the properties from its parents. See Inheritance of Properties on page 77.
Static Destinations
Configuration information for static destinations is stored in configuration files
for the EMS server. Changes to the configuration information can be made in a
variety of ways. To manage static destinations, you can edit the configuration files
using a text editor, you can use the administration tool, or you can use the
administration APIs.
Clients can obtain references to static destinations through a naming service such
as JNDI or LDAP. See Creating and Modifying Destinations on page 72 for more
information about how clients use static destinations.
Dynamic Destinations
Dynamic destinations are created on-the-fly by the EMS server, as required by
client applications. Dynamic destinations do not appear in the configuration files
and exist as long as there are messages or consumers on the destination. A client
cannot use JNDI to lookup dynamic queues and topics.
When you use the s h o w q u e u e s or s h o w t o p i c s command in the administration
tool, you see dynamic topics and queues have an asterisk (* ) in front of their name
in the list of topics or queues. If a property of a queue or topic has an asterisk (* )
character in front of its name, it means that the property was inherited from the
parent queue or topic and cannot be changed.
See Dynamically Creating Topics and Queues on page 320 for details on topics
and queues can be dynamically created by the EMS server.
Temporary Destinations
TIBCO Enterprise Message Service supports temporary destinations as defined in
JMS specification 1.1 and its API.
Servers connected by routes exchange messages sent to temporary topics. As a
result, temporary topics are ideal destinations for reply messages in request/reply
interactions.
For more information on temporary queues and topics, refer to the JMS
documentation described in Third Party Documentation on page xxviii.
Destination Bridges
You can create server-based bridges between destinations of the same or different
types to create a hybrid messaging model for your application. This allows all
messages delivered to one destination to also be delivered to the bridged
destination. You can bridge between different destination types, between the
same destination type, or to more than one destination. For example, you can
create a bridge between a topic and a queue or from a topic to another topic.
See Destination Bridges on page 79 for more information about destination
bridging.
TIBCO Enterprise Message Service places few restrictions on the syntax and
interpretation of destination names. System designers and developers have the
freedom to establish their own conventions when creating destination names. The
best destination names reflect the structure of the data in the application itself.
Structure A destination name is a string divided into elements, each element separated by
the dot character (. ). The dot character allows you to create multi-part destination
names that categorize destinations.
Empty strings (" " ) are not permitted destination names. Likewise, elements
cannot incorporate the dot character by using an escape sequence.
Although they are not prohibited, we recommend that you do not use tabs,
spaces, or any unprintable character in a destination name. You may, however,
use wildcards. See Wildcards on page 74 for more information.
Length Destinations are limited to a total length of 249 characters. However, some of that
length is reserved for internal use. The amount of space reserved for internal use
varies according to the number of elements in the destination; destinations that
include the maximum number of elements are limited to 196 characters.
A destination can have up to 64 elements. Elements cannot exceed 127 characters.
Dot separators are not included in element length.
Destination Name When designing destination naming conventions, remember these performance
Performance considerations:
Considerations
• Shorter destination names perform better than long destination names.
• Destinations with several short elements perform better than one long
element.
• A set of destinations that differ early in their element lists perform better than
subjects that differ only in the last element.
For more information on wildcard matching, see Wildcards * and > on page 74.
Examples
These examples illustrate the syntax for destination names.
NEWS.LOCAL.POLITICS.CITY_COUNCIL
NEWS.NATIONAL.ARTS.MOVIES.REVIEWS
CHAT.MRKTG.NEW_PRODUCTS
CHAT.DEVELOPMENT.BIG_PROJECT.DESIGN
News.Sports.Baseball
finance
This.long.subject_name.is.valid.even.though.quite.uninformative
Destination Properties
exclusive 56 No Yes
export 58 Yes No
maxRedelivery 61 No Yes
redeliverydelay 67 No Yes
channel
The c h a n n e l property determines the multicast channel over which messages
sent to this topic are broadcast. By including the c h a n n e l property, the associated
topic is enabled for multicast.
Set the c h a n n e l property using this form:
c h a n n e l = name
Only one channel is allowed for each topic. For this reason, overlapping wildcard
topics are incompatible with channel properties. The creation of a wildcard topic
with a c h a n n e l property that overlaps with another wildcard topic with a
c h a n n e l property will fail. See Overlapping Wildcards and Disjoint Properties on
page 74 for more information.
This parameter cannot be used without first configuring multicast channels in the
c h a n n e l s . c o n f file and enabling this feature in the t i b e m s d . c o n f file.
For more information, see Chapter 13, Using Multicast, on page 345.
exclusive
The e x c l u s i v e property is available for queues only (not for topics), and cannot
be used with global queues.
When e x c l u s i v e is set for a queue, the server sends all messages on that queue to
one consumer. No other consumers can receive messages from the queue. Instead,
these additional consumers act in a standby role; if the primary consumer fails, the
server selects one of the standby consumers as the new primary, and begins
delivering messages to it.
You can set e x c l u s i v e using the form:
exclusive
expiration
If an e x p i r a t i o n property is set for a destination, the server honors the
overridden expiration period and retains the message for the length of time
specified by the expiration property.
However, the server overrides the J M S E x p i r a t i o n value set by the producer in
the message header with the value 0 and therefore the consuming client does not
expire the message.
You can set the e x p i r a t i o n property for any queue and any topic using the form:
e x p i r a t i o n = time[ m s e c | s e c | m i n | h o u r | d a y ]
where time is the number of seconds. Zero is a special value that indicates
messages to the destination never expire.
You can optionally include time units, such as m s e c , s e c , m i n , h o u r or d a y to
describe the time value as being in milliseconds, seconds, minutes, hours, or days,
respectively. For example:
expiration=10min
Means 10 minutes.
When a message expires it is either destroyed or, if the
J M S _ T I B C O _ P R E S E R V E _ U N D E L I V E R E D property on the message is set to t r u e , the
message is placed on the undelivered queue so it can be handled by a special
consumer. See Undelivered Message Queue on page 20 for details.
In EMS version 4.4 and later, clients automatically synchronize their clocks with
the server when a connection is created. However, for long-lasting connections,
Network Time Protocol (NTP) is the most reliable method for ensuring continuing
synchronization between server and client. Additionally, if your EMS server or
client application are based on a version of EMS prior to 4.4, you must ensure that
clocks are synchronized among all the host computers that send and receive
messages, if your pre-4.4 client application uses non-zero values for message
expiration. Synchronize clocks to a tolerance that is a very small fraction of the
smallest message expiration time.
export
The e x p o r t property allows messages published by a client to a topic to be
exported to the external systems with configured transports.
You can set e x p o r t using the form:
e x p o r t = " list"
where list is one or more transport names, as specified by the [transport_name] ids in
the t r a n s p o r t s . c o n f file. Multiple transport names in the list are separated by
commas.
For example:
export="RV1,RV2"
flowControl
The f l o w C o n t r o l property specifies the target maximum size the server can use
to store pending messages for the destination. Should the number of messages
exceed the maximum, the server will slow down the producers to the rate
required by the message consumers. This is useful when message producers send
messages much more quickly than message consumers can consume them. Unlike
the behavior established by the o v e r f l o w P o l i c y property, f l o w C o n t r o l never
discards messages or generates errors back to producer.
You can set f l o w C o n t r o l using the form:
f l o w C o n t r o l =size[ K B | M B | G B ]
where size is the maximum number of bytes of storage for pending messages of
the destination. If you specify the f l o w C o n t r o l property without a value, the
target maximum is set to 256KB.
You can optionally include a KB, MB or GB after the number to specify kilobytes,
megabytes, or gigabytes, respectively. For example:
global
Messages destined for a topic or queue with the g l o b a l property set are routed to
the other servers that are participating in routing with this server.
You can set g l o b a l using the form:
global
For further information on routing between servers, see Chapter 20, Working
With Routes, on page 485.
import
The i m p o r t property allows messages published by an external system to be
received by a EMS destination (a topic or a queue), as long as the transport to the
external system is configured.
You can set i m p o r t using the form:
i m p o r t = " list"
where list is one or more transport names, as specified by the [NAME] ids in the
t r a n s p o r t s . c o n f file. Multiple transport names in the list are separated by
commas. For example:
import="RV1,RV2"
maxbytes
Topics and queues can specify the m a x b y t e s property in the form:
m a x b y t e s = value[ K B | M B | G B ]
When a destination inherits different values of this property from several parent
destinations, it inherits the smallest value.
maxmsgs
Topics and queues can specify the m a x m s g s property in the form:
m a x m s g s = value
where value defines the maximum number of messages that can be waiting in a
queue. When adding a message would exceed this limit, the server does not
accept the message into storage, and the message producer’s send call returns an
error (but see also o v e r f l o w P o l i c y ).
If m a x m s g s is zero, or is not set, the server does not limit the number of messages
in the queue.
You can set both m a x m s g s and m a x b y t e s properties on the same queue. Exceeding
either limit causes the server to reject new messages until consumers reduce the
queue size to below these limits.
maxRedelivery
The m a x R e d e l i v e r y property specifies the number of attempts the server should
make to deliver a message sent to a queue. Set m a x R e d e l i v e r y using the form:
m a x R e d e l i v e r y = count
where count is an integer between 2 and 255 that specifies the maximum number
of times a message can be delivered to receivers. A value of zero disables
m a x R e d e l i v e r y, so there is no maximum.
Once the server has attempted to deliver the message the specified number of
times, the message is either destroyed or, if the
J M S _ T I B C O _ P R E S E R V E _ U N D E L I V E R E D property on the message is set to t r u e , the
message is placed on the undelivered queue so it can be handled by a special
consumer. See Undelivered Message Queue on page 20 for details.
overflowPolicy
Topics and queues can specify the o v e r f l o w P o l i c y property to change the effect
of exceeding the message capacity established by either m a x b y t e s or m a x m s g s .
Set the o v e r f l o w P o l i c y using the form:
overflowPolicy=default|discardOld|rejectIncoming
default
For topics, d e f a u l t specifies that messages are sent to each subscriber in turn. If
the m a x b y t e s or m a x m s g s setting has been reached for a subscriber, that subscriber
does not receive the message. No error is returned to the message producer.
For queues, d e f a u l t specifies that new messages are rejected by the server and an
error is returned to the producer if the established m a x b y t e s or m a x m s g s value has
been exceeded.
Note that this is the same default behavior for topics and queues as in EMS 4.3.
discardOld
For topics, d i s c a r d O l d specifies that, if any of the subscribers have an
outstanding number of undelivered messages on the server that are over the
message limit, the oldest messages are discarded before they are delivered to the
subscriber.
The d i s c a r d O l d setting impacts subscribers individually. For example, you might
have three subscribers to a topic, but only one subscriber exceeds the message
limit. In this case, only the oldest messages for the one subscriber are discarded,
while the other two subscribers continue to receive all of their messages.
When messages are discarded for topic subscribers, no error is returned to the
producer because messages could be delivered to some subscribers and discarded
for others.
For queues, d i s c a r d O l d specifies that, if messages on the queue have exceeded
the m a x b y t e s or m a x m s g s value, the oldest messages are discarded from the
queue and an error is returned to the message producer.
rejectIncoming
For topics, r e j e c t I n c o m i n g specifies that, if any of the subscribers have an
outstanding number of undelivered messages on the server that are over the
message limit, all new messages are rejected and an error is returned to the
producer.
For queues, r e j e c t I n c o m i n g specifies that, if messages on the queue have
exceeded the m a x b y t e s or m a x m s g s value, all new messages are rejected and an
error is returned to the producer. (This is the same as the d e f a u l t behavior.)
Examples
To discard messages on m y Q u e u e when the number of queued messages exceeds
1000, enter:
setprop queue myQueue maxmsgs=1000,overflowPolicy=discardOld
prefetch
The message consumer portion of a client and the server cooperate to regulate
fetching according to the p r e f e t c h property. The p r e f e t c h property applies to
both topics and queues.
You can set p r e f e t c h using the form:
p r e f e t c h = value
Table 13 Prefetch
Value Description
2 or more The message consumer automatically fetches messages from the
server. The message consumer never fetches more than the
number of messages specified by value.
See Automatic Fetch Enabled on page 66 for details.
none Disables automatic fetch. That is, the message consumer initiates
fetch only when the client calls r e c e i v e —either an explicit
synchronous call, or an implicit call (in an asynchronous
consumer).
This value cannot be used with topics or global queues.
See Automatic Fetch Disabled on page 67 for details.
Background
Delivering messages from the server destination to a message consumer involves
two independent phases—fetch and accept:
• The fetch phase is a two-step interaction between a message consumer and the
server.
— The message consumer initiates the fetch phase by signalling to the server
that it is ready for more messages.
— The server responds by transferring one or more messages to the client,
which stores them in the message consumer.
• In the accept phase, client code takes a message from the message consumer.
The r e c e i v e call embraces both of these phases. It initiates fetch when needed
and it accepts a message from the message consumer.
To reduce waiting time for client programs, the message consumer can prefetch
messages—that is, fetch a batch of messages from the server, and hold them for
client code to accept, one by one.
Inheritance
When a destination inherits the p r e f e t c h property from parent destination with
matching names, these behaviors are possible:
• When all parent destinations set the value n o n e , then the child destination
inherits the value n o n e .
• When any parent destination sets a non-zero numeric value, then the child
destination inherits the largest value from among the entire parent chain.
• When none of the parent destinations sets any non-zero numeric value, then
the child destination uses the default value (which is 5).
redeliverydelay
When r e d e l i v e r y d e l a y is set, the EMS server waits the specified interval before
returning an unacknowledged message to the queue. When a previously
delivered message did not receive a successful acknowledgement, the EMS server
waits the specified redelivery delay before making the message available again in
the queue. This is most likely to occur in the event of a transaction rollback,
session or message recovery, session or connection close, or the abrupt exit of a
client application. However, note that the delay time is not exact, and in most
situations will exceed the specified r e d e l i v e r y d e l a y.
The value can be specified in seconds, minutes, or hours. The value may be in the
range of 15 seconds and 8 hours.
You can set r e d e l i v e r y d e l a y using the form:
r e d e l i v e r y d e l a y = time[ s e c | m i n | h o u r ]
where time is the number of seconds. Zero is a special value that indicates no
redelivery delay.
You can optionally include time units, such as s e c , m i n , or h o u r describe the time
value as being in seconds, minutes, or hours, respectively. For example:
redeliverydelay=30min
secure
When the s e c u r e property is enabled for a destination, it instructs the server to
check user permissions whenever a user attempts to perform an operation on that
destination.
You can set s e c u r e using the form:
secure
If the s e c u r e property is not set for a destination, the server does not check
permissions for that destination and any authenticated user can perform any
operation on that topic or queue.
See Chapter 8, Authentication and Permissions, on page 247 for more information
on permissions and the s e c u r e property.
sender_name
The s e n d e r _ n a m e property specifies that the server may include the sender’s
username for messages sent to this destination.
You can set s e n d e r _ n a m e using the form:
sender_name
When the s e n d e r _ n a m e property is enabled, the server takes the user name
supplied by the message producer when the connection is established and places
that user name into the J M S _ T I B C O _ S E N D E R property in the message.
The message producer can override this behavior by specifying a property on a
message. If a message producer sets the J M S _ T I B C O _ D I S A B L E _ S E N D E R property
to true for a message, the server overrides the s e n d e r _ n a m e property and does
not add the sender name to the message.
If authentication for the server is turned off, the server places whatever user name
the message producer supplied when the message producer created a connection
to the server. If authentication for the server is enabled, the server authenticates
the user name supplied by the connection and the user name placed in the
message property will be an authenticated user. If SSL is used, the SSL connection
protocol guarantees the client is authenticated using the client’s digital certificate.
sender_name_enforced
The s e n d e r _ n a m e _ e n f o r c e d property specifies that messages sent to this
destination must include the sender’s user name. The server retrieves the user
name of the message producer using the same procedure described in the
s e n d e r _ n a m e property above. However, unlike, the s e n d e r _ n a m e property, there
is no way for message producers to override this property.
You can set s e n d e r _ n a m e _ e n f o r c e d using the form:
sender_name_enforced
In some business situations, clients may not be willing to disclose the username of
their message producers. If this is the case, these clients may wish to avoid
sending messages to destinations that have the s e n d e r _ n a m e or
s e n d e r _ n a m e _ e n f o r c e d properties enabled.
In these situations, the operator of the EMS server should develop a policy for
disclosing a list of destinations that have these properties enabled. This will allow
clients to avoid sending messages to destinations that would cause their message
producer usernames to be exposed.
store
The s t o r e property determines where messages sent to this destination are
stored. Messages may be stored in a file, or in a database. See Store Messages in
Multiple Stores on page 29 for more information on using and configuring
multiple stores.
Only one store is allowed for each destination. If there is a conflict, for example if
overlapping wildcards cause a topic to inherit multiple store properties, the topic
creation will fail.
This parameter cannot be used without first enabling this feature in the
t i b e m s d . c o n f file. The s t o r e s . c o n f file must also exist, but can be left empty if
the only store names that are associated with destinations are the default store
files.
See Store Messages in Multiple Stores on page 29 for more information.
trace
The t r a c e property specifies that tracing should be enabled for this destination.
You can set t r a c e using the form:
trace = [body]
The queue and topic data stored on the EMS server is located in the q u e u e s . c o n f
and t o p i c s . c o n f files, respectively. You can use the s h o w q u e u e s and s h o w
t o p i c s commands to list all of the queues and topics on your EMS server and the
s h o w q u e u e and s h o w t o p i c commands to show the configuration details of
specific queues and topics.
A queue or topic may include optional properties that define the specific
characteristics of the destination. These properties are described in Destination
Properties on page 55 and they can be specified when creating the queue or topic
or modified for an existing queue or topic using the a d d p r o p q u e u e , a d d p r o p
t o p i c , s e t p r o p q u e u e , s e t p r o p t o p i c , r e m o v e p r o p q u e u e , and r e m o v e p r o p
t o p i c commands.
Wildcards
Matches f o o . b a r, f o o . b o o , f o o . b o o . b a r, and f o o . b a r . b o o .
• The wildcard * means that any token can be in the place of * . For example:
foo.*
• store
Wildcards in Topics
TIBCO Enterprise Message Service enables you to use wildcards in topic names in
some situations:
• You can subscribe to wildcard topics.
If you subscribe to a topic containing a wildcard, you will receive any message
published to a matching topic. For example, if you subscribe to f o o . * you will
receive messages published to a topic named f o o . b a r.
You can subscribe to a wildcard topic (for example f o o . *), whether or not
there is a matching topic in the configuration file (for example, f o o . *, f o o . > ,
or f o o . b a r ). However, if there is no matching topic name in the configuration
file, no messages will be published on that topic.
• You cannot publish to wildcard topics.
• If f o o . b a r is not in the configuration file, then you can publish to f o o . b a r if
foo.* or f o o . > exists in the configuration file.
Wildcards in Queues
TIBCO Enterprise Message Service enables you to use wildcards in queue names
in some situations. You can neither send to nor receive from wildcard queue
names. However, you can use wildcard queue names in the configuration files.
For example, if the queue configuration file includes a line:
foo.*
Examples
• If the q u e u e s . c o n f file contains:
>
The EMS server can dynamically create a queue with any name.
• If the t o p i c s . c o n f file contains only:
foo.>
The EMS server can dynamically create topics with names like f o o . b a r,
f o o . b o o , f o o . b o o . b a r, and f o o . b a r . b o o .
The EMS server can dynamically create queues with names like f o o . b a r and
f o o . b o o , but not f o o . b a r . b o o .
The EMS server can dynamically create topics with names like f o o . b o o . b a r,
but not f o o . b a r.
Inheritance
This section describes the inheritance of properties and permissions. For more
information on wildcards, refer to Wildcards on page 74. For more information on
destination properties, refer to Destination Properties on page 55. For more
information on permissions, refer to Chapter 8, Authentication and Permissions,
on page 247.
Inheritance of Properties
All destination properties are inheritable for both topics and queues. This means
that a property set for a "wildcarded" destination is inherited by all destinations
with matching names.
For example, if you have the following in your t o p i c s . c o n f file:
foo.* secure
foo.bar
foo.bob
foo.bar sender_name
foo.bar maxbytes=2000
When there are multiple ancestors for a destination, the destination inherits the
properties from all of the parents. For example:
> sender_name
foo.* secure
foo.bar trace
foo.* maxbytes=200
foo.bar
you make every topic store messages, regardless of additional entries. This might
require a great deal of memory for storage and greatly decrease the system
performance.
Inheritance of Permissions
Inheritance of permissions is similar to inheritance of properties. If the parent has
a permission, then the child inherits that permission. For example, if Bob belongs
to GroupA, and GroupA has p u b l i s h permission on a topic, then Bob has
p u b l i s h permission on that topic.
Permissions for a single user are the union of the permissions set for that user, and
of all permissions set for every group in which the user is a member. These
permission sets are additive. Permissions have positive boolean inheritance. Once
a permission right has been granted through inheritance, it can not be removed.
All rules for wildcards apply to inheritance of permissions. For example, if a user
has permission to publish on topic f o o . *, the user also has permission to publish
on f o o . b a r and f o o . n e w.
For more information on wildcards, refer to Wildcards on page 74. For more
information on permissions, refer to User Permissions on page 265.
Destination Bridges
Some applications require the same message to be sent to more than one
destination, possibly of different types. For example, an application may send
messages to a queue for distributed load balancing. That same application,
however, may also need the messages to be published to several monitoring
applications. Another example is an application that publishes messages to
several topics. All messages however, must also be sent to a database for backup
and for data mining. A queue is used to collect all messages and send them to the
database.
An application can process messages so that they are sent multiple times to the
required destinations. However, such processing requires significant coding effort
in the application. EMS provides a server-based solution to this problem. You can
create bridges between destinations so that messages sent to one destination are
also delivered to all bridged destinations.
Bridges are created between one destination and one or more other destinations
of the same or of different types. That is, you can create a bridge from a topic to a
queue or from a queue to a topic. You can also create a bridge between one
destination and multiple destinations. For example, you can create a bridge from
topic a . b to queue q . b and topic a . c .
When specifying a bridge, you can specify a particular destination name, or you
can use wildcards. For example, if you specify a bridge on topic f o o . * to queue
f o o . q u e u e , messages delivered to any topic matching f o o . * are sent to
foo.queue.
Because global topics are routed between servers and global queues are limited to
their neighbors, in most cases the best practice is to send messages to a topic and
then bridge the topic to a queue.
When multiple bridges exist, using wildcards to specify a destination name may
result in a message being delivered twice. For example, if the queues Q . 1 and Q . >
are both bridged to Q X . 1 , the server will deliver two copies of sent messages to
QX.1.
Topic
Publisher
A.B
Subscriber
Queue
queue.B Consumer
Consumer
Topic
Publisher
A.B
Subscriber
Queue Topic
queue.B C.B
Subscriber
Consumer
Queue Consumer
Publisher
queue.foo
Subscriber
Queue Topic
queue.bar topic.foo
Subscriber
Consumer
When a bridge exists between two queues, the message is delivered to both
queues. The queues operate independently; if the message is retrieved from one
queue, that has no effect on the status of the message in the second queue.
Bridges are not transitive. That is, messages sent to a destination with a bridge are
only delivered to the specified bridged destinations and are not delivered across
multiple bridges. For example, topic A . B has a bridge to queue Q . B . Queue Q . B
has a bridge to topic B . C . Messages delivered to A . B are also delivered to Q . B , but
not to B . C .
The bridge copies the source message to the target destination, which assigns the
copied message a new message identifier. Note that additional storage may be
required, depending on the target destination store parameters.
Creating a Bridge
Bridges are configured in the b r i d g e s . c o n f configuration file. You specify a
bridge using the following syntax:
[ destinationType: destinationName]
destinationType= destinationToBridgeTo s e l e c t o r = " messageSelector"
where destinationType is the type of the destination (either t o p i c or q u e u e ),
destinationName is the name of the destination from which you wish to create a
bridge, destinationToBridgeTo is the name of the destination you wish to create a
bridge to, and s e l e c t o r = " messsgeSelector" is an optional message selector to
specify the subset of messages the destination should receive.
For detailed information about message selector syntax, see the documentation
for the M e s s a g e class in the relevant EMS API reference document.
Transactions
When a message producer sends a message within a transaction, all messages
sent across a bridge are part of the transaction. Therefore, if the transaction
succeeds, all messages are delivered to all bridged destinations. If the transaction
fails, no consumers for bridged destinations receive the messages.
Flow Control
In some situations, message producers may send messages more rapidly than
message consumers can receive them. The pending messages for a destination are
stored by the server until they can be delivered, and the server can potentially
exhaust its storage capacity if the message consumers do not receive messages
quickly enough. To avoid this, EMS allows you to control the flow of messages to
a destination. Each destination can specify a target maximum size for storing
pending messages. When the target is reached, EMS blocks message producers
when new messages are sent. This effectively slows down message producers
until the message consumers can receive the pending messages.
If there are no message consumers for a destination, the server does not enforce
flow control for the destination. That is, if a queue has no started receivers, the
server cannot enforce flow control for that queue. Also, if a topic has inactive
durable subscriptions or no current subscribers, the server cannot enforce flow
control for that topic. For topics, if flow control is set on a specific topic (for
example, f o o . b a r ), then flow control is enforced as long as there are subscribers
to that topic or any parent topic (for example, if there are subscribers to f o o . * ).
Dependency
Topics
The EMS sample clients were designed to allow you to run TIBCO Enterprise
Message Service with minimum start-up time and coding.
The EMS_HOME/ s a m p l e s directory contains the / c , / c s , and / j a v a
subdirectories, which contain the C,.NET and Java sample clients. In this chapter,
you will compile and run the Java sample clients. For information on how to run
the C and .NET sample clients, see the readme files in their respective directories.
The EMS_HOME/ s a m p l e s / j a v a directory contains three sets of files:
• Sample clients for TIBCO Enterprise Message Service implementation.
• The j m s / s a m p l e s / j a v a / J N D I subdirectory contains sample clients that use
the JNDI lookup technique.
• The j m s / s a m p l e s / j a v a / t i b r v subdirectory contains sample clients that
demonstrate the interoperation of TIBCO Enterprise Message Service with
TIBCO Rendezvous applications.
In this chapter, you will use some of the sample clients in the
EMS_HOME/ s a m p l e s / j a v a directory. For information on compiling and running
the other sample clients, see the Readme files in their respective folders.
To compile and run the sample clients you need to execute "setup" script, which is
located in the EMS_HOME/ s a m p l e s / j a v a directory. On Windows systems, the
setup file is s e t u p . b a t . On Unix systems, the setup file is s e t u p . s h .
To compile the sample client files:
1. Make sure you have Java JDK 1.5 or greater installed and that you’ve added
the bin directory to your PATH variable.
2. Open a command line or console window, and navigate to the
EMS_HOME/ s a m p l e s / j a v a directory.
3. Open the correct s e t u p script file and verify that the T I B E M S _ R O O T
environment variable identifies the correct pathname to your EMS_HOME
directory. For example, on a Windows system this might look like:
set TIBEMS_ROOT=C:\tibco\ems\6.0
This compiles all the samples in the directory, except for those samples in the
J N D I and t i b r v subdirectories.
If the files compile successfully, the class files will appear in the
EMS_HOME/ s a m p l e s / j a v a directory. If they do not compile correctly, an
error message appears.
This section describes how to start the EMS server and use the administration tool
to create two new users.
All of the parameters you set using the administration tool in this chapter can also
be set by editing the configuration files described in Using the Configuration Files
on page 171. You can also programmatically set parameters using the C, .NET, or
Java APIs. Parameters set programmatically by a client are only set for the length
of the session.
On a computer running Windows, you can also start the EMS server from the
Start menu, following the path Programs > TIBCO > TIBCO EMS 6.0 > Start
EMS server.
On a computer running Windows, you can also start the administration tool from
the Start menu, following the path Programs > TIBCO > TIBCO EMS 6.0 > Start
EMS administration tool.
You will be prompted for a login name. If this is the first time you’ve used the
EMS administration tool, follow the procedure described in When You First
Start tibemsadmin on page 118.
Once you have logged in, the screen will display:
connected to tcp://localhost:7222
tcp://localhost:7222>
• If you are using TIBCO Enterprise Message Service in a network, use the
connect server command as follows:
> c o n n e c t [ server URL] [ user-name] [ password]
For more information on this command, see c o n n e c t on page 122.
For further information on the administration tool, see Starting the EMS
Administration Tool on page 116 and Command Listing on page 120.
Create Users
Once you have connected the administration tool to the server, use the c r e a t e
u s e r command to create two users.
The tool will display messages confirming that u s e r 1 and user2 have been
created.
You have now created two users. You can confirm this with the s h o w users
command:
tcp://localhost:7222> show users
User Name Description
user1
user2
Create a Queue
In the point-to-point messaging model, client send messages to and receive
messages from a queue.
To create a new queue in the administration tool, use the c r e a t e queue
command to create a new queue named m y Q u e u e :
tcp://localhost:7222> create queue myQueue
The messages placed on the queue are displayed in the receiver’s window.
Messages placed on a queue by the sender are persistent until read by the
receiver, so you can start the sender and receiver clients in any order.
In this section, you will execute a message producer client and two message
consumer clients that demonstrate the publish/subscribe messaging model
described in Publish and Subscribe on page 4. This example is not intended to be
comprehensive or representative of a robust application.
To execute the client samples, you must give them commands from within the
sample directory that contains the compiled samples. For this exercise, open three
separate command line windows and navigate to the EMS_HOME/ s a m p l e s / j a v a
directory in each window.
For more information on the samples, refer to the r e a d m e within the sample
directory. For more information on compiling the samples, refer to Compiling the
Sample Clients on page 89.
Create a Topic
In the publish/subscribe model, you publish and subscribe to topics.
To create a new topic in the administration tool, use the c r e a t e topic command
to create a new topic named m y T o p i c :
tcp://localhost:7222> create topic myTopic
To start u s e r 2 as a subscriber:
1. In the second command line window, navigate to the
EMS_HOME/ s a m p l e s / j a v a folder.
2. Enter s e t u p to set the environment and classpath:
> setup
The command windows do not return to the prompt when the subscribers are
running.
The command line window will display a message stating that both messages
have been published:
Publishing on topic 'myTopic'
After the messages are published, the command window for the publisher returns
to the prompt for further message publishing.
without adding the messages, you will see an error message, reminding you that
you must have at least one message text.
The first and second command line windows containing the subscribers will
show that each subscriber received the two messages:
Subscribing to topic: myTopic
Received message: TextMessage={ Header={
JMSMessageID={ID:EMS-SERVER.97C44203CDF A:1}
JMSDestination={Topic[myTopic]} JMSReplyTo={null}
JMSDeliveryMode={PERSISTENT} JMSRedelivered={false}
JMSCorrelationID={null} JMSType={null} JMSTimestamp={Tue Mar 21
12:04:56 PST 2006} JMSExpiration={0} JMSPriority={4} }
Properties={} Text={hello} }
Received message: TextMessage={ Header={
JMSMessageID={ID:EMS-SERVER.97C44203CDFA:2}
JMSDestination={Topic[myTopic]} JMSReplyTo={null}
JMSDeliveryMode={PERSISTENT} JMSRedelivered={false}
JMSCorrelationID={null} JMSType={null} JMSTimestamp={Tue Mar 21
12:04:56 PST 2006} JMSExpiration={0} JMSPriority={4} }
Properties={} Text={user2} }
You will be asked to restart the server once it has been configured for multicast.
multicast = enabled
On a computer running a UNIX system, the EMS server (as well as the multicast
daemon) must have root privileges. This can be done either by running the EMS
server from a root user account, or the EMS server can be setuid (set user ID) root,
allowing any user to run t i b e m s d with the required root privileges. Root
privileges are required because multicast uses raw sockets.
On a computer running Windows, you can also start the EMS server from the
Start menu, following the path Programs > TIBCO > TIBCO EMS 6.0 > Start
EMS server.
To use TIBCO Enterprise Message Service with your applications, the TIBCO
Enterprise Message Service Server must be running. The server and the clients
work together to implement TIBCO Enterprise Message Service. The server
implements all types of message persistence and no messages are stored on the
client side.
Topics
This section describes how to start and stop the EMS server.
On a computer running Microsoft Windows, you can start the EMS server from
the Start menu, following the path: Programs > TIBCO > TIBCO EMS 6.0 > Start
EMS Server
On UNIX systems that will run TIBCO Enterprise Message Service with multicast,
the EMS server must have root privileges. This can be done either by running the
EMS server from a root user account, or the EMS server can be setuid (set user ID)
root, allowing any user to run t i b e m s d with the required root privileges. Root
privileges are required because multicast uses raw sockets.
Similarly, on Windows systems the t i b e m s d . e x e and t i b e m s m c d . e x e files run as
administrator to enable multicast functionality and to let the t i b e m s d . e x e
modify the configuration files.
On UNIX tibemsd.sh
On Windows tibemsd.bat
Running the script starts the EMS server using the configuration files in the
default location, config-file-directory\ c f m g m t \ e m s \ d a t a directory, where the
config-file-directory corresponds to the Configuration Directory specified during
installation.
On Windows . \ t i b e m s d - c o n f i g “ config-file-directory\ c f m g m t \ e m s \ d a t a \ t i b e m s d . c o n f ”
where options are described in Table 14. The command options to t i b e m s d are
similar to the parameters you specify in t i b e m s d . c o n f , and the command
options override any value specified in the parameters. See t i b e m s d . c o n f on
page 173 for more information about configuration parameters.
Option Description
-config config file name config file name is the name of the main configuration file for t i b e m s d
server. Default is t i b e m s d . c o n f .
-trace items Specifies the trace items. These items are not stored in the
configuration file. The value has the same format as the value of
l o g _ t r a c e parameter specified with s e t s e r v e r command of the
administration tool; see Tracing on the Server on page 423.
-ssl_trace Print the certificates loaded by the server and do more detailed
tracing of SSL-related situation.
Option Description
-ssl_debug_trace Turns on tracing of SSL connections.
-ft_active active_url URL of the active server. If this server can connect to the active
server, it will act as a backup server. If this server cannot connect to
the active server, it will become the active server.
-ft_heartbeat seconds Heartbeat signal for the active server, in seconds. Default is 3.
-forceStart Causes the sever to delete corrupted messages in the store files,
allowing the server to start even if it encounters errors.
Note that using this option causes data loss, and it is important to
backup store files before using - f o r c e S t a r t . See Error Recovery
Policy on page 108 for more information.
Some situations require the EMS server and multicast daemon processes to start
automatically. You can satisfy this requirement by registering these with the
Windows service manager. The e m s n t s r g utility facilitates registry.
emsntsrg
The e m s n t s r g utility registers or unregisters the EMS server daemon or the EMS
multicast daemon as a Windows service.
This utility applies only to Microsoft Windows (all supported versions, including
2003, XP, and Vista).
Remarks Some situations require the EMS server processes to start automatically. You can
satisfy this requirement by registering these with the Windows service manager.
This utility facilitates registry.
Restrictions You must have administrator privileges to change the Windows registry.
Location Locate this utility program as an executable file in the EMS b i n directory.
Parameter Description
/i Insert a new service in the registry (that is, register a new service).
/? Display usage.
Parameter Description
emsntsct_directory Use this directory pathname to specify the location of the e m s n t s c t . e x e
executable. The e m s n t s r g utility registers the e m s n t s c t . e x e program as a
windows service. The e m s n t s c t . e x e program then invokes the associated
tibemsd or tibemsmcd.
By default, e m s n t s c t . e x e is located in EMS_HOME\ b i n .
This parameter is only required when installing a service.
service_directory Use this directory pathname to locate the service executable, either t i b e m s d or
t i b e m s m c d . Required.
suffix When registering more than one instance of a service, you can use this suffix to
distinguish between them in the Windows services applet. Optional.
Register To register t i b e m s d as a Windows service, run the utility with this command line:
emsntsrg /i [/a] tibemsd emsntsct_directory tibemsd_directory [ arguments]
[ suffix]
Example 3 This pair of example commands registers two t i b e m s d services with different
configuration files. In this example, the numerical suffix and the configuration
directory both reflect the port number that the service uses.
emsntsrg /i tibemsd C:\tibco\ems\6.0\bin C:\tibco\ems\6.0\bin
"-config C:\tibco\ems\6.0\7222\tibemsd.conf" 7222
Example 5 This example registers a multicast daemon service with command line
arguments:
emsntsrg /i tibemsmcd C:\tibco\ems\6.0\bin C:\tibco\ems\6.0\bin
"-logfile c:\tibemsmcd.log"
Note that specifying a log file can help identify conflicts that might prevent the
multicast daemon service from starting.
Example 6 This pair of example commands registers two multicast daemon services with
different ports. In this example, the numerical suffix reflects the port number that
the service uses.
emsntsrg /i tibemsmcd C:\tibco\ems\6.0\bin C:\tibco\ems\6.0\bin
"-listen 7345" 7345
Remove To unregister a service, run the utility with this command line:
e m s n t s r g / r [ service_name] [ suffix]
Command To view a command line summary, run the utility with this command line:
Summary emsntsrg
Windows The Windows services applet displays the name of each registered service. For
Services Applet EMS services, it also displays this additional information:
• The suffix (if you supply one)
• The process ID (PID)—when the service is running
During startup the EMS server can encounter a number of errors while it recovers
information from the store files. Potential errors include:
• Low-level file errors. For example, corrupted disk records.
• Low-level object-specific errors. For example, a record that is missing an
expected field.
• Inter-object errors. For example, a session record with no corresponding
connection record.
When the EMS server encounters one of these errors during startup, the recovery
policy is:
• By default, the server exits startup completely when a corrupt disk record
error is detected. Because the state can not be safely restored, the server can
not proceed with the rest of the recovery. You can then examine your
configuration settings for errors. If necessary, you can then copy the store and
configuration files for examination by TIBCO Support.
• You can direct the server to delete bad records by including the - f o r c e S t a r t
command line option. This prevents corruption of the server runtime state.
• The server exits if it runs out of memory during startup.
It is important to backup the store files before restarting the server with the
-forceStart option, because data will be lost when the problematic records are
deleted.
Keep in mind that different type of records are stored in the store files. The most
obvious are the persistent JMS Messages that your applications have sent.
However, other internal records are also stored. If a consumer record used to
persist durable subscriber state information were to be corrupted and later
deleted with the - f o r c e S t a r t option, all JMS messages that were persisted (and
valid in the sense that they were not corrupted) would also be lost because the
durable subscription itself would not be recovered.
When running in this mode, the server still reports any errors found during the
recovery, but problematic records are deleted and the recovery proceeds. This
mode may report more issues than are reported without the - f o r c e S t a r t option,
because without that flag the server stops with the very first error.
We strongly recommended that you make a backup of all store files before
restarting the server with the - f o r c e S t a r t option. The backup is useful when
doing a postmortem analysis to find out what records where deleted with the
- f o r c e S t a r t option.
Security Considerations
Secure Environment
To ensure secure deployment, EMS administration must meet the following
criteria:
• Correct Installation EMS is correctly installed and configured.
• Physical Controls The computers where EMS is installed are located in areas
where physical entry is controlled to prevent unauthorized access. Only
authorized administrators have access, and they cooperate in a benign
environment.
• Domain Control The operating system, file system and network protocols
ensure domain separation for EMS, to prevent unauthorized access to the
server, its configuration files, LDAP servers, etc.
• Benign Environment Only authorized administrators have physical access or
domain access, and those administrators cooperate in a benign environment.
Destination Security
Three interacting factors affect the security of destinations (that is, topics and
queues). In a secure deployment, you must properly configure all three of these
items:
• The server’s a u t h o r i z a t i o n parameter (see Authorization Parameter, below)
• The s e c u r e property of individual destinations (see s e c u r e on page 68)
• The ACL permissions that apply to individual destinations (see
Authentication and Permissions on page 247)
Authorization Parameter
The server’s a u t h o r i z a t i o n parameter acts as a master switch for checking
permissions for connection requests and operations on secure destinations. The
default value of this parameter is d i s a b l e d —the server does not check any
permissions, and allows all operations. For secure deployment, you must enable
this parameter.
Admin Password
For ease in installation and initial testing, the default setting for the a d m i n
password is no password at all. Until you set an actual password, the user a d m i n
can connect without a password. Once the administrator password has been set,
the server always requires it.
To configure a secure deployment, the administrator must change the a d m i n
password immediately after installation; see Assign a Password to the
Administrator on page 118.
Connection Security
When a u t h o r i z a t i o n is enabled, the server requires a name and password
before users can connect. Only authenticated users can connect to the server. The
form of authentication can be either an X.509 certificate or a username and
password (or both).
When a u t h o r i z a t i o n is disabled, the server does not check user authentication;
all user connections are allowed. However, even when a u t h o r i z a t i o n is
disabled, the user a d m i n must still supply the correct password to connect to the
server.
Even when a u t h o r i z a t i o n is enabled, the administrator (a d m i n ) may explicitly
allow anonymous user connections, which do not require password
authorization. To allow these connections, create a user with the name a n o n y m o u s
and no password.
Creating the user a n o n y m o u s does not mean that a n o n y m o u s has all permissions.
Individual topics and queues can still be secure, and the ability to use these
destinations (either sending or receiving) is controlled by the access control list of
permissions for those destinations. The user a n o n y m o u s can access only
non-secure destinations.
Nonetheless, this feature (anonymous user connections) is outside the tested
configuration of EMS security certification.
Communication Security
For communication security between servers and clients, and between servers
and other servers, you must explicitly configure SSL within EMS; see Using the
SSL Protocol on page 441.
SSL communication requires software to implement SSL on both server and
client. The EMS server includes the OpenSSL implementation. Java client
programs must use either JSSE (part of the Java environment) or separately
purchased SSL software from Entrust; neither of these are part of the EMS
product. C client programs can use the OpenSSL library shipped with EMS.
Timestamp
The administration tool can either include or omit a timestamp associated with
the output of each command. To ensure a secure deployment, you must explicitly
enable the timestamp feature. Use the following administration tool command:
time on
Passwords
EMS software does not automatically enforce such standards for passwords. You
must enforce such policies within your organization.
To prevent two EMS servers from using the same store file, each server restricts
access to its store file for the duration of the server process. This section describes
how EMS manages locked store files.
UNIX On UNIX platforms, servers use the standard f c n t l operating system call to
implement cooperative file locking:
struct flock fl;
int err;
fl.l_type = F_WRLCK;
fl.l_whence = 0;
fl.l_start = 0;
fl.l_len = 0;
This chapter gives an overview of commands and use in the administration tool
for TIBCO Enterprise Message Service.
Topics
On a computer running Windows, you can also start the administration tool from
the Start menu, following the path Programs > TIBCO > TIBCO EMS 6.0 > Start
EMS administration tool.
The EMS server must be started as described in Chapter 5, Running the EMS
Server, on page 101 before you start the EMS Administration Tool.
When a system uses shared configuration files, then actions performed using the
administration tool take effect only when connected to the active server. If you
have configured fault-tolerant servers and connect to the standby server, the
administration tool will print a message notifying you of this. Additionally, if the
administration tool is connected to the backup server, it will be disconnected
when a switchover occurs.
Option Description
-help or - h Print the help screen.
Option Description
-ignore Ignore errors when executing script file. This
parameter only ignores errors in command
execution but not syntax errors in the script.
Examples
tibemsadmin -server "tcp://host:7222"
tibemsadmin -server "tcp://host:7222" -user admin -password secret
Some options are needed when you choose to make a SSL connection. For more
information on SSL connections, refer to Chapter 18, Using the SSL Protocol,
page 441.
When you restart the administration tool and type c o n n e c t , the administration
tool now requires your password before connecting to the server.
For further information about setting and resetting passwords, refer to s e t
password on page 134.
Naming Conventions
Command Listing
The command line interface of the administration tool allows you to perform a
variety of functions. Note that when a system uses shared configuration files, the
actions performed using the administration tool take effect only when connected
to the active server.
Many of the commands listed below accept arguments that specify the names of
users, groups, topics or queues. For information about the syntax and that apply
to these names, see Naming Conventions on page 119.
Note that SSL commands are not listed in this table. SSL commands are listed in
several tables in Chapter 18, Using the SSL Protocol, on page 441.
add member
add member group_name user_name [ , user2, user3, . . . ]
Add one or more users to the group. User names that are not already defined are
added to the group as external users; see Administration Commands and
External Users and Groups on page 262.
addprop factory
addprop factory factory-name properties . . .
Adds properties to the factory. Property names are separated by spaces.
See f a c t o r i e s . c o n f on page 228 for the list of factory properties.
An example is:
addprop factory MyTopicFactory ssl_trusted=cert1.pem
ssl_trusted=cert2.pem ssl_verify_host=disabled
addprop queue
addprop queue queue-name properties, . . .
Adds properties to the queue. Property names are separated by commas.
For information on properties that can be assigned to queues, see Destination
Properties on page 55.
addprop route
addprop route route-name p r o p = v a l u e [ prop-value. . . ]
Adds properties to the route.
Destination (topic and queue) properties must be separated by commas but
properties of routes and factories are separated with spaces.
You can set the z o n e _ n a m e and z o n e _ t y p e parameters when creating a route, but
you cannot subsequently change them.
For route properties, see Configuring Routes and Zones on page 494.
For the configuration file r o u t e s . c o n f , see r o u t e s . c o n f on page 235.
addprop topic
addprop topic topic_name properties, . . .
Adds properties to the topic. Property names are separated by commas.
For information on properties that can be assigned to topics, see Destination
Properties on page 55.
autocommit
autocommit [on|off]
When autocommit is set to o n , the changes made to the configuration files are
automatically saved to disk after each command. When a u t o c o m m i t is set to o f f ,
you must manually use the c o m m i t command to save configuration changes to
the disk.
By default, autocommit is set to o n when interactively issuing commands.
Entering a u t o c o m m i t without parameters displays the current setting of
autocommit (o n or o f f ) .
Regardless of the autocommit setting, the EMS server acts on each admin
command immediately making it part of the configuration. The autocommit
feature only determines when the configuration is written to the files.
commit
commit
compact
compact store_name max_time
Compacts the store files for the specified store. Compaction is not available for
stores of type m s t o r e .
Since compaction can be a lengthy operation, and it blocks other database
operations, max_time specifies a time limit (in seconds) for the operation. Note that
m a x _ t i m e must be a number greater than zero.
If truncation is not enabled for the store file, the compact command will not
reduce the file size. Truncation is enabled using the f i l e _ t r u n c a t e parameter in
the s t o r e s . c o n f file. See s t o r e s . c o n f on page 237 for more information.
We recommend compacting the store files only when the U s e d Space usage is
30% or less (see s h o w s t o r e on page 161).
If you have not configured your EMS server application with multiple store files,
the c o m p a c t command syntax is:
compact store_type max_time
where store_type is:
• a, async, or a s y n c h r o n o u s to compact the asynchronous file.
• s, sync, or s y n c h r o n o u s to compact the synchronous file.
The file will not be compacted unless the s t o r e _ t r u n c a t e parameter is enabled
in the t i b e m s d . c o n f file.
connect
c o n n e c t [ server-url { a d m i n | user_name} password]
Connects the administration tool to the server. Any administrator can connect. An
administrator is either the a d m i n user, any user in the $ a d m i n group, or any user
that has administrator permissions enabled. See Administrator Permissions on
page 249 for more information about administrator permissions.
server-url is usually in the form:
protocol: / / host-name: port-number
for example:
tcp://myhost:7222
You can enter c o n n e c t with no other options and the administrative tool tries to
connect to the local server on the default port, which is 7 2 2 2 .
create bridge
c r e a t e b r i d g e s o u r c e = type: dest_name t a r g e t = type: dest_name
[ s e l e c t o r = selector]
create durable
create durable topic-name durable-name [ property, . . . , property]
Creates a static durable subscriber.
For descriptions of parameters and properties, and information about conflict
situations, see d u r a b l e s . c o n f on page 227.
create factory
create factory factory_name factory_parameters
Creates a new connection factory.
For descriptions of factory parameters, see f a c t o r i e s . c o n f on page 228.
create group
create group group_name " description"
Creates a new group of users.
Initially, the group is empty. You can use the a d d member command to add users
to the group.
create jndiname
create jndiname new_jndiname t o p i c | q u e u e | j n d i n a m e name
Creates a JNDI name for a topic or queue, or creates an alternate JNDI name for a
topic that already has a JNDI name.
For example:
create FOO jndiname BAR
will create new JNDI name F O O referring the same object referred by JNDI name
BAR
create queue
create queue queue_name [ properties]
Creates a queue with the specified name and properties. The possible queue
properties are described in Destination Properties on page 55. Properties are listed
in a comma-separated list, as described in q u e u e s . c o n f on page 234.
create route
create route name u r l = URL [ properties . . . ]
Creates a route.
The name must be the name of the other server to which the route connects.
The local server connects to the destination server at the specified URL. If you
have configured fault-tolerant servers, you may specify the URL as a
comma-separated list of URLs.
The route properties are listed in r o u t e s . c o n f on page 235 and are specified as a
space-separated list of parameter name and value pairs.
You can set the z o n e _ n a m e and z o n e _ t y p e parameters when creating a route, but
you cannot subsequently change them.
If a passive route with the specified name already exists, this command promotes
it to an active-active route; see Active and Passive Routes on page 493.
For additional information on route parameters, see Configuring Routes and
Zones on page 494.
create rvcmlistener
create rvcmlistener transport_name cm_name s u b j e c t
Registers an RVCM listener with the server so that any messages exported to a
t i b r v c m transport (including the first message sent) are guaranteed for the
specified listener. This causes the server to perform the TIBCO Rendezvous call
t i b r v c m T r a n s p o r t _ A d d L i s t e n e r.
create topic
create topic topic_name [ properties]
Creates a topic with specified name and properties. See Destination Properties on
page 55 for the list of properties. Properties are listed in a comma-separated list,
as described in t o p i c s . c o n f on page 241.
create user
create user user_name [ " user_description" ] [ password= password]
Creates a new user. Following the user name, you can add an optional description
of the user in quotes. The password is optional and can be added later using the
s e t p a s s w o r d command.
delete all
delete all users|groups|topics|queues|durables
[ topic-name-pattern| queue-name-pattern]
delete bridge
d e l e t e b r i d g e s o u r c e = type: dest_name t a r g e t = type: dest_name
Delete the bridge between the specified source and target destinations.
type is either t o p i c or q u e u e .
See Destination Bridges on page 79 for more information on bridges.
delete connection
delete connection connection-id
Delete the named connection for the client. The connection ID is shown in the first
column of the connection description printed by s h o w c o n n e c t i o n .
delete durable
delete durable durable-name clientID
Delete the named durable subscriber.
When both the durable name and the client ID are specified, the EMS Server looks
for a durable named clientID: durable-name in the list of durables. If a matching
durable subscriber is not found, the administration tool prints an error message
including the fully qualified durable name.
See also, Conflicting Specifications on page 227.
delete factory
delete factory factory-name
Delete the named connection factory.
delete group
delete group group-name
Delete the named group.
delete jndiname
delete jndiname jndiname
Delete the named JNDI name. Notice that deleting the last JNDI name of a
connection factory object will remove the connection factory object as well.
See Chapter 12, Using the EMS Implementation of JNDI, on page 335 for more
information.
delete message
delete message messageID
Delete the message with the specified message ID.
delete queue
delete queue queue-name
Delete the named queue.
delete route
delete route route-name
Delete the named route.
delete rvcmlistener
delete rvcmlistener transport_name cm_name subject
Unregister an RVCM listener with the server so that any messages being held for
the specified listener in the RVCM ledger are released. This causes the server to
perform the TIBCO Rendezvous call t i b r v c m T r a n s p o r t _ R e m o v e L i s t e n e r.
delete topic
delete topic topic-name
Delete the named topic.
delete user
delete user user-name
Delete the named user.
disconnect
disconnect
echo
echo [on|off]
Echo controls the reports that are printed into the standard output. When e c h o is
o f f the administrative tool only prints errors and the output of queries. When
e c h o is o n , the administrative tool report also contains a record of successful
command execution.
Choosing the parameter o n or o f f in this command controls e c h o . If e c h o is
entered in the command line without a parameter, it displays the current e c h o
setting (o n or o f f ). This command is used primarily for scripts.
The default setting for echo is o n .
exit
exit (aliases: quit, q, bye, end)
grant queue
grant queue queue-name u s e r = name | g r o u p = name permissions
Grants specified permissions to specified user or group on specified queue. The
name following the queue name is first checked to be a group name, then a user
name.
Specified permissions are added to any existing permissions. Multiple
permissions are separated by commas. Enter a l l in the permissions string if you
choose to grant all possible user permissions.
User permissions are:
• receive
• send
• browse
• create
• delete
• modify
• purge
grant topic
grant topic topic-name u s e r = name | g r o u p = name permissions
Grants specified permissions to specified user or group on specified topic. The
name following the topic name is first checked to be a group name, then a user
name.
Specified permissions are added to any existing permissions. Multiple
permissions are separated by commas. Enter a l l in the permissions string if you
choose to grant all possible permissions.
Topic permissions are:
• subscribe
• publish
• durable
• use_durable
For more information on topic permissions, see Table 39 in User Permissions on
page 265.
Destination-level administrator permissions can also be granted with this
command. The following are administrator permissions for topics.
• view
• create
• delete
• modify
• purge
grant admin
g r a n t a d m i n u s e r = name | g r o u p = name admin_permissions
Grant the named global administrator permissions to the named user or group.
For a complete listing of global administrator permissions, see Global
Administrator Permissions on page 251.
help
help (aliases: h, ?)
info
info (alias: i)
jaci clear
jaci clear
jaci resetstats
jaci resetstats
jaci showstats
jaci showstats
purge durable
purge durable durable-name
Purge all messages in the topic for the named durable subscriber
purge queue
purge queue queue-name
Purge all messages in the named queue.
purge topic
purge topic topic-name
Purge all messages for all subscribers on the named topic.
remove member
remove member group-name user-name[ , user2, user3, . . . ]
Remove one or more named users from the named group.
removeprop factory
removeprop factory factory-name properties
Remove the named properties from the named factory. See Connection Factory
Parameters on page 228 for a list of properties.
removeprop queue
removeprop queue queue-name properties
Remove the named properties from the named queue.
removeprop route
removeprop route route-name properties
Remove the named properties from the named route.
You cannot remove the URL.
You can set the z o n e _ n a m e and z o n e _ t y p e parameters when creating a route, but
you cannot subsequently change them.
For route parameters, see Configuring Routes and Zones on page 494.
For the configuration file r o u t e s . c o n f , see r o u t e s . c o n f on page 235.
removeprop topic
removeprop topic topic-name properties
Remove the named properties from the named topic.
resume route
resume route route-name
Resumes sending messages to named route, if messages were previously
suspended using the s u s p e n d r o u t e command.
revoke admin
r e v o k e a d m i n u s e r = name | g r o u p = name permissions
Revoke the specified global administrator permissions from the named user or
group. See Chapter 8, Authentication and Permissions, on page 247 for more
information about administrator permissions.
revoke queue
revoke queue queue-name u s e r = name | g r o u p = name permissions
revoke queue queue-name * [ u s e r | a d m i n | b o t h ]
Revoke the specified permissions from a user or group for the named queue.
User and group permissions for queues are r e c e i v e , s e n d , b r o w s e , and a l l .
Administrator permissions for queues are v i e w, c r e a t e , d e l e t e , m o d i f y, and
purge.
If you specify an asterisk (*), all user-level permissions on this queue are removed.
You can use the optional a d m i n parameter to revoke all administrative
permissions, or the b o t h parameter to revoke all user-level and administrative
permissions on the queue.
For more information, see Chapter 8, Authentication and Permissions, on
page 247.
revoke topic
revoke topic topic-name u s e r = name | g r o u p = name permissions
revoke topic topic-name * [ u s e r | a d m i n | b o t h ]
Revoke the specified permissions from a user or group for the named topic.
User and group permissions for topics are s u b s c r i b e , p u b l i s h , d u r a b l e ,
u s e _ d u r a b l e , and a l l . Administrator permissions for topics are v i e w, c r e a t e ,
d e l e t e , m o d i f y, and p u r g e .
If you specify an asterisk (*), all user-level permissions on this topic are removed.
You can use the optional a d m i n parameter to revoke all administrative
permissions, or the b o t h parameter to revoke all user-level and administrative
permissions on the topic.
For more information, see Chapter 8, Authentication and Permissions, on
page 247.
rotatelog
rotatelog
Force the current log file to be backed up and truncated. The server starts writing
entries to the newly empty log file.
The backup file name is the same as the current log file name with a sequence
number appended to the filename. The server queries the current log file
directory and determines what the highest sequence number is, then chooses the
next highest sequence number for the new backup name. For example, if the log
file name is t i b e m s . l o g and there is already a t i b e m s . l o g . 1 and t i b e m s . l o g . 2 ,
the server names the next backup t i b e m s . l o g . 3 .
set password
set password user-name [ password]
Set the password for the named user.
If you do not supply a password in the command, the server prompts you to type
one.
set server
set server parameter= value [ parameter= value . . . ]
The s e t s e r v e r command can control many parameters. Multiple parameters
are separated by spaces. Table 16 describes the parameters you can set with this
command.
Parameter Description
password [= string] Sets server password used by the server to
connect to other routed servers. If the value is
omitted it is prompted for by the
administration tool. Entered value will be
stored in the main server configuration file in
mangled form (but not encrypted).
To reset this password, enter the empty string
twice at the prompt.
Parameter Description
authorization=enabled|disabled Sets the a u t h o r i z a t i o n mode in the
t i b e m s d . c o n f file.
Parameter Description
l o g _ t r a c e = trace-items Sets the trace preference on the file defined by
the l o g f i l e parameter. If l o g f i l e is not set,
the values are stored but have no effect.
The value of this parameter is a
comma-separated list of trace options. For a list
of trace options and their meanings, see
Table 63, Server Tracing Options, on page 424.
You may specify trace options in three forms:
• plain A trace option without a prefix
character replaces any existing trace
options.
• + A trace option preceded by + adds the
option to the current set of trace options.
• - A trace option preceded by - removes
the option from the current set of trace
options.
Examples
The following example sets the trace log to
only show messages about access control
violations.
log_trace=ACL
Parameter Description
c o n s o l e _ t r a c e = console-trace-items Sets trace options for output to s t d e r r. The
values are the same as for l o g _ t r a c e .
However, console tracing is independent of log
file tracing.
If l o g f i l e is defined, you can stop console
output by specifying:
console_trace=-DEFAULT
Examples
This example sends a trace message to the
console when a TIBCO Rendezvous advisory
message arrives.
console_trace=RVADV
Parameter Description
m a x _ m s g _ m e m o r y = value Maximum memory the server can use for
messages.
For a complete description, see
m a x _ m s g _ m e m o r y in t i b e m s d . c o n f on
page 173.
Specify units as K B , M B or G B . The minimum
value is 8 M B . Zero is a special value, indicating
no limit.
Lowering this value will not immediately free
memory occupied by messages.
Parameter Description
s e r v e r _ r a t e _ i n t e r v a l = num Sets the interval (in seconds) over which
overall server statistics are averaged. This
parameter can be set to any positive integer
greater than zero.
Overall server statistics are always gathered, so
this parameter cannot be set to zero. By default,
this parameter is set to 1.
Setting this parameter allows you to average
message rates and message size over the
specified interval.
Parameter Description
s t a t i s t i c s _ c l e a n u p _ i n t e r v a l = num Specifies how long (in seconds) the server
should keep detailed statistics if the destination
has no activity. This is useful for controlling the
amount of memory used by detailed statistic
tracking. When the specified interval is
reached, statistics for destinations with no
activity are deleted.
setprop factory
setprop factory factory-name properties . . .
Set the properties for a connection factory, overriding any existing properties.
Multiple properties are separated by spaces. See Connection Factory Parameters
on page 228 for the list of the properties that can be set for a connection factory.
setprop queue
setprop queue queue-name properties, . . .
Set the properties for a queue, overriding any existing properties. Any properties
on a queue that are not explicitly specified by this command are removed.
Multiple properties are separated by commas. See Destination Properties on
page 55 for the list of the properties that can be set for a queue.
setprop route
setprop route route-name properties . . .
Set the properties for a route, overriding any existing properties. Any properties
on a route that are not explicitly specified by this command are removed.
You can set the z o n e _ n a m e and z o n e _ t y p e parameters when creating a route, but
you cannot subsequently change them.
Multiple properties are separated by spaces. For route parameters, see
routes.conf on page 235 and Configuring Routes and Zones on page 494.
setprop topic
setprop topic topic-name properties
Set topic properties, overriding any existing properties. Any properties on a topic
that are not explicitly specified by this command are removed.
Multiple properties are separated by commas. See Destination Properties on
page 55 for the list of the properties that can be set for a topic.
show bridge
show bridge topic|queue bridge_source
Display information about the configured bridges for the named topic or queue.
The bridge_source is the name of the topic or queue established as the source of the
bridge.
The following is example output for this command:
Target Name Type Selector
queue.dest Q
topic.dest.1 T "urgency in ('high', 'medium')"
topic.dest.2 T
The names of the destinations to which the specified destination has configured
bridges are listed in the Target Name column. The type and the message selector
(if one is defined) for the bridge are listed in the Type and Selector column.
show bridges
s h o w b r i d g e s [ t y p e = t o p i c | q u e u e ] [ pattern]
Shows a summary of the destination bridges that are currently configured. The
t y p e option specifies the type of destination established as the bridge source. For
example, s h o w b r i d g e s t o p i c shows a summary of configured bridges for all
topics that are established as a bridge source. The pattern specifies a pattern to
match for source destination names. For example s h o w b r i d g e s f o o . * returns a
summary of configured bridges for all source destinations that match the name
f o o . * . The t y p e and pattern are optional.
Destinations that match the specified pattern and/or type are listed in the Source
Name column. The number of bridges to queues for each destination is listed in
the Queue Targets column. The number of bridges to topics for each destination is
listed in the Topic Targets column.
show channel
show channel channel-name
Show the details of a specific multicast channel. The channel-name must be the exact
name of a specific channel. Wildcards and partial names are invalid.
This command prints a table of information described in Table 17.
Heading Description
Channel Name of the multicast channel.
Heading Description
Max Rate The maximum rate at which the server broadcasts
messages over the channel.
Server Backlog The number of messages and the total number of bytes
pending broadcast over the channel.
See Multicast and Flow Control on page 85 for more
information about controlling backlog.
show channels
show channels
show config
show config
Shows the configuration parameters for the connected server. The output
includes:
• configuration files
• server database
• server JVM
• server JDBC database
• listen ports
• configuration settings
• message tracking
• server tracing parameters
• statistics settings
• fault-tolerant setup
• external transport setup
• server SSL setup
• server LDAP parameters (GONE?)
show consumer
show consumer consumerID
Shows details about a specific consumer. The consumerID can be obtained from the
s h o w c o n s u m e r s output.
show consumers
show consumers [ t o p i c = name | q u e u e = name] [ d u r a b l e ] [ u s e r = name]
[ c o n n e c t i o n = id] [ s o r t = c o n n | u s e r | d e s t | m s g s ] [ f u l l ]
The s o r t parameter sorts the consumers by either connection ID, user name,
destination name, or number of pending messages. The f u l l parameter shows all
columns listed below and can be as wide as 120-140 characters or wider. Both
topic and queue consumers are shown in separate tables, first the topic consumers
and then the queue consumers.
Heading Description
Id Consumer ID.
Name (Topics Only.) Durable subscription name. This column is shown if at least one
topic subscriber is a durable subscriber.
Heading Description
SAS[NMB] Description of columns:
• S - '+' if consumer's connection started, '-' otherwise.
• A - acknowledge mode of consumer's session, values are:
— N - no acknowledge
— A - auto acknowledge
— D - dups_ok acknowledge
— C - client acknowledge
— T - session is transactional
— X - XA or MS DTC session
— Z - connection consumer
• S - '+' if consumer has a selector, '-' otherwise.
• N - (TOPICS ONLY) '+' if subscriber is "NoLocal."
• M - (TOPICS ONLY) '+' if subscriber is receiving multicast.
• B - (QUEUES ONLY) '+' if consumer is a queue browser.
Msgs Sent Current number of messages sent to consumer which are not yet acknowledged
by consumer's session.
Size Sent Combined size of unacknowledged messages currently sent to consumer. Value
is rounded and shown in bytes, (K)ilobytes, (M)egabytes or (G)igabytes.
Pend Msgs (Topics Only.) Total number of messages pending for the topic consumer.
Pend Size (Topics Only.) Combined size of messages pending for the topic consumer.
Value is rounded and shown in bytes, (K)ilobytes, (M)egabytes or (G)igabytes.
Last Sent Approximate time elapsed since last message was sent by the server to the
consumer. Value is approximate with precision of 1 second.
Heading Description
Last Akcd Approximate time elapsed since last time a message sent to the consumer was
acknowledged by consumer's session. Value is approximate with precision of 1
second.
Total Sent Total number of messages sent to consumer since it was created. This includes
resends due to session recover or rollback.
Total Acked Total number of messages sent to the consumer and acknowledged by
consumer's session since consumer created.
show connections
s h o w c o n n e c t i o n s [ t y p e = q | t | s ] [ h o s t = hostname] [ u s e r = username]
[version] [address] [counts] [full]
Show connections between clients and server. Table 20 on page 149 describes the
output.
The t y p e parameter selects the subset of connections to display as shown in
Table 19. The h o s t and u s e r parameters can further narrow the output to only
those connections involving a specific host or user. When the v e r s i o n flag is
present, the display includes the client’s version number.
If the a d d r e s s parameter is specified, then the IP address is printed in the output
table. If the c o u n t s parameter is specified, then number of producers, consumers
and temporary destinations are printed. Specifying the f u l l parameter prints all
of the available information.
Type Description
type=q Show queue connections only.
Heading Description
L The type of client. Can be one of the following:
• J — Java client
• C — C client
• # — C# client
• - — unknown system connection
Heading Description
S Connection started status, + if started, - if stopped.
Host Connection's host name. (If the name is not available, this
column displays the host’s IP address.)
User Connection user name. If a user name was not provided when
the connection was created, it is assigned the default user name
anonymous.
Heading Description
Uncomm Number of messages in uncommitted transactions on the
connection.
The c o u n t s or f u l l parameter must be specified to display this
field.
show db
show db
See the s h o w store on page 161 for details about a specific database.
show durable
show durable durable-name
Show information about a durable subscriber.
Heading Description
Durable Fully qualified name of the durable subscriber. This name
Subscriber concatenates the client ID (if any) and the subscription name
(separated by a colon).
Heading Description
Type d y n a m i c —created by a client
s t a t i c —configured by an administrator
Status online
offline
No Local e n a b l e d —the
subscriber does not receive messages sent
from its local connection (that is, the same connection as the
subscriber).
d i s a b l e d —the subscriber receives messages from all
connections.
Selector The subscriber receives only those messages that match this
selector.
Pending Msgs Number of all messages in the topic. (This count includes the
number of delivered messages.)
show durables
s h o w d u r a b l e s [ pattern]
If a pattern is not entered, this command shows a list of all durable subscribers on
all topics.
If a pattern is entered (for example f o o . *) this command shows a list of durable
subscribers on topics that match that pattern.
Heading Description
Topic Name Name of the topic.
An asterisk preceding this name indicates a dynamic durable
subscriber. Otherwise the subscriber is static (configured by
an administrator).
show factory
show factory factory-name
Shows properties of specified factory.
show factories
show factories [generic|topic|queue]
Shows all factories. You can refine the listed output by specifying only generic,
topic, or queue factories be listed.
show jndiname
show jndiname jndi-name
Shows the object that the specified name is bound to by the JNDI server.
show jndinames
s h o w j n d i n a m e s [ type]
show group
show group group-name
Shows group name, description, and number of members in the group.
For groups defined externally, there is an asterisk in front of the group name.
Only external groups with at least one currently connected user are shown.
show groups
show groups
show members
show members group-name
Shows all user members of specified user group.
show message
show message messageID
Shows the message for the specified message id.
This command requires that tracking by message ID be turned on using the
t r a c k _ m e s s a g e _ i d s configuration parameter.
show messages
show messages correlationID
Shows the message IDs of all messages with the specified correlation ID set as
J M S C o r r e l a t i o n I D message header field. You can display the message for each
ID returned by this command by using the s h o w m e s s a g e messageID command.
This command requires that tracking by correlation ID be turned on using the
t r a c k _ c o r r e l a t i o n _ i d s configuration parameter.
show parents
show parents user-name
Shows the user’s parent groups. This command can help you to understand the
user’s permissions.
show queue
show queue queue-name
Shows the details for the specified queue.
If the queue is a routed queue, specify only the name of the queue (do not specify
the server using the queue-name@server form).
Heading Description
Queue Full name of the queue.
Properties A list of property names that are set on the queue, and their
values. For an index list of property names, see Destination
Properties on page 55.
JNDI Names A list of explicitly assigned JNDI names that refer to this
queue.
Pending Msgs Number of all messages in the queue. (This count includes
the number of delivered messages.)
show queues
s h o w q u e u e s [ pattern-name [ n o t e m p | s t a t i c | d y n a m i c ]
[ f i r s t = n| n e x t = n| l a s t = n] ]
Heading Description
Queue Name Name of the queue. If the name is prefixed with an asterisk (* ),
then the queue is temporary or was created dynamically.
Properties of dynamic and temporary queues cannot be
changed.
Heading Description
SNFGXIBCT Prints information on the topic properties in the order
(S)ecure (N)sender_name or sender_name_enforced (F)ailsafe
(G)lobal e(X)clusive (I)mport (B)ridge (C)flowControl (T)race
The characters in the value section show:
- Property not present
+ Property is present, and was set on the topic itself
* Property is present, and was inherited from another queue
Note that inherited properties cannot be removed.
show route
show route route-name
Shows the properties (URL and SSL properties) of a route.
show routes
show routes
Shows the properties (URL and SSL properties) of all created routes.
These commands print the information described in Table 25.
Heading Description
Route Name of the route.
Heading Description
T Type of route:
• A indicates an active route.
• P indicates a passive route.
show rvcmtransportledger
show rvcmtransportledger transport_name [ subject-or-wildcard]
Displays the TIBCO Rendezvous certified messaging (RVCM) ledger file entries
for the specified transport and the specified subject. You can specify a subject
name, use wildcards to retrieve all matching subjects, or omit the subject name to
retrieve all ledger file entries.
For more information about ledger files and the format of ledger file entries, see
TIBCO Rendezvous documentation.
show rvcmlisteners
show rvcmlisteners
Shows all RVCM listeners that have been created using the c r e a t e
rvcmlistener command or by editing the t i b r v c m . c o n f file.
show server
show server (aliases: info, i)
show stat
show stat channel name [ t o p i c = name]
s h o w s t a t c o n s u m e r s [ t o p i c = name| q u e u e = name] [ u s e r = name]
[ c o n n e c t i o n = id] [ t o t a l ]
show store
show store store-name
Show the details of a specific store. This command can be used to get details about
either a file-based store or a database store.
The store-name must be the exact name of a specific store.
This command prints a table of information described in Table 26.
Heading Description
Store Name of the store.
Message Count The number of messages that are stored in the file.
Swapped Count The number of messages that have been swapped from
process memory to store file.
CRC e n a b l e d —the
server uses CRC to validate checksum
data when reading the store file.
d i s a b l e d —the server does not validate checksum data
when reading the store file.
Heading Description
Periodic Truncation e n a b l e d —the
EMS server occasionally truncates the
store file, relinquishing unused disk space.
d i s a b l e d —the EMS server does not truncate the store
file to relinquish unused disk space.
File Size The size of the store file, including unused allocated file
space.
Discard Scan The maximum length of time that the EMS server takes
Interval to examine all messages in the mstore. This interval is
controlled with the s c a n _ i t e r _ i n t e r v a l parameter in
the s t o r e s . c o n f file.
Discard Scan The bytes read and processed every Discard Scan
Interval Bytes Interval. This number is proportional to the mstore file
size, and must be kept within the limits of your storage
medium. See Understanding mstore Intervals on
page 32 for more information.
First Scan Finished t r u e —all the data in the store has been examined at
least once since the EMS server startup.
f a l s e —not all data has been examined since the EMS
server last started. When f a l s e , certain server statistics
(such as the Message Count field) may be
underreported as a result of expired or purged
messages still in the store. See Implications for Statistics
on page 34 for more information.
Heading Description
Headings specific to database stores
Username The username that the EMS server uses to access the
database.
show stores
show stores
show topic
show topic topic-name
Heading Description
Topic Full name of the topic.
Properties A list of property names that are set on the topic, and
their values. For an index list of property names, see
Destination Properties on page 55.
Heading Description
Durable Consumers Number of durable consumers on this topic.
Pending Msgs The total number of messages sent but not yet
acknowledged by the consumer. This count includes
copies sent to multiple subscribers.
The server accumulates the following statistics only when the administrator
has enabled statistics. Otherwise these items are zero.
Total Inbound Bytes Cumulative total of message size over all messages
delivered to the topic.
Total Outbound Bytes Cumulative total of message size over all messages
consumed from the topic by consumers. Each
consumer of a message contributes this total
independently of other consumers.
show topics
s h o w t o p i c s [ pattern-name [ n o t e m p | s t a t i c | d y n a m i c ]
[ f i r s t = n| n e x t = n| l a s t = n] ]
When a pattern-name is entered, you can also cursor through the list of topics using
one of the following commands, where n is whole number:
• first=n — show the first n topics
• next=n — show the next n topics
• last=n — show the next n topics and terminate the cursor
The cursor examines n topics and displays topics that match the pattern-name.
Because it does not traverse the full list of topics, the cursor may return zero or
fewer than n topics. To find all matching topics, continue to use n e x t until you
receive a C u r s o r c o m p l e t e message.
The s h o w topics command prints a table of information described in Table 28.
Heading Description
Topic Name Name of the topic. If the name is prefixed with an asterisk (* ),
then the topic is temporary or was created dynamically.
Properties of dynamic and temporary topics cannot be
changed.
Heading Description
Msgs The total number of messages sent but not yet acknowledged
by the consumer. This count includes copies sent to multiple
subscribers.
To see the count of actual messages (not multiplied by the
number of topic subscribers) sent to all destinations, use the
s h o w s e r v e r command.
show transactions
show transactions
Shows the XID for all client transactions that were created using the XA or MS
DTC interfaces. Each row presents information about one transaction. The XID is
the concatenation of the Format ID, GTrid Len, Bqual Len, and Data fields for a
transaction. For example, if show transactions returns the row:
State Format ID GTrid Len Bqual Len Data
E 0 6 2 branchid
Heading Description
State Transaction state:
• A active
• E ended
• R rollback only
• P prepared
• S suspended
Suspended transactions can be rolled back, but cannot be rolled
forward (committed).
Heading Description
Format ID The XA transaction format identifier.
0 = OSI CCR naming is used
>0 = some other format is used
-1 = NULL
GTrid Len The number of bytes that constitute the global transaction ID.
Bqual Len The number of bytes that constitute the branch qualifier.
Data The global transaction identifier (gtrid) and the branch qualifier
(bqual).
show transport
show transport transport
Displays the configuration for the specified transport defined in
transports.conf.
show transports
show transports
show user
show user user-name
Shows user name and description. If no user name is specified, this command
displays the currently logged in user.
For users defined externally, there is an asterisk in front of the user name.
show users
show users
showacl admin
showacl admin
Shows all administrative permissions for all users and groups, but does not
include administrative permissions on destinations.
showacl group
showacl group group-name [ a d m i n ]
Shows all permissions set for a given group. Shows the group and the set of
permissions. You can optionally specify a d m i n to show only the administrative
permissions for destinations or principals. Specifying s h o w a c l a d m i n shows all
administrative permissions for all users and groups (not including administrative
permissions on destinations).
showacl queue
showacl queue queue-name [ a d m i n ]
Shows all permissions set for a queue. Lists all entries from the a c l file. Each
entry shows the “grantee” (user or group) and the set of permissions. You can
optionally specify a d m i n to show only the administrative permissions for
destinations or principals. Specifying s h o w a c l a d m i n shows all administrative
permissions for all users and groups (not including administrative permissions
on destinations).
showacl topic
showacl topic topic-name [ a d m i n ]
Shows all permissions set for a topic. Lists all entries from the a c l file. Each entry
shows the “grantee” (user or group) and the set of permissions. You can
optionally specify a d m i n to show only the administrative permissions for
destinations or principals. Specifying s h o w a c l a d m i n shows all administrative
permissions for all users and groups (not including administrative permissions
on destinations).
showacl user
showacl user user-name [ a d m i n | a l l | a d m i n - a l l ]
Shows the user and the set of permissions granted to the user for destinations and
principals.
showacl user username — displays permissions granted directly to the user. (An
administrator can use this form of the command to view own permissions, even
without permissions to view any other user permissions.)
showacl user username a d m i n — displays administrative permissions granted
directly to the user.
showacl user username a l l — displays direct and inherited (from groups to
which the user belongs) permissions.
showacl user username a d m i n - a l l — displays all administrative permissions for
a given user (direct and inherited)
The output from this command displays inherited permissions prefixed with a '*'.
Inherited permissions cannot be changed. An attempt to revoke an inherited
permission for the principal user will not change the permission.
shutdown
shutdown
suspend route
suspend route route-name
Suspends outgoing messages to the named route.
Message flow can be recovered later using the command r e s u m e route.
time
time [on | off]
timeout
t i m e o u t [ seconds]
Show or change the current command timeout value. The timeout value is the
number of seconds the Administration Tool will wait for a response from the
server after sending a command.
By default, the timeout is 30 seconds. When t i m e o u t is entered with the optional
seconds parameter, the timeout value is reset to the specified number of seconds.
When entered without parameter, the current timeout value is returned.
transaction commit
transaction commit XID
Commits the transaction identified by the transaction ID. The transaction must be
in the e n d e d or p r e p a r e d state. To obtain a transaction ID, issue the s h o w
t r a n s a c t i o n s command, and cut and paste the XID into this command.
transaction rollback
transaction rollback XID
Rolls back the transaction identified by the transaction ID. The transaction must
be in the e n d e d , r o l l b a c k o n l y, or the p r e p a r e d state. To obtain a transaction ID,
issue the show transactions command, and cut and paste the XID into this
command.
updatecrl
updatecrl
whoami
whoami
Alias for the show user command to display the currently logged in user.
Topics
Mechanics of Configuration
Configuration The EMS server reads configuration files only once, when the server starts. It
Files ignores subsequent changes to the configuration files. If you change a
configuration file, use the s h u t d o w n command from the EMS Administration Tool
to shutdown the server and then restart the server as described in Running the
EMS Server on page 101.
Administrative You can also change the server configuration with administrative requests, using
Requests either t i b e m s a d m i n (a command line tool), the Java or .NET administrative APIs,
or TIBCO Administrator™ (a separate TIBCO product).
When the server validates and accepts an administrative request, it writes the
change to the appropriate configuration file as well (overwriting any manual
changes to that file). This policy keeps configuration files current in case the
server restarts (for example, in a fault-tolerant situation, or after a hardware
failure).
Re-installing or updating EMS overwrites the files in the b i n / and
samples/config/ directories. Do not use these directories to configure your
deployment.
tibemsd.conf
The main configuration file controls the characteristics of the EMS server. This file
is usually named t i b e m s d . c o n f , but you can specify another file name when
starting the server. You can find more information about starting the server in
Running the EMS Server on page 101.
An example of the t i b e m s d . c o n f file is included in the
config-file-directory/ c f m g m t / e m s / d a t a / directory, where config-file-directory is
specified during TIBCO Enterprise Message Service installation. You can edit this
configuration file with a text editor. There are a few configuration items in this file
that can be altered using the administration tool, but most configuration
parameters must be set by editing the file (that is, the server does not accept
changes to those parameters). See Chapter 6, Using the EMS Administration Tool,
on page 115 for more information about using the administration tool.
Several parameters accept boolean values. In the description of the parameter, one
specific set of values is given (for example, e n a b l e and d i s a b l e ), but all
parameters that accept booleans can have the following values:
• enable, enabled, true, yes, on
Parameters that take multiple elements cannot contain spaces between the
elements, unless the elements are enclosed in starting and ending double quotes.
Parameters are limited to line lengths no greater than 256,000 characters in length.
The following table summarizes the parameters in t i b e m s d . c o n f according to
category. The sections that follow provide more detail on each parameter.
Multicast Parameters
LDAP Parameters
JVM Parameters
allow_unsupported_tx_routed_q_consumers
allow_unsupported_tx_routed_q_consumers = enabled | disabled
authorization
authorization = enabled | disabled
See Chapter 8, Authentication and Permissions, on page 247 for more information
about these parameters.
compliant_queue_ack
compliant_queue_ack = enable | disable
flow_control
flow_control = enable | disable
listen
l i s t e n = protocol://servername:port
Specifies the port on which the server is to listen for connections from clients.
For example:
listen=tcp://localhost:7222
You can use multiple l i s t e n entries if you have computers with multiple
interfaces. For example:
listen=tcp://localhost:7222
listen=tcp://localhost:7224
If the hostname is not present then the default host and interface will be used. For
example:
listen=tcp://7222
listen=ssl://7243
npsend_check_mode
npsend_check_mode = [always | never | temp_dest | auth | temp_auth]
Message confirmation has a great deal of impact on performance and should only
be enabled when necessary. The circumstances in which a producer might want
the server to send confirmation a N O N _ P E R S I S T E N T message are:
• When a u t h o r i z a t i o n is enabled, so the producer can take action if
permission to send the message is denied by the server.
• When sending to a temporary destination, so the producer can take action if
the message is sent to a temporary destination that has been destroyed.
• The message exceeded queue/topic limit (requires r e j e c t I n c o m i n g policy
for topics).
• Bridging of the message has failed.
• The server is out of memory or has encountered some other severe error.
The possible n p s e n d _ c h e c k _ m o d e parameter modes are:
• d e f a u l t (no mode specified) - same behavior as in EMS 4.3 and prior. This
means the server only provides confirmation of a N O N _ P E R S I S T E N T message if
a u t h o r i z a t i o n is enabled.
password
password = password
Password used to log in to other routed servers that have a u t h o r i z a t i o n
enabled.
See Routing and Authorization on page 507 for details.
routing
routing = enabled | disable
See Chapter 20, Working With Routes, on page 485 for more information about
routing.
server
server = serverName
Name of server.
Server names are limited to at most 64 characters.
startup_abort_list
startup_abort_list=[SSL,TRANSPORTS,CONFIG_FILES,CONFIG_ERRORS,
DB_FILES,MULTICAST]
Specifies conditions that cause the server to exit during its initialization sequence.
You may specify any subset of the conditions in a comma-separated list. The list
cannot contain spaces between the elements, unless the elements are enclosed in
starting and ending double quotes. If a space is included but not enclosed in
quotation marks, the server ignores any conditions following the space.
Conditions that do not appear in the list are ignored by the server. The default is
an empty list.
The conditions are:
• S S L —If SSL initialization fails, then it exits.
• T R A N S P O R T S —If any of the transports cannot be created as specified in the
configuration files, then it exits.
• C O N F I G _ F I L E S —If any configuration file listed in t i b e m s d . c o n f does not
exist, then it exits.
• C O N F I G _ E R R O R S —If the server detects any errors while reading the config
files, then it exits.
• D B _ F I L E S —If the server cannot find one or more of its stores, then it exits.
Stores include the default store files as well as any file or database stores
configured in the s t o r e s . c o n f configuration file.
user_auth
user_auth = [local, ldap, jaas]
store
store = directory
Directory in which the server stores data files.
For example:
store = /usr/tmp
store_crc
store_crc = enable | disable
Specifies whether the EMS server validates CRC checksum data when reading the
store files.
This parameter is not compatible with the use of multiple store files. If you have
configured the s t o r e s . c o n f file, or enabled database stores, then including the
s t o r e _ c r c parameter will cause a mixed mode error. See Store Messages in
Multiple Stores on page 29 for more information.
This parameter is deprecated in Software Release 5.0. Prepare to migrate to a
multiple stores configuration, where the same functionality can be achieved
through store definitions in the s t o r e s . c o n f file.
store_minimum
s t o r e _ m i n i m u m = size [ K B | M B | G B ]
s t o r e _ m i n i m u m _ s y n c = size [ K B | M B | G B ]
s t o r e _ m i n i m u m _ a s y n c = size [ K B | M B | G B ]
This set of parameters preallocates disk space for EMS store files. Preallocation
occurs when the server first creates a store file.
You can specify units of K B , M B , or G B .
Zero is a special value, which specifies no minimum preallocation. Otherwise, the
value you specify must be greater than or equal to 8 M B .
If s t o r e _ m i n i m u m _ s y n c or s t o r e _ m i n i m u m _ a s y n c are absent, they default to
store_minimum.
For example:
store_minimum_sync = 32MB
This parameter is not compatible with the use of multiple store files. If you have
configured the s t o r e s . c o n f file, or enabled database stores, then including the
s t o r e _ m i n i m u m parameter will cause a mixed mode error. See Store Messages in
Multiple Stores on page 29 for more information.
This parameter is deprecated in Software Release 5.0. Prepare to migrate to a
multiple stores configuration, where the same functionality can be achieved
through store definitions in the s t o r e s . c o n f file.
store_truncate
store_truncate = enable | disable
Specifies whether the EMS server occasionally attempts to truncate the storage
files, relinquishing unused disk space.
When e n a b l e d , the storage files may be truncated, but not below the size
specified in the s t o r e _ m i n i m u m parameters.
This parameter is not compatible with the use of multiple store files. If you have
configured the s t o r e s . c o n f file, or enabled database stores, then including the
s t o r e _ t r u n c a t e parameter will cause a mixed mode error. See Store Messages in
Multiple Stores on page 29 for more information.
This parameter is deprecated in Software Release 5.0. Prepare to migrate to a
multiple stores configuration, where the same functionality can be achieved
through store definitions in the s t o r e s . c o n f file.
destination_backlog_swapout
destination_backlog_swapout = number
Specifies the number of messages that may be stored in the server's memory
before message swapping is enabled. The limit given is for each destination. For
example, if the limit is 10,000 and you have three queues, the server can store up
to 30,000 unswapped messages in memory.
The specified number may be any positive value. When
d e s t i n a t i o n _ b a c k l o g _ s w a p o u t is 0 , the server attempts to immediately swap
out the message.
By default, the limit for each destination is 1 0 2 4 messages.
max_client_msg_size
max_client_msg_size = size [ K B | M B | G B ]
Maximum size allowed for an incoming message.
This parameter setting instructs the server to reject incoming messages that are
larger than the specified size limit.
When omitted or zero, the EMS server accepts and attempts to process messages
of any size.
max_connections
max_connections = number
Maximum number of simultaneous client connections.
Set to 0 to allow unlimited simultaneous connections.
max_msg_memory
max_msg_memory = size [ K B | M B | G B ]
Maximum memory the server can use for messages.
This parameter lets you limit the memory that the server uses for messages, so
server memory usage cannot grow beyond the system’s memory capacity.
When m s g _ s w a p p i n g is enabled, and messages overflow this limit, the server
begins to swap messages from process memory to disk. Swapping allows the
server to free process memory for incoming messages, and to process message
volume in excess of this limit.
When the server swaps a message to disk, a small record of the swapped message
remains in memory. If all messages are swapped out to disk, and their remains
still exceed this memory limit, then the server has no room for new incoming
messages. The server stops accepting new messages, and send calls in message
producers result in an error. (This situation probably indicates either a very low
value for this parameter, or a very high message volume.)
Specify units as K B , M B or G B . The minimum value is 8 MB. The default value of 0
(zero) indicates no limit.
For example:
max_msg_memory = 512MB
msg_swapping
msg_swapping = enable | disable
This parameter enables and disables the message swapping feature (described
above for m a x _ m s g _ m e m o r y ).
The default value is e n a b l e d , unless you explicitly set it to d i s a b l e d .
reserve_memory
reserve_memory = size
When r e s e r v e _ m e m o r y is non-zero, the daemon allocates a block of memory for
use in emergency situations to prevent the EMS server from being unstable in low
memory situations. When the daemon process exhausts memory resources, it
disables clients and routes from producing new messages, and frees this block of
memory to allow consumers to continue operation (which tends to free memory).
The EMS server attempts to reallocate its reserve memory once the number of
pending messages in the server has dropped to 10% of the number of pending
messages that were in the server when it experienced the allocation error. If the
server successfully reallocates memory, it begins accepting new messages.
The r e s e r v e _ m e m o r y parameter only triggers when the EMS server has run out
of memory and therefore is a reactive mechanism. The appropriate administrative
action when an EMS server has triggered release of reserve memory is to drain the
majority of the messages by consuming them and then to stop and restart the
EMS server. This allows the operating system to reclaim all the virtual memory
resources that have been consumed by the EMS server. A trace option, M E M O R Y , is
also available to help show what the server is doing during the period when it is
not accepting messages.
Specify size in units of MB. When non-zero, the minimum block is 16MB. When
absent, the default is zero.
There are a variety of limits that the user can set to prevent the EMS server from
storing excessive messages, which can lead to situations where the EMS server
runs out of memory. These include global parameters, such as m a x _ m s g _ m e m o r y ,
as well as destination properties such as m a x b y t e s . These limits should be used to
prevent the r e s e r v e _ m e m o r y mechanism from triggering.
msg_pool_block_size
msg_pool_size
msg_pool_block_size size
m s g _ p o o l _ s i z e size
Consult with your TIBCO support representative before using either of these
commands.
socket_send_buffer_size
socket_send_buffer_size = size
Sets the size (in kilobytes) of the send buffer used by clients when connecting to
the EMS server.
The specified size may be:
• any number greater than 5 1 2
• 0 to use the default buffer size
• -1 to skip the call for the specified buffer
When omitted or zero, the default buffer size is used.
On Linux platforms, omitting the parameter or specifying zero causes the EMS
server to skip the value. In this case, Linux auto-tuning controls buffering.
socket_receive_buffer_size
socket_receive_buffer_size = size
Sets the size (in kilobytes) of the receive buffer used by clients when connecting to
the EMS server.
The specified size may be:
• any number greater than 5 1 2
• 0 to use the default buffer size
• -1 to skip the call for the specified buffer
When omitted or zero, the default buffer size is used.
On Linux platforms, omitting the parameter or specifying zero causes the EMS
server to skip the value. In this case, Linux auto-tuning controls buffering.
client_heartbeat_server
client_heartbeat_server interval
In a server-to-client connection, clients send heartbeats to the server at this
interval (in seconds).
The client_heartbeat_server parameter must be specified when a
s e r v e r _ t i m e o u t _ c l i e n t _ c o n n e c t i o n is set. The c l i e n t _ h e a r t b e a t _ s e r v e r
interval should be no greater than one third of the
s e r v e r _ t i m e o u t _ c l i e n t _ c o n n e c t i o n limit.
This setting also ensures that garbage collection occurs on the connection.
Collection is triggered by incoming messages and heartbeats. If the size of
messages can vary widely or there is not a steady stream of message traffic, can
use this parameter to ensure that collection occurs.
When omitted or zero, c l i e n t _ h e a r t b e a t _ s e r v e r is disabled.
server_timeout_client_connection
server_timeout_client_connection limit
In a server-to-client connection, if the server does not receive a heartbeat for a
period exceeding this limit (in seconds), it closes the connection.
We recommend setting this value to approximately 3 times the heartbeat interval,
as it is specified in c l i e n t _ h e a r t b e a t _ s e r v e r.
Zero is a special value, which disables heartbeat detection in the server (although
clients still send heartbeats).
server_heartbeat_server
server_heartbeat_server interval
In a server-to-server connection, this server sends heartbeats at this interval (in
seconds).
The two servers can be connected either by a route, or as a fault-tolerant pair.
server_timeout_server_connection
server_timeout_server_connection limit
In a server-to-server connection, if this server does not receive a heartbeat for a
period exceeding this limit (in seconds), it closes the connection. This parameter
applies to connections from other routes and to the backup server connection.
We recommend setting this value to approximately 3.5 times the heartbeat
interval of the other server. When the other server or the network are heavily
loaded, or when client programs send very large messages, we recommend a
larger multiple.
server_heartbeat_client
server_heartbeat_client interval
In a server-to-client connection, the server sends heartbeats to all clients at this
interval (in seconds).
When omitted or zero, the default is 5 seconds.
This parameter is new in release 4.4; it is disabled when either entity is from an
earlier release.
client_timeout_server_connection
client_timeout_server_connection limit
In a server-to-client connection, if a client does not receive a heartbeat for a period
exceeding this limit (in seconds), it closes the connection.
We recommend setting this value to approximately 3.5 times the heartbeat
interval.
Zero is a special value, which disables heartbeat detection in the client (although
the server still sends heartbeats).
This parameter is new in release 4.4; it is disabled when either entity is from an
earlier release.
ft_active
ft_active = URL
Specifies the URL of the active server. If this server can connect to the active
server, it will act as a backup server. If this server cannot connect to the active
server, it will become the active server.
ft_heartbeat
ft_heartbeat = seconds
Specifies the interval (in seconds) the active server is to send a heartbeat signal to
the backup server to indicate that it is still operating. Default is 3 seconds.
ft_activation
ft_activation = seconds
Activation interval (maximum length of time between heartbeat signals) which
indicates that active server has failed. Set in seconds: default is 10. This interval
should be set to at least twice the heartbeat interval.
For example:
ft_activation = 60
ft_reconnect_timeout
ft_reconnect_timeout = seconds
The amount of time (in seconds) that a backup server waits for clients to reconnect
(after it assumes the role of primary server in a failover situation). If a client does
not reconnect within this time period, the server removes its state from the shared
state files. The f t _ r e c o n n e c t _ t i m e o u t time starts once the server has fully
recovered the shared state, so this value does not account for the time it takes to
recover the store files.
The default value of this parameter is 60.
ft_ssl_auth_only
ft_ssl_auth_only = enable | disable
When e n a b l e d , the server allows a fault tolerant server to request the use of SSL
only for authentication (to protect user passwords). For an overview of this
feature, see SSL Authentication Only on page 458.
When d i s a b l e d , the server ignores requests for this feature. When absent, the
default value is d i s a b l e d .
ft_ssl_identity
ft_ssl_identity = pathname
The path to a file that contains the certificate in one of the supported formats. The
supported formats are PEM, DER, or PKCS#12.
See File Names for Certificates and Keys on page 445 for more information on file
types for digital certificates.
ft_ssl_issuer
ft_ssl_issuer = chain_member
Certificate chain member for the server. Supply the entire chain, including the CA
root certificate. The server reads the certificates in the chain in the order they are
presented in this parameter.
The certificates must be in PEM, DER, PKCS#7, or PKCS#12 format.
See File Names for Certificates and Keys on page 445 for more information on file
types for digital certificates.
ft_ssl_private_key
ft_ssl_private_key = key
The server’s private key. If it is included in the digital certificate in
f t _ s s l _ i d e n t i t y, then this parameter is not needed.
This parameter supports private keys in the following formats: PEM, DER,
PKCS#12.
You can specify the actual key in this parameter, or you can specify a path to a file
that contains the key. See File Names for Certificates and Keys on page 445 for
more information on file types for digital certificates.
ft_ssl_password
ft_ssl_password = password
Private key or password for private keys.
You can set passwords by way of the t i b e m s a d m i n tool. When passwords are set
with this tool, the password is obfuscated in the configuration file. See Chapter 6,
Using the EMS Administration Tool, on page 115 for more information about
using t i b e m s a d m i n to set passwords.
ft_ssl_trusted
ft_ssl_trusted = trusted_certificates
List of trusted certificates. This sets which Certificate Authority certificates should
be trusted as issuers of the client certificates.
The certificates must be in PEM, DER, or PKCS#7 format. You can either provide
the actual certificates, or you can specify a path to a file containing the certificate
chain.
See File Names for Certificates and Keys on page 445 for more information on file
types for digital certificates.
ft_ssl_rand_egd
ft_ssl_rand_egd = pathname
The path for the installed entropy gathering daemon (EGD), if one is installed.
This daemon is used to generate random numbers for the EMS server.
ft_ssl_verify_host
ft_ssl_verify_host = enabled | disabled
Specifies whether the fault-tolerant server should verify the other server’s
certificate. The values for this parameter are e n a b l e d or d i s a b l e d . By default,
this parameter is enabled, signifying the server should verify the other server’s
certificate.
When this parameter is set to d i s a b l e d , the server establishes secure
communication with the other fault-tolerant server, but does not verify the
server’s identity.
ft_ssl_verify_hostname
ft_ssl_verify_hostname = enabled | disabled
Specifies whether the fault-tolerant server should verify the name in the CN field
of the other server’s certificate. The values for this parameter are e n a b l e d and
d i s a b l e d . By default, this parameter is enabled, signifying the fault-tolerant
server should verify the name of the connected host or the name specified in the
f t _ s s l _ e x p e c t e d _ h o s t n a m e parameter against the value in the server’s
certificate. If the names do not match, the connection is rejected.
When this parameter is set to d i s a b l e d , the fault-tolerant server establishes
secure communication with the other server, but does not verify the server’s
name.
ft_ssl_expected_hostname
ft_ssl_expected_hostname = serverName
Specifies the name the server is expected to have in the CN field of the
fault-tolerant server’s certificate. If this parameter is not set, the expected name is
the hostname of the server.
This parameter is used when the f t _ s s l _ v e r i f y _ h o s t n a m e parameter is set to
enabled.
ft_ssl_ciphers
ft_ssl_ciphers = cipherSuite
Specifies the cipher suites used by the server; each suite in the list is separated by
a colon (:). This parameter can use the OpenSSL name for cipher suites or the
longer, more descriptive names.
See Specifying Cipher Suites on page 452 for more information about the cipher
suites available in EMS and the OpenSSL names and longer names for the cipher
suites.
track_message_ids
track_message_ids = enabled | disabled
track_correlation_ids
track_correlation_ids = enabled | disabled
Multicast Parameters
See Chapter 13, Using Multicast, on page 345, for more information about
multicast.
multicast
multicast = enabled | disabled
multicast_channels
multicast_channels = file
Specifies the configuration file where multicast channels are defined.
For example:
multicast_channels = mychannels.conf
When this parameter is not included, the EMS server looks for channel definitions
in the c h a n n e l s . c o n f file.
multicast_daemon_default
multicast_daemon_default = tcp-port
Specifies the TCP port on which the EMS client will attempt to connect to the
multicast daemon. For example:
multicast_daemon_default = 9999
This parameter determines the TCP port that EMS clients use to connect to the
multicast daemon, and is provided in the server to centrally configure all clients.
It determines the behavior of the EMS client but does not affect the multicast
daemon. The multicast daemon must listen for the client on the same port that the
client uses to connect. If the multicast daemon is not listening on the same port
that is specified by m u l t i c a s t _ d a e m o n _ d e f a u l t , the client will be unable to
connect to the daemon and an error will occur.
To change the TCP port that the multicast daemon listens on, use the - l i s t e n
command line argument in the daemon. See Command Line Options on page 352
for more information.
When this parameter is not included, the default port is 7 4 4 4 .
multicast_statistics_interval
multicast_statistics_interval = seconds
Specifies how often, in seconds, multicast statistics are published to the
monitoring topic $ s y s . m o n i t o r . m u l t i c a s t . s t a t s for each channel. Intervals of
less than 5 seconds are not supported.
For example:
multicast_statistics_interval = 90
tibrv_transports
tibrv_transports = enabled | disabled
tibrv_xml_import_as_string
tibrv_xml_import_as_string = enabled | disabled
module_path
module_path = SmartSockets-shared-library-directory
where SmartSockets-shared-library-directory is the absolute path to the directory
containing the SmartSockets library files. For example:
module_path = c:\tibco\ss\bin\i86_w32
Please see the SmartSockets documentation to locate the directory where the
appropriate shared libraries are installed.
tibss_transports
tibss_transports = enabled | disabled
tibss_config_dir
tibss_config_dir = pathname
Specifies the directory for SmartSockets configuration files and message files:
• tal_ss.cat is a required file of messages. If it is missing, t i b e m s d outputs a
warning message.
• tibems_ss.cm is an optional file of SmartSockets RTclient configuration
options.
When this parameter is absent, t i b e m s d searches for these files in its current
working directory.
For more information about these files, see TIBCO SmartSockets User’s Guide.
logfile
logfile = pathname
Name and location of the server log file.
log_trace
log_trace = traceOptions
Sets the trace preference on the file defined by the l o g f i l e parameter. If l o g f i l e
is not set, the values have no effect.
The value of this parameter is a comma-separated list of trace options. For a list of
trace options and their meanings, see Table 63, Server Tracing Options, on
page 424.
You may specify trace options in three forms:
• plain A trace option without a prefix character replaces any existing trace
options.
• + A trace option preceded by + adds the option to the current set of trace
options.
• - A trace option preceded by - removes the option from the current set of
trace options.
The following example sets the trace log to only show messages about access
control violations.
log_trace=ACL
The next example sets the trace log to show all default trace messages, in addition
to SSL messages, but ADMIN messages are not shown.
log_trace=DEFAULT,-ADMIN,+SSL
logfile_max_size
logfile_max_size = size [ K B | M B | G B ]
Specifies the recommended maximum log file size before the log file is rotated. Set
to 0 to specify no limit. Use KB, MB, or GB for units (if no units are specified, the
file size is assumed to be in bytes).
The server periodically checks the size of the current log file. If it is greater than
the specified size, the file is copied to a backup and then emptied. The server then
begins writing to the empty log file until it reaches the specified size again.
Backup log files are named sequentially and stored in the same directory as the
current log.
console_trace
console_trace = traceOptions
Sets trace options for output to s t d e r r. The possible values are the same as for
l o g _ t r a c e . However, console tracing is independent of log file tracing.
Note that important error messages (and some other messages) are always
output, overriding the trace settings.
This example sends a trace message to the console when a TIBCO Rendezvous
advisory message arrives.
console_trace=RVADV
client_trace
c l i e n t _ t r a c e = { e n a b l e d | d i s a b l e d } [ t a r g e t = location]
[ u s e r | c o n n i d | c l i e n t i d = value]
You can also direct client tracing output to a file, using the
t i b e m s _ S e t T r a c e F i l e , T i b j m s . s e t T r a c e F i l e and T i b e m s . S e t T r a c e F i l e in
the C, Java and .NET libraries, respectively.
The default behavior is to trace all connections. You can specify either u s e r,
connid or c l i e n t i d to selectively trace specific connections. The value can be a
user name or ID (as appropriate).
Setting this parameter using the administration tool does not change its value in
the configuration file t i b e m s d . c o n f ; that is, the value does not persist across
server restarts unless you set it in the configuration file.
trace_client_host
trace_client_host = [hostname|address|both|both_with_port]
Trace statements related to connections can identify the host by its hostname, its
IP address, or both. When absent, the default is h o s t n a m e . The b o t h _ w i t h _ p o r t
option displays the ephemeral port used on the host as well as the IP address and
hostname.
server_rate_interval
server_rate_interval = seconds
Sets the interval (in seconds) over which overall server statistics are averaged.
This parameter can be set to any positive integer greater than zero.
Overall server statistics are always gathered, so this parameter cannot be set to
zero. By default, this parameter is set to 1.
Setting this parameter allows you to average message rates and message size over
the specified interval.
statistics
statistics = enabled | disabled
rate_interval
rate_interval = seconds
Sets the interval (in seconds) over which statistics for routes, destinations,
producers, and consumers are averaged. By default, this parameter is set to 3
seconds. Setting this parameter to zero disables the average calculation.
detailed_statistics
detailed_statistics = NONE | [PRODUCERS,CONSUMERS,ROUTES,CHANNELS]
Specifies which objects should have detailed statistic tracking. Detailed statistic
tracking is only appropriate for routes, channels, producers that specify no
destination, or consumers that specify wildcard destinations. When detailed
tracking is enabled, statistics for each destination are kept for the object.
Setting this parameter to NONE disabled detailed statistic tracking. You can
specify any combination of PRODUCERS, CONSUMERS, ROUTES, or
CHANNELS to enable tracking for each object. If you specify more than one type
of detailed tracking, separate each item with a comma.
For example:
detailed_statistics = NONE
statistics_cleanup_interval
statistics_cleanup_interval = seconds
Specifies how long (in seconds) the server should keep detailed statistics if the
destination has no activity. This is useful for controlling the amount of memory
used by detailed statistic tracking. When the specified interval is reached,
statistics for destinations with no activity are deleted.
max_stat_memory
max_stat_memory = size [ K B | M B | G B ]
Specifies the maximum amount of memory to use for detailed statistic gathering.
If no units are specified, the amount is in bytes, otherwise you can specify the
amount using KB, MB, or GB as the units.
Once the maximum memory limit is reached, the server stops collecting detailed
statistics. If statistics are deleted and memory becomes available, the server
resumes detailed statistic gathering.
ssl_dh_size
ssl_dh_size = [512 | 768 | 1024 | 2048]
Size of the Diffie-Hellman key. Can be 512, 768, 1024, or 2048 bits. The default
value is 1024.
This key is not used for cipher suites available for export.
ssl_server_ciphers
ssl_server_ciphers = cipherSuites
Specifies the cipher suites used by the server; each suite in the list is separated by
a colon (:). This parameter must follow the OpenSSL cipher string syntax.
For example, you can enable two cipher suites with the following setting:
ssl_server_ciphers = RC4-MD5:RC4-SHA
See Specifying Cipher Suites on page 452 for more information about the cipher
suites available in EMS and the syntax for specifying them in this parameter.
ssl_require_client_cert
ssl_require_client_cert = enable | disable
If this parameter is set to e n a b l e , the server only accepts SSL connections from
clients that have digital certificates. Connections from clients without certificates
are denied.
If this parameter is set to d i s a b l e , then connections are accepted from clients that
do not have a digital certificate.
Whether this parameter is set to e n a b l e or d i s a b l e , clients that do have digital
certificates are always authenticated against the certificates supplied to the
s s l _ s e r v e r _ t r u s t e d parameter.
ssl_use_cert_username
ssl_use_cert_username = enable | disable
If this parameter is set to e n a b l e , a client’s user name is always extracted from the
CN field of the client’s digital certificate, if the digital certificate is specified. If a
different username is provided through the connection factory or API calls, then
that username is discarded. Only the username from the CN is used.
ssl_cert_user_specname
ssl_cert_user_specname = username
This parameter is useful if clients are required to supply a username, but you
wish to designate a special username to use when the client’s username should be
taken from the client’s digital certificate.
For example, you may wish all clients to specify their username when logging in.
This means the s s l _ u s e _ c e r t _ u s e r n a m e parameter would be set to d i s a b l e .
The username is supplied by the user, and not taken from the digital certificate.
However, you may wish one username to signify that the client logging in with
that name should have the name taken from the certificate. A good example of
this username would be a n o n y m o u s . All clients logging in as a n o n y m o u s will have
their user names taken from their digital certificates.
The value specified by this parameter is the username that clients will use to log
in when the username should be taken from their digital certificate. A good
example of the value of this parameter would be a n o n y m o u s .
Also, the value of this parameter is ignored if s s l _ u s e _ c e r t _ u s e r n a m e is set to
enable, in which case all client usernames are taken from their certificates. This
parameter has no effect for users that have no certificate.
ssl_server_identity
ssl_server_identity = certificate
The server’s digital certificate in PEM, DER, or PKCS#12 format. You can specify
the path to a file that contains the certificate in one of the supported formats.
This parameter must be specified if any SSL ports are listed in the l i s t e n
parameter.
PEM and PKCS#12 formats allow the digital certificate to include the private key.
If these formats are used and the private key is part of the digital certificate, then
setting s s l _ s e r v e r _ k e y is optional.
For example:
ssl_server_identity = certs/server.cert.pem
ssl_server_key
ssl_server_key = private_key
The server’s private key. If it is included in the digital certificate in
s s l _ s e r v e r _ i d e n t i t y, then this parameter is not needed.
This parameter supports private keys in the following formats: PEM, DER,
PKCS#12.
You must specify a path to a file that contains the key.
ssl_password
ssl_password = password
Private key or password for private keys.
This password can optionally be specified on the command line when t i b e m s d is
started.
If SSL is enabled, and the password is not specified with this parameter or on the
command line, t i b e m s d will ask for the password upon startup.
You can set passwords by way of the t i b e m s a d m i n tool. When passwords are set
with this tool, the password is obfuscated in the configuration file. See Chapter 6,
Using the EMS Administration Tool, on page 115 for more information about
using t i b e m s a d m i n to set passwords.
ssl_server_issuer
ssl_server_issuer = chain_member
Certificate chain member for the server. The server reads the certificates in the
chain in the order they are presented in this parameter.
The same certificate can appear in multiple places in the certificate chain.
The certificates must be in PEM, DER, PKCS#7, or PKCS#12 format.
See File Names for Certificates and Keys on page 445 for more information on file
types for digital certificates.
ssl_server_trusted
ssl_server_trusted = certificates
List of CA root certificates the server trusts as issuers of client certificates.
Specify only CA root certificates. Do not include intermediate CA certificates.
The certificates must be in PEM, DER, or PKCS#7 format. You can either provide
the actual certificates, or you can specify a path to a file containing the certificate
chain.
For example:
ssl_server_trusted = certs\CA1_root.pem
ssl_server_trusted = certs\CA2_root.pem
See File Names for Certificates and Keys on page 445 for more information on file
types for digital certificates.
ssl_rand_egd
ssl_rand_egd = pathname
The path for the installed entropy gathering daemon (EGD), if one is installed.
This daemon is used to generate random numbers for C clients and the EMS
server. Java clients do not use this parameter.
ssl_crl_path
ssl_crl_path = pathname
A non-null value for this parameter activates the server’s certificate revocation list
(CRL) feature.
The server reads CRL files from this directory. The directory should contain only
CRL files. If other files are located in the pathname directory, SSL initialization will
fail.
ssl_crl_update_interval
ssl_crl_update_interval = hours
The server automatically updates its CRLs at this interval (in hours).
When this parameter is absent, the default is 24 hours.
ssl_auth_only
ssl_auth_only = enable | disable
When e n a b l e d , the server allows clients to request the use of SSL only for
authentication (to protect user passwords). For an overview of this feature, see
fips140-2
fips140-2 = true | false
When t r u e , the EMS server is enabled to run in FIPS 140-2 compliant mode.
When f a l s e or excluded, the server is not FIPS compliant. For more information,
see Enabling FIPS Compliance on page 459.
LDAP Parameters
See Chapter 8, Authentication and Permissions, on page 247 for more information
about these parameters.
ldap_url
URL of the external directory server. This can take the following forms:
L D A P : / / host: tcp_port
or
L D A P S : / / host: ssl_port
For example:
LDAP://myLdapServer:1855
ldap_principal
ldap_principal = DN
The distinguished name (DN) of the LDAP user that the EMS sever uses to bind
to the LDAP server. This user must have privileges that allow it to bind and
browse group users, but does not necessarily need to have administrative
privileges.
For example:
ldap_principal = "cn=Manager"
ldap_credential
ldap_credential = password
The password associated with the user defined in the l d a p _ p r i n c i p a l property.
This value must be specified and cannot be an empty string.
ldap_cache_enabled
ldap_cache_enabled = enable | disable
ldap_cache_ttl
ldap_cache_ttl = seconds
Specifies the maximum time (in seconds) that cached LDAP data is retained
before it is refreshed.
ldap_conn_type
ldap_conn_type = [ldaps | startTLS]
Specifies the type of connection that the server uses to get LDAP information.
• When this parameter is absent, LDAP connections use TCP (non-secure). For
backward compatibility, this is the default setting.
• l d a p s —Use SSL on the LDAP connection (secure).
• s t a r t T L S —Use the startTLS extension to the LDAP version 3 protocol
(secure).
ldap_tls_cacert_file
ldap_tls_cacert_file = pathname
This file contains the CA certificate that the EMS server trusts to sign the LDAP
server’s certificate.
You must provide ldap_tls_cacert_file in order to create secure connections.
Optionally, l d a p _ t l s _ c a c e r t _ d i r can be used in addition to
l d a p _ t l s _ c a c e r t _ f i l e in order to specify a directory with additional individual
CA certificates.
ldap_tls_cacert_dir
ldap_tls_cacert_dir = pathname
When there are two or more CA certificates in the verify chain, the server scans
this directory for CA certificates.
You must also provide ldap_tls_cacert_file in order to create secure connections.
l d a p _ t l s _ c a c e r t _ d i r is an optional parameter that can be used in addition to
l d a p _ t l s _ c a c e r t _ f i l e in order to specify a directory with additional individual
CA certificates.
ldap_tls_cipher_suite
ldap_tls_cipher_suite = cipher_suite
Optional. You can specify the cipher suite to use for encryption on secure LDAP
connections.
This parameter must follow the OpenSSL cipher string syntax; see Specifying
Cipher Suites on page 452. You must use short names when specifying the suite.
For example, use D E S - C B C - S H A rather than S S L _ R S A _ W I T H _ D E S _ C B C _ S H A . Using
long names results in an authorization error when connecting to a client.
In addition to the actual cipher names, you may specify cipher quality; for
example:
• HIGH
• HIGH:MEDIUM
ldap_tls_rand_file
ldap_tls_rand_file = pathname
When the operating system does not include a random data feature, this file is the
source of random data for encryption.
ldap_tls_cert_file
ldap_tls_cert_file = pathname
When the LDAP server requires client authentication, use the certificate in this file
to identify the EMS server.
ldap_tls_key_file
ldap_tls_key_file = pathname
When the LDAP server requires client authentication, use the private key in this
file.
When you plan to start the server remotely, we recommend that you do not
password-encrypt the key file.
See Chapter 8, Authentication and Permissions, on page 247 for more information
about these parameters.
ldap_user_class
ldap_user_class = class_name
Name of the LDAP object class that stores users.
For example:
ldap_user_class = person
ldap_user_attribute
ldap_user_attribute = attribute
Name of the attribute on the user object class that holds the name of the user.
For example:
ldap_user_attribute = uid
ldap_user_base_dn
ldap_user_base_dn = DN
Base distinguished name (DN) of the LDAP tree that contains the users.
For example:
ldap_user_base_dn = "ou=People,dc=Corp"
ldap_user_scope
ldap_user_scope = onelevel | subtree
Specifies how deeply under the base DN to search for users. You can specify
o n e l e v e l and s u b t r e e for this parameter. o n e l e v e l specifies to search only one
level below the DN, s u b t r e e specifies to search all sub-trees.
For example:
ldap_user_scope = subtree
ldap_user_filter
ldap_user_filter = filter
Optional LDAP search filter for finding a given user name. Use % s as the
placeholder for the user name in the filter. For example:
uid=%s
The full LDAP search grammar is specified in RFC 2254 and RFC 2251.
If unspecified, then a default search filter is generated based on the user object
class and user name attribute.
ldap_all_users_filter
ldap_all_users_filter = filter
An optional LDAP search filter for finding all users beneath the user base DN.
If not specified, then a default search filter is generated based on the user object
class and user name attribute.
See Chapter 8, Authentication and Permissions, on page 247 for more information
about these parameters.
ldap_group_base_dn
ldap_group_base_dn = DN
Base distinguished name (DN) of the LDAP tree that contains groups.
For example:
ldap_group_base_dn = "ou=Groups,dc=Corp"
ldap_group_scope
ldap_group_scope = onelevel | subtree
Specifies how deeply under the base DN to search for groups. You can specify
o n e l e v e l and s u b t r e e for this parameter. o n e l e v e l specifies to search only one
level below the DN, s u b t r e e specifies to search all sub-trees.
For example:
ldap_group_scope = subtree
ldap_group_filter
ldap_group_filter = filter
Optional LDAP search filter for finding a group with a given group name. Use % s
as the placeholder for the group name in the filter.
The full LDAP search grammar is specified in RFC 2254 and RFC 2251.
If unspecified, then a default search filter is generated based on the group object
class and group attribute.
For example:
ldap_group_filter =
"(|(&(cn=%s)(objectClass=groupofUniqueNames))(&(cn=%s)
(objectClass=groupOfURLs)))"
ldap_all_groups_filter
ldap_all_groups_filter = filter
Optional LDAP search filter for finding all groups beneath the group base DN.
If unspecified, then a default search filter is generated based on the group object
class and group attribute.
ldap_static_group_class
ldap_static_group_class = name
Name of the LDAP object class that stores static groups.
For example:
ldap_static_group_class = groupofuniquenames
ldap_static_group_attribute
ldap_static_group_attribute = class
Name of the attribute on the static group object class that holds the name of the
group.
For example:
ldap_static_group_attribute = cn
ldap_static_member_attribute
ldap_static_member_attribute = attribute
Attribute of an LDAP static group object that specifies the distinguished names
(DNs) of the members of the group.
For example:
ldap_static_member_attribute = uniquemember
ldap_dynamic_group_class
ldap_dynamic_group_class = class
Name of the LDAP object class that stores dynamic groups.
For example:
ldap_dynamic_group_class = groupofURLs
ldap_dynamic_group_attribute
ldap_dynamic_group_attribute = attribute
Name of the attribute on the dynamic group object class that holds the name of
the group. For example:
ldap_dynamic_group_attribute = cn
ldap_dynamic_member_url_attribute
ldap_dynamic_member_url_attribute = attribute
Attribute of the dynamic LDAP group object that specifies the URLs of the
members of the dynamic group.
For example:
ldap_dynamic_member_url_attribute = memberURL
jaas_classpath
jaas_classpath = classpath
Includes the JAR files and dependent classes used by the JAAS LoginModule.
This parameter is required to enable the extensible security feature for
authentication.
For example:
jaas_classpath = .:/usr/local/custom/user_jaas_plugin.jar
jaas_config_file
jaas_config_file = file-name
Specifies the location of the JAAS configuration file used by the EMS server to run
a custom authentication LoginModule. For more information, see Loading the
LoginModule in the EMS Server on page 276.
This parameter is required to enable the extensible security feature for
authentication.
For example:
jaas_config_file = jaas.conf
jaas_login_timeout
jaas_login_timeout = milliseconds
Specifies the length of time, in milliseconds, that the EMS server will wait for the
JAAS authentication module to execute and respond. This timeout is used each
time the server passes a username and password to the LoginModule. If the
module does not return a response, the server denies authentication.
This parameter is optional. If it is not included, the default timeout is 500
milliseconds.
For example:
jaas_login_timeout = 250
jaci_classpath
jaci_classpath = classpath
Includes the JAR files and dependent classes used by the JACI custom
permissions module. This parameter is required to enable the extensible security
feature for granting permissions.
For example:
jaci_classpath = .:/usr/local/custom/user_jaci_plugin.jar
jaci_class
jaci_class = class-name
Specifies the name of the class that implements the extensible permissions
interface. The class must be written using the Java Access Control Interface
(JACI). For more information about writing a custom application using JACI to
grant permissions, see Writing a Permissions Module on page 282.
For example:
jaci_class = com.userco.auth.CustomAuthorizer
jaci_timeout
jaci_timeout = milliseconds
Specifies the length of time, in milliseconds, that the EMS server will wait for the
JACI permissions module to execute and respond. This timeout is used each time
the server passes a destination, username, and action to the permissions module.
If the module does not return a response, the server denies authorization.
This parameter is optional. If it is not included, the default timeout is 500
milliseconds.
For example:
jaci_timeout = 250
JVM Parameters
These parameters enable and configure the Java virtual machine (JVM) in the
EMS server. For more information on how JVM work in EMS, see Enabling the
JVM on page 284.
jre_library
jre_library = path
Enables the JVM in the EMS server, where path is the absolute path to the j v m . d l l
shared library file that is installed with JRE. If this parameter is not included, the
JVM is disabled by default.
If the path contains any spaces, the path must be enclosed in quotation marks.
For example:
jre_library = "C:\Program Files\Java\jdk1.6.0_04\jre\bin\server\jvm.dll"
jre_option
jre_option = JVMoption
Passes command line options to the JVM at start-up. The j r e _ o p t i o n parameter
can be used to define Java system properties, which are used by applications
running in the JVM, such as extensible security modules.
You can use multiple jre_option entries in order to pass more than one options to
the JVM. Permitted values for JVMoption include most JVM options that are
defined by Sun Microsystems.
For example, this restricts the maximum heap size of the JVM to 256 megabytes:
jre_option = -Xmx256m
In addition to the main configuration file, there are several other configuration
files used for various purposes:
Configuration See
Description
File Page
acl.conf Defines EMS access control lists. 222
routes.conf Defines routes between this and other EMS servers 235
These configuration files can be edited by hand, but you can also use the
administration tool or the administration APIs to modify some of these files. See
Chapter 6, Using the EMS Administration Tool, on page 115 for more information
about using the administration tool.
The following sections describe the configuration files.
acl.conf
This file defines all permissions on topics and queues for all users and groups.
The format of the file is:
T O P I C = topic U S E R = user P E R M = permissions
T O P I C = topic G R O U P = group P E R M = permissions
Q U E U E = queue U S E R = user P E R M = permissions
Q U E U E = queue G R O U P = group P E R M = permissions
A D M I N U S E R = user P E R M = permissions
A D M I N G R O U P = group P E R M = permissions
Example
ADMIN USER=sys-admins PERM=all
TOPIC=foo USER=user2 PERM=publish,subscribe
TOPIC=foo GROUP=group1 PERM=subscribe
bridges.conf
This file defines bridges between destinations. See Destination Bridges on page 79
for more information about destination bridges.
The format of the file is:
[destinationType:destinationName] # mandatory -- include brackets
destinationType=destinationToBridgeTo1 [selector="msg-selector"]
destinationType=destinationToBridgeTo2 [selector="msg-selector"]
...
Example
[topic:myTopic1]
topic=myTopic2
queue=myQueue1
channels.conf
This file defines the multicast channels over which messages published to
multicast-enabled topics are broadcast. Each channel defined in this file has a
unique name, and can have a different multicast address, multicast port, and
property values.
The format of the file is:
[ multicast-channel-name]
a d d r e s s = multicast-group-address: multicast-port
[ t t l = hops]
[ p r i o r i t y = priority]
[ m a x r a t e = size [ K B | M B | G B ] ]
[ m a x t i m e = seconds]
[ i n t e r f a c e = ip-address]
Example
[channel-1]
address=234.5.6.7:99
maxrate=10MB
maxtime=10
ttl=4
[channel-2]
address=234.5.3.9:99
maxrate=15MB
maxtime=10
ttl=3
durables.conf
This file defines static durable subscribers.
The file consists of lines with either of these formats:
topic-name durable-name
[route]
[ c l i e n t i d = id]
[nolocal]
[ s e l e c t o r = " msg-selector" ]
Example
topic1 dName1
topic2 dName2 clientid=myId,nolocal
topic3 dName3 selector="urgency in (’high’,’medium’)"
topic4 Paris route
Conflicting When the server detects an conflict between durable subscribers, it maintains the
Specifications earliest specification, and outputs a warning. Consider these examples:
• A static specification in this file takes precedence over a new durable
dynamically created by a client.
factories.conf
This file defines the connection factories for the internal JNDI names.
The file consists of factory definitions with this format:
[factory-name] # mandatory -- square brackets included
type = generic|xageneric|topic|queue|xatopic|xaqueue|
url = url-string
metric = connections | byte_rate
clientID = client-id
[connect_attempt_count|connect_attempt_delay|
connect_attempt_timeout|reconnect_attempt_count|
reconnect_attempt_delay|reconnect_attempt_timeout = value]
[ssl-prop = value]*
url This string specifies the servers to which this factory creates
connections:
• A single URL specifies a unique server. For example:
tcp://host1:8222
metric The factory uses this metric to balance the load among a group of
servers:
• c o n n e c t i o n s —Connect to the server with the fewest client
connections.
• b y t e _ r a t e —Connect to the server with the lowest byte rate.
Byte rate is a statistic that includes both inbound and
outbound data.
When this parameter is absent, the default metric is c o n n e c t i o n s .
For cautionary information, see Load Balancing on page 233.
clientID The factory associates this client ID string with the connections
that it creates. The client ID cannot exceed 255 characters in
length.
connect_attempt_delay When attempting a first connection, the client sleeps for this
interval (in milliseconds) between attempts to connect to its
server (or in fault-tolerant configurations, iterations through its
URL list). When absent, the default is 500 milliseconds.
connect_attempt_timeout When attempting to connect to the EMS server, you can set this
connection timeout period to abort the connection attempt after a
specified period of time (in milliseconds).
reconnect_attempt_timeout When attempting to reconnect to the EMS server, you can set this
connection timeout period to abort the connection attempt after a
specified period of time (in milliseconds).
multicast_daemon Use the parameter to specify the TCP port that the client will use
when establishing a connection to the multicast daemon.
This parameter determines the behavior of the EMS client but
does not affect the multicast daemon. The multicast daemon must
listen for the client on the same port that the client uses to
connect. To change the TCP port that the multicast daemon listens
on, use the - l i s t e n command line argument in the daemon. See
Command Line Options on page 352 for more information.
See Chapter 13, Using Multicast for information on multicast.
Example
[north_america]
type = topic
url = tcp://localhost:7222,tcp://server2:7222
clientID = "Sample Client ID"
ssl_verify_host = disabled
Load Balancing
groups.conf
This file defines all groups. The format of the file is:
group-name1: " description"
user-name1
user-name2
group-name2: " description"
user-name1
user-name2
Example
administrators: "TIBCO Enterprise Message Service administrators"
admin
Bob
jaas.conf
This file directs the TIBCO Enterprise Message Service server to the JAAS
LoginModule. See Loading the LoginModule in the EMS Server on page 276 for
more information about the j a a s . c o n f file.
queues.conf
This file defines all queues. The format of the file is:
[ jndi-name1, jndi-name2, . . . ] queue-name property1, property2, . . .
Note that, while including JNDI names is optional, the square brackets [ ] must
be included around JNDI names if they are included. For more information about
setting JNDI names, see c r e a t e j n d i n a m e on page 124.
Only queues listed in this file or queues with names that match the queues listed
in this file can be created by the applications (unless otherwise permitted by an
entry in a c l . c o n f ). For example, if queue f o o . * is listed in this file, queues
f o o . b a r and f o o . b a z can be created by the application.
Properties of the queue are inherited by all static and dynamic queues with
matching names. For example, if t e s t . * has the property s e c u r e , then t e s t . 1
and t e s t . f o o are also secure. For information on properties that can be assigned
to queues, see Destination Properties on page 55.
For further information on the inheritance of queue properties, refer to Wildcards
* and > on page 74 and Inheritance of Properties on page 77.
In the sample file, a > wildcard at the beginning of the file allows the applications
to create valid queues with any name. A > at the beginning of the queue
configuration file means that name-matching is not required for creation of
queues.
Restrictions and rules on queue names are described in Destination Name Syntax
on page 52.
routes.conf
This file defines routes between this TIBCO Enterprise Message Service server
and other TIBCO Enterprise Message Service servers.
Example
[test_route_2]
url = tcp://server2:7222
ssl_verify_host = disabled
stores.conf
This file defines the locations, either store files, mstore, or a database, where the
EMS server will store messages or metadata (if the default $ s y s . m e t a definition
is overridden). You can configure one or many stores in the s t o r e s . c o n f file.
Each store configured is either a file-based store, mstore, or a database store.
File-based store and mstore parameters are described here. Database store
parameters are described in Chapter 10, Using Database Stores.
The format of the file is:
[ store_name] # m a n d a t o r y - - s q u a r e b r a c k e t s i n c l u d e d
type=file
f i l e = name
[file_crc=true|false]
[ f i l e _ m i n i m u m = value]
[ f i l e _ t r u n c a t e = value]
[mode=async|sync]
[ store_name]
type=mstore
f i l e = name
[ s c a n _ i t e r _ i n t e r v a l = time m s e c | s e c | m i n | h o u r | d a y ]
[ s c a n _ t a r g e t _ i n t e r v a l = time m s e c | s e c | m i n | h o u r | d a y ]
type Identifies the store type. This parameter is required for all store
types. The t y p e can be:
• file — for file-based stores.
• mstore — for mstores.
• dbstore — for database stores.
For information about the parameters used to configure database
stores, see Configuration in stores.conf on page 289.
file_crc This parameter specifies whether the EMS server uses CRC to
validate data integrity when reading the store files.
When this parameter is absent, the default is t r u e .
file_minimum This parameter preallocates disk space for the store file.
Preallocation occurs when the server first creates the store file.
You can specify units of M B or G B . Zero is a special value, which
specifies no minimum preallocation. Otherwise, the value
specified must be greater than 4 M B .
For example:
file_minimum = 32MB
mstore Parameters
scan_iter_interval Determines the length of time between each interval of the store
scan. The EMS server begins scanning a new section of the mstore
at the time interval specified here.
Specify time in units of m s e c , s e c , m i n , h o u r or d a y to describe the
time value as being in milliseconds, seconds, minutes, hours, or
days, respectively. For example:
scan_iter_interval=100msec
Example
[my_sync]
type = file
file = /var/local/tibems/my_sync.db
file_crc = true
Example
[mstore1]
type = mstore
file = /var/local/tibems/mstore1.db
scan_iter_interval=100msec
scan_target_interval=12hour
tibrvcm.conf
This file defines the TIBCO Rendezvous certified messaging (RVCM) listeners for
use by topics that export messages to a t i b r v c m transport. The server preregisters
these listeners when the server starts up so that all messages (including the first
message published) sent by way of the t i b r v c m transport are guaranteed. If the
server does not preregister the RVCM listeners before exporting messages, the
listeners are created when the first message is published, but the first message is
not guaranteed.
The format of this file is
transport listenerName subjectName
Example
RVCM01 listener1 foo.bar
RVCM01 listener2 foo.bar.bar
topics.conf
This file defines all topics. The format of the file is:
[ jndi-name1, jndi-name2, . . . ] topic-name property1, property2, . . .
Note that, while including JNDI names is optional, the square brackets [ ] must
be included around JNDI names if they are included. For more information about
setting JNDI names, see c r e a t e j n d i n a m e on page 124.
Only topics listed in this file or topics with names that match the topics listed in
this file can be created by the applications (unless otherwise permitted by an
entry in a c l . c o n f ). For example, if topic f o o . * is listed in this file, topics
f o o . b a r and f o o . b a z can be created by the application.
Properties of the topic are inherited by all static and dynamic topics with
matching names. For example, if t e s t . * has the property s e c u r e , then t e s t . 1
and t e s t . f o o are also secure. For information on properties that can be assigned
to topics, see Destination Properties on page 55.
For further information on the inheritance of topic properties, refer to Wildcards *
and > on page 74 and Inheritance of Properties on page 77.
Restrictions and rules on topic names are described in Destination Name Syntax
on page 52.
transports.conf
This file defines transports for importing messages from or exporting messages to
external message services, such as TIBCO Rendezvous and TIBCO SmartSockets.
The format of the file is:
[transport_name] # mandatory -- square brackets included
type = tibrv | tibrvcm | tibss # mandatory
[topic_import_dm = TIBEMS_PERSISTENT |
TIBEMS_NON_PERSISTENT |
TIBEMS_RELIABLE]
[queue_import_dm = TIBEMS_PERSISTENT |
TIBEMS_NON_PERSISTENT |
TIBEMS_RELIABLE]
[export_headers = true | false]
[export_properties = true | false]
transport-specific-parameters
Transport-specific Parameters
If t y p e = t i b r v, the extended syntax is:
[ s e r v i c e = service]
[ n e t w o r k = network]
[ d a e m o n = daemon]
[ t e m p _ d e s t i n a t i o n _ t i m e o u t = seconds]
[rv_queue_policy = [TIBRVQUEUE_DISCARD_NONE |
TIBRVQUEUE_DISCARD_FIRST |
T I B R V Q U E U E _ D I S C A R D _ L A S T ] : max_msgs: qty_discard]
Example
[RV01]
type = tibrv
topic_import_dm = TIBEMS_RELIABLE
queue_import_dm = TIBEMS_PERSISTENT
service = 7780
network = lan0
daemon = tcp:host5:7885
[RVCM01]
type = tibrvcm
export_headers = true
export_properties = true
rv_tport = RV02
cm_name = RVCMTrans1
ledger_file = ledgerFile.store
sync_ledger = true
request_old = true
default_ttl = 600
[SS01]
type = tibss
server_names = tcp:rtHost2A:5555, ssl:rtHost2B:5571
username = emsServer6
password = myPasswd
project = mfg_process_control
override_lb_mode = enable
delivery_mode = gmd_some
[RV02]
type = tibrv
topic_import_dm = TIBEMS_PERSISTENT
queue_import_dm = TIBEMS_PERSISTENT
service = 7780
network = lan0
daemon = tcp:host5:7885
rv_queue_policy = TIBRVQUEUE_DISCARD_LAST:10000:100
users.conf
This file defines all users. The format of the file is:
username: password: " description"
password Leave this item blank when creating a new user. For
example:
bob::"Bob Smith"
Example
admin::"Administrator"
Bob::"Bob Smith"
Bill::"Bill Jones"
After the server has started and passwords have been assigned, the file will look
like this:
admin:$1$urmKVgq78:"Administrator"
Bob:$2$sldfkj;lsafd:"Bob Smith"
Bill:$3$tyavmwq92:"Bill Jones"
You can create users and assign passwords to the users to control access to the
EMS server. EMS can also be configured to use an external directory (such as an
LDAP server) to control access to the server.
You can also assign permissions to users and groups to control actions that can be
performed on destinations.
This chapter describes authentication and permissions in EMS.
Topics
Administrator Permissions
Administrators are a special class of users that can manage the EMS server.
Administrators create, modify, and delete users, destinations, routes, factories,
and other items. In general, administrators must be granted permission to
perform administration activities when using the administration tool or API.
Administrators can be granted global permissions (for example, permission to
create users or to view all queues), and administrators can be granted permissions
to perform operations on specific destinations (for example, purging a queue, or
viewing properties for a particular topic).
You should control access to the configuration files so that only certain system
administrators can view or modify the configuration files. If a user can view or
modify the configuration files, setting permissions to control which destination
that user can manage would not be enforced when the user manually edits the
files.
Use the facilities provided by your Operating System to control access to the
server’s configuration files.
Any type of modification to an item requires that the user can view that item.
Therefore, granting any create, modify, delete, change, or purge permission
implicitly grants the permission to view the associated item.
Granting the view permissions is useful when you want specific users to only be
able to view items. It is not necessary to grant the view permission if a user
already has a permission that allows the user to modify the item.
Global permissions are stored in the a c l . c o n f file, along with all other
permissions. Global permissions in this file have the following syntax:
A D M I N U S E R = < username> P E R M = < permission>
or
A D M I N G R O U P = < groupname> P E R M = < permission>
Destination-Level Permissions
Administrators can be granted permissions on each destination. Destination-level
permissions control the administration functions a user can perform on a specific
destination. Global permissions granted to a user override any destination-level
permissions.
The typical use of destination-level administration permissions is to specify
permissions on wildcard destinations for different groups of users. This allows
you to specify particular destinations over which a group of users has
administrative control. For example, you may allow one group to control all
A C C O U N T I N G . * topics, and another group to control all P A Y R O L L . * queues.
Any type of modification to an item requires that the user can view that item.
Therefore, granting create, modify, delete, change, or purge implicitly grants the
permission to view the associated item.
Granting the view permissions is useful when you want specific users to only be
able to view items. It is not necessary to grant the view permission if a user
already has a permission that allows the user to modify the item.
Both user and administrator permissions for a destination are stored in the same
entry in the a c l . c o n f file. This is for convenience rather than for clarity. User
permissions specify the actions a client application can perform on a destination
(publish, subscribe, send, receive, and so on). Administrator permissions specify
what administrative commands the user can perform on the destination when
using the administration tool or API.
Protection Permissions
Protection permissions allow you to group users into administrative domains so
that administrators can only perform actions within their domain. An
administrator can only perform administrative operations on a user that has the
same protection permission as the user. There are four protection permissions
(p r o t e c t 1 , p r o t e c t 2 , p r o t e c t 3 , and p r o t e c t 4 ) that allow you to create four
groups of administrators. Protection permissions do not apply to the a d m i n user
or users in the $ a d m i n group — these users can perform any action on any user
regardless of protection permissions.
To use protection permissions, grant one of the protection permissions to a set of
users (either individually, or to a defined group(s)). Then, grant the same
protection permission to the administrator that can perform actions on those
users.
For example, there are four departments in a company: sales, finance,
manufacturing, and system administrators. Each of these departments has a
defined group and a set of users assigned to the group. Within the system
administrators, there is one manager and three other administrators, each
Administrators can enable or disable access control for the server. Administrators
can also enable and disable permission checking for specific destinations.
Server Control
The property in the main configuration file enables or disables the checking of
permissions for all destinations managed by the server. The a u t h o r i z a t i o n
property also enables or disables verification of user names and passwords.
Destination Control
When server a u t h o r i z a t i o n is enabled, the server checks user names and
password of all connections without exceptions. However, operations on
destinations, such as sending a message or receiving a message, are not verified
unless the destination has enabled the s e c u r e property on the destination. All
operations by applications on the destination with s e c u r e enabled are verified by
the server according to the permissions listed in a c l . c o n f . Destinations with
s e c u r e disabled continue to operate without any restrictions.
When a destination does not have the s e c u r e property set, any authenticated
user can perform any actions on that topic or queue.
See Destination Properties on page 55 for more information about destination
properties.
User permissions apply to the activities a user can perform on each destination
(topic and queue). Using permissions you can control which users have
permission to send, receive, or browse messages for queues. You can also control
who can publish or subscribe to topics, or who can create durable subscriptions to
topics. Permissions are stored in the access control list for the server.
Groups allow you to create classes of users and control permissions on a more
global level. Rather than granting and revoking permissions on destinations to
individual users, you can control destination access at the group level. Users
inherit any permissions from each of the groups they belong to, in addition to any
permissions that are granted to them directly.
Figure 15 illustrates the relationships between users, groups and permissions.
External Directory
Users Groups
Employees:
gale
gale
jean
jean
perry
perry
Externally-configured users and groups are defined and managed using the
external directory. Locally-configured users and groups, as well as the access
control list, are configured using any of the administration interfaces (editing
configuration files, using the administration tool, or the administration APIs).
Access control and Secure Sockets Layer (SSL) have some similar characteristics.
SSL allows for servers to require user authentication by way of the user’s digital
certificate. SSL does not, however, specify any access control at the destination
level. SSL and the access control features described in this chapter can be used
together or separately to ensure secure access to your system. See Chapter 18,
Using the SSL Protocol, on page 441 for more information about SSL.
Users
Users are specific, named IDs that allow you to identify yourself to the server.
When a client logs in, the connect request should be accompanied by a username
and the password associated with the username.
In special cases, you may wish to allow anonymous access to the server. In this
case, a connect request does not have to supply a username or password. To
configure the server to allow anonymous logins, you must create a user named
a n o n y m o u s and specify no password. Anonymous logins are not permitted unless
the anonymous user exists.
Clients logging in anonymously are only able to perform the actions that the
a n o n y m o u s user has permission to perform.
Groups
Groups allow you to create classes of users. Groups make access control
administration significantly simpler because you can grant and revoke
permissions to large numbers of users with a single operation on the group. Each
user can belong to as many groups as necessary. A user’s permissions are the
union of the permissions of the groups the user belongs to, in addition to any
permissions granted to the user directly.
You can create, remove, or add users to groups by specifying the groups in
g r o u p s . c o n f , using the t i b e m s a d m i n tool, or by using the administration APIs.
For more information about specifying groups in the configuration file, see
g r o u p s . c o n f on page 233. For more information about specifying groups using
the t i b e m s a d m i n tool, see Chapter 6, Using the EMS Administration Tool, on
page 115. For more information on the administration APIs, see the online
documentation.
Group Information
Group information stored in an external directory can also be retrieved by the
EMS server. Static and dynamic groups are supported and you can configure the
EMS server to retrieve either or both.
but it has no effect on the external directory. The externally-defined user can once
again log in, and the user is created in the server’s memory and any groups to
which the user belongs are also created. However, any permissions for the user or
group have been deleted and therefore must be re-granted.
External
Directory Server Parameter Configuration
ldap_user_class = Person
ldap_user_attribute = uid
ldap_user_base_dn = ou=people,
o = < your_organization>
ldap_user_filter =
(&(uid=%s)(objectclass=person))
ldap_group_base_dn = "ou=groups,
o = < your_organization>
ldap_group_filter =
(|(&(cn=%s)(objectclass=groupofUniqueNames))(&
(cn=%s)(objectclass=groupOfURLs)))
ldap_static_group_class = groupofuniquenames
ldap_static_group_attribute = cn
ldap_static_member_attribute = uniquemember
ldap_dynamic_group_class = groupofURLs
ldap_static_group_member_filter =
(&(uniquemember=%s)(objectclass=groupofuniquen
ames))
ldap_dynamic_group_class = groupofURLs
ldap_dynamic_group_attribute = cn
ldap_dynamic_member_url_attribute = memberURL
External
Directory Server Parameter Configuration
ldap_user_class = user
ldap_user_attribute = cn
ldap_user_filter = (&(cn=%s)(objectclass=user))
ldap_group_filter =
(&(cn=%s)(objectclass=group))
ldap_static_group_class = group
ldap_static_group_attribute = cn
ldap_static_member_attribute = member
ldap_static_group_member_filter =
(&(member=%s)(objectclass=group))
ldap_group_base_dn = ou=groups,
d c = < your_domain_component> , d c = < your_domain_component>
ldap_group_filter =
(&(cn=%s)(objectclass=groupofnames))
ldap_static_group_class = groupofnames
ldap_static_group_attribute = cn
ldap_static_member_attribute = member
ldap_static_group_member_filter =
(&(member=%s)(objectclass=groupofnames))
User Permissions
User permissions are stored in the access control list and determine the actions a
user can perform on a destination. A user’s permissions are the union of the
permissions granted explicitly to that user along with any permissions the user
receives by belonging to a group.
When granting user permissions, you specify the user or group to whom you
wish to grant the permission, the name of the destination, and the permission(s)
to grant. Granting permissions is an action that is independent from both the
a u t h o r i z a t i o n server parameter, and the s e c u r e property of the relevant
destinations. The currently granted permissions are stored in the access control
file, however, the server enforces them only if the a u t h o r i z a t i o n is enabled, and
only for secure destinations.
When setting permissions for users and groups defined externally, user and
group names are case-sensitive. Make sure you use the correct case for the name
when setting the permissions.
Name Description
receive permission to create queue receivers
Name Description
subscribe permission to create non-durable subscribers on the topic
This set of permissions means that b o b can subscribe to topic f o o and publish
messages to it, but b o b cannot create durable subscribers to f o o .
If b o b is a member of group e n g i n e e r i n g and the group has the following entry
in the acl file:
GROUP=engineering TOPIC=bar PERM=subscribe,publish
This chapter outlines how to develop and implement custom authentication and
permissions modules.
Topics
The extensible security feature allows you to use your own authentication and
permissions systems, in addition to the default LDAP server included in EMS, to
authenticate users and authorize them to perform actions such as publish and
subscribe operations. Developing custom applications to grant authentication and
permissions gives you more flexibility in architecting your system.
How Extensible Extensible security works by allowing you to write your own authentication and
Security Works permissions modules, which run in a Java virtual machine (JVM) in the EMS
server. The modules connect to the server using the Java Authentication and
Authorization Service (JAAS) for authentication modules, and the Java Access
Control Interface (JACI) for permissions modules.
If the extensible security features are enabled when the EMS server starts, the
server checks each user as it connects for authentication, and checks user
permissions when they attempt to perform actions that require authorization.
Permission results are cached in the server for specified timeouts, and the
permissions module is re-invoked when a cached permission expires. The server
then replaces the old permission data with new data.
Extensible authentication and extensible permissions are enabled in the
t i b e m s d . c o n f configuration file. Extensible security modules can connect to
external security services, such as single sign on (SSO) servers or LDAP
directories, which operate outside of the TIBCO Enterprise Message Service
framework. Extensible security modules can work in tandem with other
authorization and permissions methods, such as LDAP or the EMS a c l . c o n f
configuration file. Figure 16 on page 273 shows the different security methods
available in the server.
users.conf acl.conf
JVM
Extensible Authentication
The extensible authentication feature uses the Java virtual machine (JVM) and the
Java Authentication and Authorization Service (JAAS) to allow you to run your
own Java-based authentication module in the EMS server.
Your authentication module, or LoginModule, runs in the JVM within the EMS
server, and is accessed by t i b e m s d using the JAAS interface. This is a flexible way
to extend the security of your EMS application. The LoginModule can be used to
augment existing authentication processes, or can be the sole method of
authentication used by the EMS server. The u s e r _ a u t h parameter in the main
configuration file determines when the LoginModule is used.
Each time an EMS client attempts to create a connection to the server, the server
will authenticate the client before accepting the connection. When extensible
authentication is enabled, t i b e m s d passes the username and password to the
LoginModule, which returns an allow or deny response.
If more than one authentication mechanism is enabled, it’s important to note the
order that the authentication processes are employed, as determined by their
order in the u s e r _ a u t h parameter. The server will search each authentication
source in order, and if the user does not exist there, t i b e m s d passes the username
and password to the next source.
For example, if local authentication appears before JAAS authentication, the
server will search for the provided username and password first in the
u s e r s . c o n f file. If the user does not exist there, t i b e m s d passes the username
and password to the LoginModule, which allows or denies the connection
attempt.
Consider a connection request from a client with the username a v o g u s . If a v o g u s
exists in the u s e r s . c o n f , the EMS server will either authenticate or deny access to
a v o g u s based on the username and password located there. Only if a v o g u s does
not exist in the u s e r s . c o n f does the server pass the username and password to
the LoginModule.
Loading the The EMS server locates and loads the LoginModule based on the contents of the
LoginModule in configuration file specified by the j a a s _ c o n f i g _ f i l e parameter in the
the EMS Server t i b e m s d . c o n f file. Usually, the JAAS configuration file is named j a a s . c o n f . This
file contains the configuration information used to invoke the LoginModule.
The contents of the j a a s . c o n f file should follow the JAAS configuration syntax,
as documented at:
http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/login/Configuration.html
The LoginModule in the JAAS configuration file must have the name
EMSUserAuthentication.
Extensible Permissions
The extensible permissions feature uses the Java virtual machine (JVM) and the
Java Access Control Interface (JACI) to allow you to run your own Java-based
permissions module in the EMS server.
Your Permissions Module runs in the JVM within the EMS server, and connects to
t i b e m s d using the JACI interface. Like the LoginModule, the Permissions Module
provides an extra layer of security to your EMS application. It does not supersede
standard EMS procedures for granting permissions. Instead, the module
augments the existing process.
When a user attempts to perform an action, such as subscribing to a topic or
publishing a message, the EMS server checks the a c l . c o n f file, the Permissions
Module, and cached results from previous Permissions Module queries, for
authorization. This process is described in detail in How Permissions are Granted
on page 278.
Cached Permissions
In order to speed the authorization process, the EMS server caches responses
received from the Permissions Module in two pools, the allow cache and the deny
cache. Before invoking the Permissions Module, the server first checks these
caches for a cache entry matching the user’s request.
What is Cached Each cache entry consists of a username and action, and the authorization result
response from the Permissions Module:
• The username is specific; the cached permission applies only to this user.
• The action is also specific. Only one action is included in each cache entry.
Actions that require authorization are the same as those listed in the a c l . c o n f
file.
• The destination can include wildcards. That is, a single cache entry can
determine the user’s authorization to perform the action on multiple
destinations.
If the response from the Permissions Module authorized the action, the
permission is cached in the allow cache. If the action was denied, it is cached in
the deny cache.
How Long Permissions Module results also include timeouts, which determine how long the
Permissions are cache entry is kept in the cache before it expires. When a timeout has expired, the
Cached entry is removed from the cache. Because these timeouts are assigned by the
Permissions Module, you can control how often the Permissions Module is called,
and therefore how much load it puts on the EMS server.
Long timeouts on permissions cache entries can increase performance, but they
also lower the system’s responsiveness to changes in permissions. Consider
timeout lengths carefully when writing your Permissions Module.
Administering the You can view and reset cache statistics, as well as clear all cache entries. These
Cache commands are available in the administration tool:
• jaci showstats on page 131
• jaci resetstats on page 131
• jaci clear on page 131
If the Permissions Module does not respond to the request within the timeout
specified by the j a c i _ t i m e o u t parameter in the tibemsd.conf file, the server
denies authorization by default.
Actions that require permissions are the same as those listed in the a c l . c o n f file,
and include operations such as subscribe to a topic and publishing to a queue.
Permissions are described in a c l . c o n f on page 222. Figure 17 shows the decision
tree the server follows when granting or denying permissions.
No
No
No
Durable When a durable subscriber is disconnected from the EMS server, the server
Subscribers continues to accumulate messages for the client. However, while the client is
disconnected, there is no user associated with the durable subscriber. Because of
this, the server cannot immediately check permissions for a message that is
received when the client is not connected.
When a user later reconnects to the server and resubscribes to the durable
subscription, the server checks permissions for the subscribe operation itself, but
all messages in the backlog are delivered to the consumer without additional
permission checks.
Special There are some special circumstances under which the request, although it is not
Circumstances exactly matched in the a c l . c o n f file, will be denied without reference to either
the permissions cache or the Permissions Module. Any request will be denied if,
in the a c l . c o n f
• The username exists but is not associated with any destinations.
• The username exists and is associated with destinations, but not with the
specific destination in the request.
• The username is part of a group, but the group is not associated with any
destinations.
• The username is part of a group and the group is associated with destinations,
but not with the specific destination in the request.
In general entries in the a c l . c o n f file supersede entries in the Permissions
Module, allowing you to optimize permission checks in well-defined static cases.
When the a c l . c o n f does not mention the user, the Permissions Module is fully
responsible for permissions.
for permissions before checking the deny cache and before sending an uncached
permission request to the Permissions Module. In other words, the authorization
status cannot be changed until the timeout on the cache entry expires and it is
removed from the cache.
Similarly, an entry in the deny cache remains there until the timeout has expired
and the entry is removed. Only then does the EMS server send the request to the
Permissions Module, so that a change in status can take effect.
Overlapping wildcards can make this situation even more complex. For example,
consider these three destinations:
foo.*.baz
foo.bar.*
foo.>
• a u t h o r i z a t i o n —enables authorization.
• j a c i _ c l a s s —specifies the class that implements the Permissions Module.
• j a c i _ c l a s s p a t h —specifies the JAR files and dependent classes used by the
Permissions Module.
• The Permissions Module must be thread-safe. That is, the Permissions Module
must be able to function both in a multi-threaded environment and in a
single-threaded environment.
• The Permissions Module, like the LoginModule, should not employ long
operations, and should return values quickly. As these modules become part
of the EMS server’s message handling process, slow operations can have a
severe effect on performance.
Documentation of JACI classes and interfaces is available through
c o m . t i b c o . t i b e m s . t i b e m s d . s e c u r i t y.
The Java virtual machine (JVM) is a virtual machine on the Java platform, capable
of running inside the EMS server. Select independent Java modules can operate in
the JVM and plug into the EMS server. The JVM is required to use the following
TIBCO Enterprise Message Service features:
• Extensible Security—see Chapter 9, Extensible Security, on page 271.
• Database Stores—see Chapter 10, Using Database Stores, page 285.
This chapter describes how to configure the TIBCO Enterprise Message Service
server to store messages in a database. This chapter discusses only database
stores. For more information about file-based stores, see Store Messages in
Multiple Stores on page 29.
The optional database store feature requires the installation and use of Hibernate
Core for Java and associated jar files.
Topics
The EMS server can connect to a database, and store messages in one or more
database instances. The server connects to the database using Hibernate Core for
Java to interface between the database and the EMS server.
This section describes the steps required to configure and deploy database stores.
For general conceptual information about the multiple store feature, see Store
Messages in Multiple Stores on page 29.
Settings for creating and configuring database stores are managed in the EMS
server, and are transparent to clients. To configure the database stores feature,
follow these steps:
1. Enable the database store feature in the t i b e m s d . c o n f by setting the
parameters:
— dbstore_classpath
— dbstore_driver_name
— dbstore_driver_dialect
— jre_library
Configuration in tibemsd.conf
These parameters are set in the t i b e m s d . c o n f configuration file.
dbstore_classpath
dbstore_classpath = pathname
Includes all the JAR files required by the EMS server when employing the
database store feature. This parameter must be set when a store of type d b s t o r e
has been created in the s t o r e s . c o n f file.
Required JAR files are determined by the installed Hibernate release, and are
documented in the R E A D M E . t x t file that is located in the l i b / directory of the
Hibernate distribution. Many of these JAR files are version-specific, and the
required versions may change with new Hibernate releases. You should verify the
required version and modify the d b s t o r e _ c l a s s p a t h variable accordingly.
If you are using Hibernate release 3.2.5, for example, the d b s t o r e _ c l a s s p a t h
should include paths to the following JAR files:
• hibernate3.jar
• dom4j-1.6.1.jar
• commons-collections-2.1.1.jar
• commons-logging-1.0.4.jar
• ehcache-1.2.3.jar
• jta.jar
• cglib-2.1.3.jar
• antlr-2.7.6.jar
• c3p0-0.9.1.jar
• asm.jar
• asm-attrs.jar
• Database-specific driver JAR file. Supported jar files are listed in Database
Servers and Drivers in TIBCO Enterprise Message Service Installation.
For an example, see EMS_HOME/ s a m p l e s / c o n f i g / t i b e m s d - d b . c o n f .
dbstore_driver_name
dbstore_driver_name = name
Specifies the name of the JDBC driver used by Hibernate.
For example:
• If you are using the MySQL InnoDB database server:
dbstore_driver_name=com.mysql.jdbc.Driver
dbstore_driver_dialect
dbstore_driver_dialect = dialect
Specifies the Hibernate SQL dialect used to construct SQL commands.
For example, if you are using the MySQL with InnoDB database server:
dbstore_driver_dialect = org.hibernate.dialect.MySQLInnoDBDialect
The SQL dialect is defined by Hibernate. For a list of databases and the associated
dialects, see the readme.txt file located in the Hibernate install directory archive.
Configuration in stores.conf
This section describes parameters configured for each database store in the
s t o r e s . c o n f file. The s t o r e s . c o n f includes definitions for both database and
file-based stores. For information about configuring file-based stores, see
s t o r e s . c o n f on page 237.
[$sys.meta]
type=dbstore
dbstore_driver_url=jdbc:mysql://mysqlsrv_1:3306/sysmeta
dbstore_driver_username=admin
dbstore_driver_password=admin123
[$sys.failsafe]
type=dbstore
dbstore_driver_url=jdbc:sqlserver://sqlsrv_1:3415;databaseName=sysfs
dbstore_driver_username=admin
dbstore_driver_password=admin123
[$sys.failsafe]
type=dbstore
dbstore_driver_url=jdbc:oracle:thin:adminfs/admin123@//osrv_1:1521/orclperf
dbstore_driver_username=adminfs
dbstore_driver_password=admin123
For more information, see Configuration for the Oracle RAC Database below.
[$sys.failsafe]
type=dbstore
dbstore_driver_url=jdbc:db2://db2srv_1:50000/SYSFS
dbstore_driver_username=admin
dbstore_driver_password=admin123
The EMS Schema Export Tool must be used to export database tables when one or
more database stores are configured in the s t o r e s . c o n f file. That is, if any stores
of type d b s t o r e are configured, you must export the database schema before
starting the EMS server.
How the Schema When it is invoked, the Schema Export Tool accepts the t i b e m s d . c o n f file and
Export Tool reviews the database store parameters, then parses the s t o r e s . c o n f file.
Works Depending on the options specified when it was invoked, the Schema Export Tool
will create, drop, or update the database tables for the stores of type d b s t o r e that
are configured in the s t o r e s . c o n f file.
The tool can perform the selected actions on all database stores, or only on specific
stores. The Schema Export Tool can also print the database tables it creates to the
console, or export them either to the database or to a specified file.
Running the The Schema Export Tool is invoked from the command line. The tool can be
Schema Export invoked from its directory, or by giving the absolute path to the
Tool t i b e m s _ u t i l . j a r file. For example:
On Windows
> java -jar EMS_HOME\ b i n \ t i b e m s d _ u t i l . j a r options
Or
> java -jar c:\tibco\ems\6.0\bin\tibemsd_util.jar options
On Unix
> java -jar EMS_HOME/ b i n / t i b e m s d _ u t i l . j a r options
Or
$ java -jar /opt/tibco/ems/6.0/bin/tibemsd_util.jar options
This table shows the options that are used with the Schema Export Tool:
Option Description
-tibemsdconf pathname The absolute path to the t i b e m s d . c o n f file. For
example, on a UNIX system:
/opt/tibco/ems/6.0/samples/config/tibemsd.conf
Option Description
-store storename= c r e a t e | u p d a t e | d r o p Create, update, or drop the schema for one or more
specific stores that are named in the stores configuration
file.
If you choose the c r e a t e option for a schema that
already exists, the Schema Export Tool recreates the
schema.
Note that c r e a t e prints the schema to screen but does
not deploy it. You must use e x p o r t or e x p o r t t o f i l e in
order to implement the schema.
-dropall Drop all the stores found in the stores configuration file.
-updateall Update the schema for all stores configured in the found
in stores configuration file.
-help Print information about the schema export tool and its
options, and exit the tool.
Examples
The following examples show how the Schema Export Tool can be used to create
database schemas in various configurations.
Example 1 This example shows how the Schema Export Tool can be invoked from any
directory by giving the absolute path to the t i b e m s d _ u t i l . j a r :
$ java -jar /opt/tibco/ems/6.0/bin/tibemsd_util.jar -help
Example 2 In this example, the Schema Export Tool creates and exports database schemas for
all the stores found in the s t o r e s . c o n f that is set in the specified
t i b e m s d - m s s q l s e r v e r . c o n f file:
Example 3 In this example, the Schema Export Tool exports the database schema for the
$ s y s . f a i l s a f e store to the database:
Example 3 In this example, the Schema Export Tool writes the database schema for the
$ s y s . f a i l s a f e store to the file $ s y s . f a i l s a f e . d d l . l o g :
Example 4 In this example the Schema Export Tool creates and exports the database schema
for the store m y s t o r e 1 , but drops the schema associated with m y s t o r e 2 and
exports the change:
java –jar /opt/tibco/ems/6.0/bin/tibemsd_util.jar –tibemsdconf
/opt/tibco/ems/6.0/samples/config/tibemsd.conf -store
mystore1=create -store mystore2=drop -export
This chapter outlines how to develop EMS client applications in Java, C and C#.
Topics
JMS Specification
EMS implements the JMS 1.1 specification, as well as the earlier JMS 1.0.2b
specification for older clients. While the JMS 1.0.2b interfaces continue to be
supported, they may be deprecated in future releases of the JMS specification.
Newly developed applications should use the JMS 1.1 interfaces, and you should
discontinue the use of the older interfaces as soon as possible.
The code examples in this chapter illustrate the use of the JMS 1.1 interfaces.
Connection Factory
Creates
Connection
Creates
Session Message
Creates
Creates
Registers With
Sends To
Receives From (Asynch Messages)
(Synch Messages)
Message Listener
Topic or Queue
Creates
Queue Connection
or
Topic Connection
Creates
Queue Session
or Message
Topic Session
Creates
Creates
Queue Receiver,
Queue Sender Queue Browser,
or or
Topic Publisher Topic Subscriber
Registers With
Sends To Receives From
Message Listener
Queue
or
Topic
Common Facilities
Interfaces Specific Interfaces Description
(JMS 1.1) (JMS 1.0.2b)
Common Facilities
Interfaces Specific Interfaces Description
(JMS 1.1) (JMS 1.0.2b)
Sample Clients
Programmer Checklists
This section provides a checklist that outlines the steps for creating an EMS
application in each language:
• Java Programmer’s Checklist on page 302
• C Programmer’s Checklist on page 303
• C# Programmer’s Checklist on page 308
Install
• Install the EMS software release, which automatically includes the EMS j a r
files in the EMS_HOME/ l i b subdirectory.
• Add the full pathnames for the following j a r files to your C L A S S P A T H :
jms.jar
tibjms.jar
All jar files listed in this section are located in the l i b subdirectory of the TIBCO
Enterprise Message Service installation directory.
To use Entrust with an EMS client, you must separately purchase and install the
Entrust libraries. If you use the Entrust libraries, you must include them in the
CLASSPATH before the JSSE JAR files. To use Entrust with JDK, you must
download the unlimited strength policy JAR files from Sun's website and install
them in your local installation of JDK. For installation and configuration details,
see Entrust documentation.
See , Security Considerations, on page 109 for a complete discussion of what is
needed for a secure deployment.
Code
Import the following packages into your EMS application:
import javax.jms.*;
import javax.naming.*;
Compile
Compile your EMS application with the j a v a c compiler to generate a . c l a s s file.
For example:
javac MyApp.java
generates a M y A p p . c l a s s file.
Run
Use the j a v a command to execute your EMS . c l a s s file.
For example:
java MyApp
C Programmer’s Checklist
Developers of EMS C programs can use this checklist during the five phases of the
development cycle.
Install
• Install the EMS software release, which automatically includes the EMS client
libraries, binaries, and header files in the EMS_HOME/ l i b subdirectory.
Code
Application programs must:
• Add EMS_HOME/ i n c l u d e to the include path. (OpenVMS environments do
not require an include path; skip this item.)
• Include the t i b e m s . h header file:
#include <tibems/tibems.h>
• Programs that use the C administration API must also include the
e m s a d m i n . h header file:
#include <tibems/emsadmin.h>
Run
• UNIX If you use dynamic EMS libraries on a UNIX platform, the environment
variable $ L D _ L I B A R Y _ P A T H must include the EMS_HOME/ l i b directory
(which contains the shared library files). (On some UNIX platforms, this
variable is called $ S H L I B _ P A T H or $ S Y L I B _ L I B R A R Y _ P A T H ).
• Windows The P A T H must include the e m s \ 6 . 0 \ b i n directory.
• OpenVMS The installation procedure automatically installs the shareable
images required for using EMS dynamic libraries.
• All Platforms The application must be able to connect to a EMS server process
(t i b e m s d ).
32-Bit UNIX
In 32-bit UNIX environments, both shared and static libraries are available. We
recommend shared libraries to ease forward migration.
-lssl Programs that use SSL must link using these library
-lcrypto
flags.
-ltibemslookup Programs that use EMS LDAP lookup must link using
-lldap
these library flags.
-lxml2
-llber
64-Bit UNIX
In 64-bit UNIX environments, both shared and static libraries are available. We
recommend shared libraries to ease forward migration. In this release, 64-bit
libraries are available on HP-UX, Solaris, AIX and Linux (2.4 glibc 2.3) platforms.
To use 64-bit libraries, you must include TIBCO_HOME/ e m s / 6 . 0 / l i b / 6 4 in your
library path, and it must precede any other EMS directory in the library path.
-lssl Programs that use SSL must link using these library
-lcrypto
flags.
Microsoft Windows
For a list of Windows platforms that Release 6.0 supports, see the file r e a d m e . t x t
in the installation directory. Both DLLs and static libraries are available. We
recommend DLLs to ease forward migration.
libtibemslookup.lib Programs that use EMS LDAP lookup must link this
libxml2.lib
library.
OpenVMS
In OpenVMS environments, both shared and static libraries are available. We
recommend shared libraries to ease forward migration.
When upgrading from EMS 4.3 to 4.4 or later versions, EMS client executables
that were linked with the EMS 4.3 dynamic libraries (shareable images) must be
relinked to the new libraries after EMS 4.4 has been installed with its associated
third party libraries. The third party libraries are part of the full installation of
EMS.
C# Programmer’s Checklist
Developers of EMS C# programs can use this checklist during the four phases of
the development cycle.
Install
• Install the EMS software release, which automatically includes the EMS
assembly DLLs in the EMS_HOME\b i n subdirectory.
Code
• Import the correct EMS assembly (see Table 49).
Version DLL
.NET API TIBCO.EMS.dll
Compile
• Compile with any .NET compiler.
Run
• The EMS assembly must be in the global assembly cache (this location is
preferred), or in the system path, or in the same directory as your program
executable.
• To automatically upgrade to the latest .NET assemblies, include the
appropriate policy file in the global cache. See Automatic Upgrades Between
Versions for more information.
• The application must be able to connect to a EMS daemon process (t i b e m s d ).
Assembly Versioning
TIBCO Enterprise Message Service assembly DLLs are versioned using the format
1 . 0 . release. version, where release is the EMS release number version is an arbitrary
value. For example, the assembly version number for software release 6.0.0 is
similar to 1 . 0 . 6 0 0 . 8 .
Applications that use a release of EMS earlier than 6.0 do not use standard .NET
versioning. Prior to TIBCO Enterprise Message Service release 6.0.0, all EMS .NET
assemblies showed an assembly version number 1 . 0 . 0 . 0 , which allowed client
applications to upgrade to the latest version of EMS without rebuilding.
This functionality is now available through the p o l i c y DLL files.
Version Files
.NET API policy.1.0.TIBCO.EMS.dll
TIBCO.EMS.dll.config
TIBCO.EMS.ADMIN.dll.config
TIBCO.EMS.UFO.dll.config
The .NET Compact Framework API is not available for automatic upgrades.
Enabling Updates To enable automatic updates for a library, add the appropriate policy file to the
global cache. Note that the related configuration file must be located in the
directory with the policy file in order to add the policy file to the global cache.
.NET
Feature .NET Compact
Framework
XA protocols for external transaction managers — —
C o n n e c t i o n C o n s u m e r, S e r v e r S e s s i o n , S e r v e r S e s s i o n P o o l — —
Compression Yes —
SSL Yes —
Character Encoding
.NET programs represent strings within messages as byte arrays. Before sending
an outbound message, EMS programs translate strings to their byte
representation using an encoding, which the program specifies. Conversely, when
EMS programs receive inbound messages, they reconstruct strings from byte
arrays using the same encoding.
When a program specifies an encoding, it applies to all strings in message bodies
(names and values), and properties (names and values). It does not apply to
header names nor values. The method B y t e s M e s s a g e . W r i t e U T F always uses
UTF-8 as its encoding.
Outbound Programs can determine the encoding of strings in outbound messages in three
Messages ways:
• Use the default global encoding, UTF-8.
• Set a non-default global encoding (for all outbound messages) using
Tibems.SetEncoding.
Inbound An inbound message from another EMS client explicitly announces its encoding.
Messages A receiving client decodes the message using the proper encoding.
For more information about character encoding, see Character Encoding in
Messages on page 35.
Threads .NET Compact Framework does not support background threads. To avoid
problems with threads, we recommend that programs release all EMS resources
before terminating. For example, close EMS connections when they are no longer
needed (see C o n n e c t i o n . C l o s e in the HTML reference).
Clock Resolution Clock resolution affects the granularity of all time-related calls and parameters—
for example M e s s a g e C o n s u m e r . R e c e i v e ( t i m e o u t ) , connect delays. On some
handheld devices, clock resolution is coarser than one might expect. Check the
resolution on your target device before selecting time values.
Connection Factories
A client must connect to a running instance of the EMS server to perform any JMS
operations. A connection factory is an object that encapsulates the data used to
define a client connection to an EMS server. The minimum factory parameters are
the type of connection (e.g., ’generic’ for JMS 1.1 connections and ’topic’ or
’queue’ for JMS 1.0.2b connections) and the URL (host name, transport protocol
and port id) for the client connection to the EMS server.
A connection factory is either dynamically created by the application or obtained
from a data store by means of a naming service, such as a Java Naming and
Directory Interface (JNDI) server or a Lightweight Directory Access Protocol
(LDAP) server.
For a fault-tolerant connection, you can specify two or more URLs. For example:
serverUrl = tcp://server0:7222,tcp://server1:7344
See Configuring Clients for Fault-Tolerant Connections on page 478 for more
information. For details on using SSL for creating secure connections to the server,
see Configuring SSL in EMS Clients on page 448 and Creating Connection
Factories for Secure Connections on page 336.
Java
To dynamically create a T i b j m s C o n n e c t i o n F a c t o r y object in a Java client:
ConnectionFactory factory = new
com.tibco.tibjms.TibjmsConnectionFactory(serverUrl);
C
To dynamically create a t i b e m s C o n n e c t i o n F a c t o r y type in a C client:
factory = tibemsConnectionFactory_Create();
status = tibemsConnectionFactory_SetServerURL(
factory, serverUrl);
C#
To dynamically create a C o n n e c t i o n F a c t o r y object in a C# client:
ConnectionFactory factory = new
TIBCO.EMS.ConnectionFactory(serverUrl);
Java
Use the T i b j m s C o n n e c t i o n F a c t o r y object’s s e t C o n n A t t e m p t C o u n t ( ) ,
setConnAttemptDelay(), and s e t C o n n A t t e m p t T i m e o u t ( ) methods to establish
new connection failure parameters:
factory.setConnAttemptCount(10);
factory.setConnAttemptDelay(1000);
factory.setConnAttemptTimeout(1000);
C
Use the t i b e m s C o n n e c t i o n F a c t o r y _ S e t C o n n e c t A t t e m p t C o u n t and
t i b e m s C o n n e c t i o n F a c t o r y _ S e t C o n n e c t A t t e m p t D e l a y functions to establish
new connection failure parameters:
status = tibemsConnectionFactory_SetConnectAttemptCount(
factory, 10);
status = tibemsConnectionFactory_SetConnectAttemptDelay(
factory, 1000);
status = tibemsConnectionFactory_SetConnectAttemptTimeout(
factory, 1000);
C#
Use the C o n n e c t i o n F a c t o r y . S e t C o n n A t t e m p t C o u n t ,
C o n n e c t i o n F a c t o r y . S e t C o n n A t t e m p t D e l a y, and
C o n n e c t i o n F a c t o r y . S e t C o n n A t t e m p t T i m e o u t methods to establish new
connection failure parameters:
factory.setConnAttemptCount(10);
factory.setConnAttemptDelay(1000);
factory.setConnAttemptTimeout(1000);
A connection with the EMS server is defined by the Connection object obtained
from a Connection Factory, as described in Connection Factories on page 312.
A connection is a fairly heavyweight object, so most clients will create a
connection once and keep it open until the client exits. Your application can create
multiple connections, if necessary.
The following examples show how to create a Connection object.
Java
Use the T i b j m s C o n n e c t i o n F a c t o r y object’s c r e a t e C o n n e c t i o n ( ) method to
create a C o n n e c t i o n object:
Connection connection =
factory.createConnection(userName,password);
C
Use the t i b e m s C o n n e c t i o n F a c t o r y _ C r e a t e C o n n e c t i o n function to create a
connection of type t i b e m s C o n n e c t i o n :
tibemsConnection connection = NULL;
status = tibemsConnectionFactory_CreateConnection(factory,
&connection, userName, password);
C#
Use the C o n n e c t i o n F a c t o r y . C r e a t e C o n n e c t i o n method to create a C o n n e c t i o n
object:
Connection connection =
factory.CreateConnection(userName, password);
Creating a Session
Java
Use the C o n n e c t i o n object’s c r e a t e S e s s i o n ( ) method to create a S e s s i o n
object.
For example, to create a non-transactional S e s s i o n that uses the
A U T O _ A C K N O W L E D G E delivery mode:
C
Use the t i b e m s C o n n e c t i o n _ C r e a t e S e s s i o n function to create a session of type
tibemsSession:
status = tibemsConnection_CreateSession(connection,
&session, TIBEMS_FALSE, TIBEMS_AUTO_ACKNOWLEDGE);
C#
Use the C o n n e c t i o n . C r e a t e S e s s i o n method to create a S e s s i o n object:
Session session = connection.CreateSession(false,
Session.AUTO_ACKNOWLEDGE);
All the APIs support the ability to set an exception listener on the connection that
gets invoked when a connection breaks or experiences a fault-tolerant switchover.
When the event is a disconnect, the exception handler can call various EMS
methods without any problem. However, when the event is a fault-tolerant
switchover, the exception handler is not allowed to call any EMS method. To do so
risks a deadlock. You can call the s e t E x c e p t i o n O n F T S w i t c h method to receive an
exception that contains the new server URL after a fault-tolerant switchover has
occurred.
The following examples demonstrate how to establish an exception listener for a
connection.
Java
Implement an E x c e p t i o n L i s t e n e r . o n E x c e p t i o n method, use the C o n n e c t i o n
object’s s e t E x c e p t i o n L i s t e n e r method to register the exception listener, and
call T i b j m s . s e t E x c e p t i o n O n F T S w i t c h to call the exception handler after a
fault-tolerant switchover:
public class tibjmsMsgConsumer
implements ExceptionListener
{
.....
public void onException(JMSException e)
{
/* Handle exception */
}
.....
connection.setExceptionListener(this);
com.tibco.tibjms.Tibjms.setExceptionOnFTSwitch(true);
.....
}
C
Define an o n E x c e p t i o n function to handle exceptions, use the
t i b e m s C o n n e c t i o n _ S e t E x c e p t i o n L i s t e n e r function to call o n E x c e p t i o n when
an error is encountered, and call t i b e m s _ s e t E x c e p t i o n O n F T S w i t c h to call the
exception handler after a fault-tolerant switchover:
void onException(
tibemsConnection conn,
tibems_status reason,
void* closure)
{
/* Handle exception */
}
.....
status = tibemsConnection_SetExceptionListener(
connection,
onException,
NULL);
tibems_setExceptionOnFTSwitch(TIBEMS_TRUE);
C#
Implement an I E x c e p t i o n L i s t e n e r . O n E x c e p t i o n method, set the C o n n e c t i o n
object’s E x c e p t i o n L i s t e n e r property to register the exception listener, and call
T i b e m s . S e t E x c e p t i o n O n F T S w i t c h to call the exception handler after a
fault-tolerant switchover:
public class csMsgConsumer : IExceptionListener
{
.....
public void OnException(EMSException e)
{
/* Handle exception */
}
.....
connection.ExceptionListener = this;
TIBCO.EMS.Tibems.SetExceptionOnFTSwitch(true);
.....
}
EMS provides a JNDI implementation that can be used to store topics and queues.
Java, C, and C# clients can use the EMS JNDI implementation to lookup topics
and queues.
You can also store topics and queues in any JNDI-compliant naming service or in
an LDAP server. Java clients can lookup topics and queues in any JNDI-compliant
naming service. C and C# clients use LDAP servers.
Looking up Administered Objects Stored in EMS on page 338 describes how to
lookup topics and queues from an EMS server. Chapter 1, Using JNDI With
Third-Party Naming/Directory Services in the TIBCO Enterprise Message Service
Application Integration Guide describes how to look up topics and queues from a
third-party JNDI or LDAP server.
Clients can also create destinations as needed. If a client requests the creation of a
destination that already exists, the existing destination is used. If the destination
does not exist, and the specification of the t o p i c s . c o n f , q u e u e s . c o n f , or
a c l . c o n f files allow the destination, the server dynamically creates the new
destination. The new destination inherits properties and permissions from its
ancestors as described in Wildcards and Dynamically Created Destinations on
page 76. The destination is managed by the server as long as clients that use the
destination are running.
Java
Use the S e s s i o n object’s c r e a t e T o p i c ( ) method to create a topic as a
D e s t i n a t i o n object:
C
Use the t i b e m s T o p i c _ C r e a t e function to create a topic of type
tibemsDestination:
C#
Use the S e s s i o n . C r e a t e T o p i c method to create a T o p i c object:
Destination topic = session.CreateTopic(topicName);
Java
Use the S e s s i o n object’s c r e a t e P r o d u c e r ( ) method to create a
MessageProducer object:
MessageProducer QueueSender = session.createProducer(queue);
C
Use the t i b e m s S e s s i o n _ C r e a t e P r o d u c e r function to create a message producer
of type t i b e m s M s g P r o d u c e r :
tibemsMsgProducer QueueSender = NULL;
status = tibemsSession_CreateProducer(session,
&QueueSender,queue);
C#
Use the S e s s i o n . C r e a t e P r o d u c e r method to create a M e s s a g e P r o d u c e r object:
MessageProducer QueueSender = session.CreateProducer(queue);
Java
Use the M e s s a g e P r o d u c e r object’s s e t D e l i v e r y M o d e ( ) method to configure
your Message Producer with a default delivery mode of R E L I A B L E _ D E L I V E R Y:
QueueSender.setDeliveryMode(
com.tibco.tibjms.Tibjms.RELIABLE_DELIVERY);
QueueSender.setDeliveryMode(
javax.jms.DeliveryMode.NON_PERSISTENT);
C
Use the t i b e m s M s g P r o d u c e r _ S e t D e l i v e r y M o d e function to configure your
Message Producer to set a default delivery mode for each message it produces to
R E L I A B L E _ D E L I V E R Y:
C#
Set the D e l i v e r y M o d e on the M e s s a g e P r o d u c e r object to R E L I A B L E _ D E L I V E R Y:
QueueSender.DeliveryMode = DeliveryMode.RELIABLE_DELIVERY;
Message consumers are clients that receive messages published to a topic or sent
to a queue. When working with topics, a Message Consumer is commonly
referred to as a Subscriber.
A Message Consumer can be created with a "message selector" that restricts the
consumption of message to those with specific properties. When creating a
Message Consumer for topics, you can set a n o L o c a l attribute that prohibits the
consumption of messages that are published over the same connection from
which they are consumed.
Carefully consider the message selectors that are used with queue consumers.
Because messages that do not match a queue consumer’s message selectors
remains in the queue until it is retrieved by another consumer, a non-matching
message can experience many failed selectors. This is especially so when queue
consumers connect, consume a message, and immediately disconnect.
As described in Durable Subscribers for Topics on page 5, messages published to
topics are only consumed by active subscribers to the topic; otherwise the
messages are not consumed and cannot be retrieved later. You can create a
durable subscriber that ensures messages published to a topic are received by the
subscriber, even if it is not currently running. For queues, messages remain on the
queue until they are either consumed by a Message Consumer, the message
expiration time has been reached, or the maximum size of the queue is reached.
The following examples create a Message Consumer that consumes messages
from the queue and a durable subscriber that consumes messages from a topic.
The queue and topic are those that were dynamically created in Dynamically
Creating Topics and Queues on page 320.
Java
Use the S e s s i o n object’s c r e a t e C o n s u m e r ( ) method to create a
M e s s a g e C o n s u m e r object:
C
Use the t i b e m s S e s s i o n _ C r e a t e C o n s u m e r function to create a message consumer
of type t i b e m s M s g C o n s u m e r :
tibemsMsgConsumer QueueReceiver = NULL;
status = tibemsSession_CreateConsumer(session,
&QueueReceiver, queue, NULL, TIBEMS_FALSE);
C#
Use the S e s s i o n . C r e a t e C o n s u m e r method to create a M e s s a g e C o n s u m e r object:
MessageConsumer QueueReceiver = session.createConsumer(queue);
The J2EE 1.3 platform introduced message-driven beans (MDBs) that are a special
kind of Message Listener. See the J2EE documentation for more information about
MDBs.
Java
Create an implementation of the M e s s a g e L i s t e n e r interface, create a
M e s s a g e C o n s u m e r, and use the M e s s a g e C o n s u m e r object’s
s e t M e s s a g e L i s t e n e r ( ) method to register the Message Listener with the
Message Consumer:
public class tibjmsAsyncMsgConsumer implements MessageListener
{
/* Create a connection, session and consumer */
...
MessageConsumer QueueReceiver =
session.createConsumer(queue);
QueueReceiver.setMessageListener(this);
connection.start();
}
{
/* Process message and handle exceptions */
C
Implement an o n M e s s a g e ( ) function to perform the desired actions when a
message arrives:
void onMessage(tibemsMsgConsumer QueueReceiver,
tibemsMsg message, void* closure)
{
/* Process message and handle exceptions */
}
status = tibemsSession_CreateConsumer(session,
&QueueReceiver, queue, NULL, TIBEMS_FALSE);
status = tibemsMsgConsumer_SetMsgListener(QueueReceiver,
onMessage, NULL);
status = tibemsConnection_Start(connection);
}
C#
Create an implementation of the I M e s s a g e L i s t e n e r interface, use
Session.CreateConsumer to create a M e s s a g e C o n s u m e r, and set the
M e s s a g e L i s t e n e r property on the M e s s a g e C o n s u m e r object to register the
Message Listener with the Message Consumer:
public class csAsyncMsgConsumer : IMessageListener
{
/* Create a connection, session and consumer */
...
MessageConsumer QueueReceiver =
session.CreateConsumer(queue);
QueueReceiver.MessageListener = this;
connection.Start();
}
Creating Messages
As described in JMS Message Bodies on page 21, EMS works with the following
types of messages:
• Messages with no body
• Text Messages
• Map Messages
• Bytes Messages
• Stream Messages
• Object Messages
There is a separate create method for each type of message.
The following examples show how to create a simple text message containing the
string "Hello."
Java
Use the S e s s i o n object’s c r e a t e T e x t M e s s a g e ( ) method to create a
TextMessage:
C
Use the t i b e m s T e x t M s g _ C r e a t e function to create a text message of type
tibemsTextMsg:
C#
Use the S e s s i o n . C r e a t e T e x t M e s s a g e method to create text message of type
TextMessage:
Java
Use the M e s s a g e object’s s e t B o o l e a n P r o p e r t y ( ) method to set the
J M S _ T I B C O _ P R E S E R V E _ U N D E L I V E R E D property to t r u e :
message.setBooleanProperty("JMS_TIBCO_PRESERVE_UNDELIVERED",
true);
userID = message.getStringProperty("JMS_TIBCO_SENDER");
C
Use the t i b e m s M s g _ S e t B o o l e a n P r o p e r t y function to set the
J M S _ T I B C O _ P R E S E R V E _ U N D E L I V E R E D property to t r u e :
status = tibemsMsg_SetBooleanProperty(message,
"JMS_TIBCO_PRESERVE_UNDELIVERED", true);
status = tibemsMsg_GetStringProperty(message,
"JMS_TIBCO_SENDER", &userID);
C#
Use the M e s s a g e .S e t B o o l e a n P r o p e r t y method to set the
J M S _ T I B C O _ P R E S E R V E _ U N D E L I V E R E D property to t r u e :
message.SetBooleanProperty("JMS_TIBCO_PRESERVE_UNDELIVERED",
true);
Sending Messages
You can use the Message Producer client, described in Creating a Message
Producer on page 322, to send messages to a destination. You can either send a
message to the destination specified by the Message Producer or, if the Message
Producer specifies NULL as the destination, you can send a message to a specific
destination. In either case, you can optionally set the J M S D e l i v e r y M o d e ,
J M S E x p i r a t i o n , and J M S P r i o r i t y message header fields described in JMS
Message Header Fields on page 17 when sending each message.
The following examples show two ways to send a text message in each language.
The first example sends the message to the Message Producer, Q u e u e S e n d e r,
created in Creating a Message Producer on page 322. The second example uses a
Message Producer, N U L L s e n d e r, that specifies a destination of NULL and sends
the message to the topic created in Dynamically Creating Topics and Queues on
page 320.
See Chapter 2, Messages for more information about creating messages.
Java
Use the M e s s a g e P r o d u c e r object’s s e n d ( ) method to send a message to the
destination specified by the M e s s a g e P r o d u c e r object:
QueueSender.send(message);
Use the following form of the send() method to send a message to a specific
destination:
MessageProducer NULLsender = session.createProducer(null);
....
NULLsender.send(topic, message);
C
Use the t i b e m s M s g P r o d u c e r _ S e n d function to send a message to the destination
specified by the t i b e m s M s g P r o d u c e r :
status = tibemsMsgProducer_Send(QueueSender, message);
Unlike the Java and C# APIs, in the C API, you can use the
t i b e m s M s g P r o d u c e r _ S e n d T o D e s t i n a t i o n function to specify the destination
regardless of whether a destination is in the t i b e m s M s g P r o d u c e r .
C#
Use the M e s s a g e P r o d u c e r . S e n d method to send a message to the destination
specified by the M e s s a g e P r o d u c e r :
QueueSender.Send(message);
NULLsender.Send(topic, message);
Receiving Messages
The Message Consumer created in Creating a Message Consumer on page 325
receives messages from a destination and acknowledges the receipt of messages
using the acknowledge mode established for the session, as described in Creating
a Session on page 317.
Before receiving messages, the Message Consumer must start the connection to
the EMS server. Before exiting, the Message Consumer must close the connection.
The following examples start the connection created in Connecting to the EMS
Server on page 315; synchronously receive messages from the queue created in
Dynamically Creating Topics and Queues on page 320, and then close the
connection.
You can also implement a Message Listener for your Message Consumer to
asynchronously receive messages, as described in Creating a Message Listener for
Asynchronous Message Consumption on page 326.
Java
Use the C o n n e c t i o n object’s s t a r t ( ) method to start the connection:
connection.start();
When the client has finished receiving messages, it uses the C l o s e ( ) method to
close the connection:
connection.close();
C
Use the t i b e m s C o n n e c t i o n _ S t a r t function to start the connection:
status = tibemsConnection_Start(connection);
status = tibemsMsgConsumer_Receive(QueueReceiver,&message);
status = tibemsConnection_Close(connection);
C#
Use the C o n n e c t i o n . S t a r t function to start the connection:
connection.Start();
The EMS server provides a implementation of JNDI that enables you to lookup
connection factories, topics and queues, which are collectively referred to as
administered objects. Java clients can look up administered objects stored in EMS
using standard JNDI calls. The C and C# APIs provide similar calls to look up
object data in the EMS server.
How to create topics and queues is described in Creating and Modifying
Destinations on page 72.
Topics
You can create administered objects for storage in EMS using either the
administration tool or the administration APIs, or directly in the configuration
files. This section describes how to create administered objects using the
administration tool.
To create a connection factory, use the c r e a t e f a c t o r y command in the EMS
Administration Tool. For example, to create a generic connection factory, named
myFactory, that establishes a TCP connection to port 7344 on server1, start the EMS
Administration Tool and enter:
create factory myFactory generic URL=tcp://server1:7344
The connection factory data stored on the EMS server is located in the
f a c t o r i e s . c o n f file. You can use the s h o w f a c t o r i e s command to list all of the
connection factories on your EMS server and the s h o w f a c t o r y command to
show the configuration details of a specific connection factory.
A connection factory may include optional properties for balancing server load
and establishing thresholds for attempted connections, as described in
Connection Factory Parameters on page 228. These properties can be specified
when creating the factory or modified for an existing factory using the a d d p r o p
f a c t o r y , s e t p r o p f a c t o r y , and r e m o v e p r o p f a c t o r y commands.
For example, to set the maximum number of connection attempts for the
connection factory, myFactory, from the default value of 2 to 5, start the EMS
Administration Tool and enter:
addprop factory myFactory connect_attempt_count=5
To create a factory to set up a generic connection and check the server's certificate
to confirm the name of the server is m y S e r v e r, enter (all one line):
create factory MySSLFactory generic url=ssl://7243
ssl_verify_host=enabled ssl_expected_hostname=myServer
ssl_trusted=certs/server_root.cert.pem
To create a factory to set up a topic connection, check the server's certificate (but
not the name inside the certificate), and to set the s s l _ a u t h _ o n l y parameter so
that SSL is only used by the client when creating the connection, enter (all one
line):
create factory AnotherSSLFactory topic url=ssl://7243
ssl_verify_host=enabled ssl_verify_hostname=disabled
ssl_trusted=certs/server_root.cert.pem ssl_auth_only=enabled
See Chapter 18, Using the SSL Protocol, on page 441 for details.
Should server0 become unavailable, the client will connect to server1. See
Chapter 19, Fault Tolerance, on page 461 for details.
This section describes how to lookup objects from an EMS server by name.
All clients can lookup objects in the EMS naming service. Alternatively, Java
applications can lookup objects in a third-party JNDI server, and C and C# clients
can lookup objects in a third-party LDAP server. See Chapter 1, Using JNDI With
Third-Party Naming/Directory Services in the TIBCO Enterprise Message Service
Application Integration Guide for details on how to look up connection factories
from a third-party JNDI or LDAP server.
To lookup administered objects stored in EMS, you need to create the initial
context that identifies the URL of the naming service provider and any other
properties, such as the username and password to authenticate the client to the
service. The naming service provider URL has form:
t i b j m s n a m i n g : / / host: port
Java
Create an I n i t i a l C o n t e x t object for the initial context, which consists of the
provider context factory and JNDI provider URL, as well as the username and
password to authenticate the client to the EMS server:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.tibco.tibjms.naming.TibjmsInitialContextFactory");
env.put(Context.PROVIDER_URL,"tibjmsnaming://localhost:7222");
env.put(Context.SECURITY_PRINCIPAL, "userName");
env.put(Context.SECURITY_CREDENTIALS, "password");
InitialContext jndiContext = new InitialContext(env);
ConnectionFactory factory =
(javax.jms.ConnectionFactory)
jndiContext.lookup("ConFac");
javax.jms.Topic sampleTopic =
(javax.jms.Topic)jndiContext.lookup("topic.sample");
javax.jms.Queue sampleQueue =
(javax.jms.Queue)jndiContext.lookup("queue.sample");
C
Create a t i b e m s L o o k u p C o n t e x t object for the initial context, which consists of the
JNDI provider URL and the username and password to authenticate the client to
the EMS server:
tibemsLookupContext* contextstatus = NULL;
status = tibemsLookupContext_Create(
&context,
"tibjmsnaming://localhost:7222",
"userName",
"password");
status = tibemsLookupContext_Lookup(context,
"ConFac",
(void**)&factory);
status = tibemsLookupContext_Lookup(context,
"sample.queue",
(void**)&sampleQueue);
status = tibemsLookupContext_Lookup(context,
"topic.sample,
(void**)&sampleTopic);
C#
Create a I L o o k u p C o n t e x t object for the initial context, which consists of the JNDI
provider URL and the username and password to authenticate the client to the
EMS server:
Hashtable env = new Hashtable();
env.Add(LookupContext.PROVIDER_URL,
"tibjmsnaming://localhost:7222");
env.Add(LookupContext.SECURITY_PRINCIPAL", "myUserName");
env.Add(LookupContext.SECURITY_CREDENTIALS", "myPassword");
Topic sampleTopic =
(Topic)searcher.Lookup("topic.sample");
TIBCO.EMS.Queue sampleQueue =
(TIBCO.EMS.Queue)searcher.Lookup("queue.sample");
When using full URL names, you can look up objects like the following example:
Topic sampleTopic = (javax.jms.Topic)jndiContext.lookup(
"tibjmsnaming://jmshost:7222/topic.sample");
Queue sampleQueue = (javax.jms.Queue)jndiContext.lookup(
"tibjmsnaming://jmshost:7222/queue.sample");
For further information on how to use full URL names, refer to the
t i b j m s J N D I R e a d . j a v a example located in the EMS_HOME/ s a m p l e s / j a v a / J N D I
directory.
Java
In this example, the port number specified for the C o n t e x t . P R O V I D E R _ U R L is set
to the SSL listen port that was specified in the server configuration file
t i b j s m d . c o n f . The value for T i b j m s C o n t e x t . S E C U R I T Y _ P R O T O C O L is set to s s l .
Finally, the value of T i b j m s C o n t e x t . S S L _ E N A B L E _ V E R I F Y _ H O S T is set to "false" to
turn off server authentication. Because of this, no trusted certificates need to be
provided and the client will then not verify the server it is using for the JNDI
lookup against the server’s certificate.
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.tibco.tibjms.naming.TibjmsInitialContextFactory");
env.put(Context.PROVIDER_URL, tibjmsnaming://jmshost:7223);
env.put(Context.URL_PKG_PREFIXES, "com.tibco.tibjms.naming")
env.put(TibjmsContext.SECURITY_PROTOCOL, "ssl");
env.put(TibjmsContext.SSL_ENABLE_VERIFY_HOST,
new Boolean("false"));
Context context = new InitialContext(env);
C
Create a t i b e m s S S L P a r a m s object and use the
t i b e m s S S L P a r a m s _ S e t I d e n t i t y F i l e function to establish the client identity by
means of a p k c s 1 2 file. Use the t i b e m s L o o k u p C o n t e x t _ C r e a t e S S L function to
create a t i b e m s L o o k u p C o n t e x t object that uses an SSL connection for the initial
context.
tibemsLookupContext* context = NULL;
tibemsConnection_Factory factory = NULL;
tibemsSSLParams sslParams = NULL;
tibems_status status = TIBEMS_OK;
sslParams = tibemsSSLParams_Create();
status = tibemsSSLParams_SetIdentityFile(
ssl_params,
"client_identity.p12",
TIBEMS_SSL_ENCODING_AUTO);
status = tibemsLookupContext_CreateSSL(
&context,
"tibjmsnaming://localhost:7222",
"userName",
"password",
sslParams,
"pk_password");
C#
Create a I L o o k u p C o n t e x t object for the initial context over an SSL connection.
The SSL Store Info consists of a pkcs12 file that identifies the client and the client’s
password, which are stored in an E M S S S L F i l e S t o r e I n f o object.
string ssl_identity = client_identity.p12;
string ssl_target_hostname = "server";
string ssl_password = "password";
Example
The following illustrates setting up the C o n t e x t . P R O V I D E R _ U R L property with
the URLs of a primary EMS server on the machine named e m s h o s t and a backup
EMS server on the machine named b a c k u p h o s t .
env.put(Context.PROVIDER_URL, "tibjmsnaming://jmshost:7222,
tibjmsnaming://backuphost:7222");
If at any time the first EMS server fails, the JNDI provider will automatically
switch to the EMS server on the host b a c k u p h o s t for JNDI lookups. If e m s h o s t is
repaired and restarted, it then becomes the backup EMS server.
Multicast is a messaging model that allows the EMS server to send messages to
multiple consumers simultaneously by broadcasting them over an existing
network. This chapter describes how to use and configure multicast in TIBCO
Enterprise Message Service.
Topics
Overview of Multicast
3 Multicast
Daemon
tibemsmcd
4
Legend
TCP Connection
Multicast Broadcast
Multicast Messages
Client A tibemsmcd
Client C
Clients A, B, C
Client B
All Clients
Client A Client B Client C 70% unused
A, B, C
30% 30% 30% 30%
10% unused
Although multicast can reduce the network resources used by the server, it is not
the best messaging model for every system. Multicast offers last-hop delivery
only; it cannot be used to send messages between servers. However, messages
sent to multicast-enabled topics are still delivered to other subscribed servers
using the standard TCP connection.
Multicast does not guarantee message delivery. Messages requiring a high degree
of reliability should not use multicast.
The multicast daemon and message consumer always reside on the same
machine, and PGM is used to deliver the broadcast message from EMS server to
the daemon. Because there is no security on PGM, multicast should not be used in
applications where security is a priority.
Requirements
In order to use multicast in your EMS messaging application, the following
requirements must be met:
• The EMS server must be configured for multicast:
— The server must be enabled for multicast.
— Multicast channels must be configured.
— The desired topics must be multicast-enabled by associating them with a
multicast channel. Multicast is not compatible with queues.
See Configuring Multicast on page 350 for more information about
configuring multicast.
• The multicast-enabled message consumer must be created using the
N O _ A C K N O W L E D G E mode. See Message Acknowledgement on page 38 for more
information.
• The multicast daemon must be running on the same computer as the
subscriber. See Starting the Multicast Daemon on page 355 for more
information.
Backwards Compatibility
Multicast is backwards compatible, and can be used in applications where not all
EMS clients are using the same version of TIBCO Enterprise Message Service. The
EMS sever and any clients that wish to receive messages over multicast must be
Software Release 5.0 or later.
Multicast is configured primarily in the EMS server, and is largely invisible to
EMS clients. Message producers do not need to be enabled for multicast in order
to send multicast messages, because topics are multicast-enabled in the server.
However, clients are multicast-enabled by default.
Clients that are not multicast-enabled, either because multicast has been disabled
or because the client uses a release of EMS earlier than 5.0, will receive messages
from the server over the TCP connection, even if the message topic is
multicast-enabled.
Configuring Multicast
This command also enables the topic for multicast, but does not cause existing
topic subscribers to receive messages over multicast. Only messages
consumers that are created after the c h a n n e l property is set will receive
multicast messages.
• r e m o v e p r o p t o p i c removes the c h a n n e l property from the topic. Current
multicast subscribers will begin to receive messages sent to the topic over
TCP.
If a backlog of messages exists in the server or multicast daemon, the EMS
client may receive some messages out of order, and some message loss is
possible. The multicast daemon will continue to deliver queued messages
until the backlog is gone, while the EMS server will deliver later messages
immediately.
A current topic subscriber will stop receiving messages if the multicast channel is
changed from one channel to a different channel. This can happen when:
• The channel is changed explicitly using a d d p r o p topic or s e t p r o p topic.
Option Description
-ifc interface Select the IP address that identifies the network interface
used by the multicast daemon to receive multicast data.
If this option is not included, the multicast daemon uses
the default interface, determined by the IP address
I N A D D R _ A N Y.
-logfile-max-size size[ K B | M B | G B ] Specify the maximum size that the trace message log file
may reach before rotation. By default, log files have no
size limit and so do not rotate.
Zero is a special value, which specifies no maximum size.
Otherwise, the value you specify must be greater than or
equal to 6 4 K B .
Option Description
- l i s t e n [ ip-address: ] tcp-port Change the IP address and TCP port on which the
daemon listens for connections from EMS clients, where:
• ip-address is an optional parameter that, when
provided, restricts the interface on which the multicast
daemon will accept client connections to a specific IP
address. If an ip-address is not provided, the multicast
daemon listens for EMS clients on all interfaces.
• tcp-port is the TCP port on which the daemon listens
for connections from EMS clients. The default port is
7444.
For example:
-listen 127.0.0.1:7444.
Note that if the default TCP port that the daemon listens
on is changed, then the client must be directed to attempt
a connection to the daemon on the same TCP port. To
change the port that the client uses, set the
m u l t i c a s t _ d a e m o n _ d e f a u l t parameter in the
t i b e m s d . c o n f file.
-max-msg-memory size[ M B | K B ] Specify the maximum amount of memory allowed for all
messages waiting to be sent to consumers. Once the
specified memory limit is reached, new messages are
discarded. Specify the size in units of M B or G B . The
minimum permitted size is 8 M B .
Running Multicast
Windows On a computer running Windows, you can also start the administration tool from
the Start menu, following the path Programs > TIBCO > TIBCO EMS 6.0 > Start
EMS Multicast Daemon.
UNIX On a computer running a UNIX system, the multicast daemon must have root
privileges. This can be done either by running the daemon from a root user
account, or the daemon can be setuid (set user ID) root, allowing any user to run
t i b e m s m c d with the required root privileges. Root privileges are required because
multicast uses raw sockets.
Once multicast initialization is complete, the EMS server and multicast daemon
release root privileges.
For more information, see Multicast and Root Access on page 11 of the TIBCO
Enterprise Message Service Installation.
Monitoring
The server publishes messages to two monitoring topics specifically related to
multicast. These topics are $ s y s . m o n i t o r . m u l t i c a s t . s t a t u s and
$sys.monitor.multicast.stats.
Statistics
The server’s multicast channel statistics can be viewed using the administration
API or the administration command line tool. Multicast channel statistics include:
• The average number of messages sent per second.
• The average number of bytes sent per second.
• The total number of messages sent.
• The total number of bytes sent.
• Detailed statistics for each topic using the channel.
See Working with Server Statistics on page 436 for more information on statistics.
Topics
Deployment Considerations
Connectivity
Like unicast applications, multicast applications require that the network layer
provide a path for multicast data to flow from senders to receivers. However,
routers and switches may require additional configuration for multicast use and
tuning. The first step in ensuring and limiting connectivity is defining channels,
and assigning multicast group addresses these channels.
Multicast Addresses
Each multicast channel, defined in the c h a n n e l s . c o n f configuration file, is
assigned a multicast address. TIBCO Enterprise Message Service allows you to
assign any valid multicast address, in the class D address range, 224.0.0.0 through
239.255.255.255. However, in order to avoid a conflict, please refer to the Internet
Assigned Numbers Authority (IANA) list of reserved addresses to avoid a
conflict:
http://www.iana.org/assignments/multicast-addresses
When assigning addresses to your channels, keep these additional considerations
in mind:
• Multicast addresses 224.0.1.78 and 224.0.1.79 are reserved by TIBCO EMS for
internal use. These addresses should not be used, as TIBCO multicast traffic
may be encountered there.
• Ideally, you should select multicast addresses from 239.0.0.0 to
239.255.255.255. These have been set aside as an administratively scoped
block, and IANA will never reserve these. They can be freely used within your
enterprise without worry of any external conflict.
• There is not a one-to-one mapping of MAC addresses to IP addresses; because
of this you should not pick x.0.0.x addresses, as they may map to reserved
addresses and so may not work. The class D IP address range assigned to
multicasting is 28 bits wide, but the range of MAC addresses assigned to
multicast is only 23 bits wide. Since only the 23 lower order bits of the IP
address are assigned to make the MAC address, an overlap results. For
example, if one chooses a multicast address 239.0.0.1, it may incorrectly
overlap to the reserved 224.0.0.1.
Defining Channels
TIBCO Enterprise Message Service does not restrict the number of channels that
you can configure and use in the EMS server or the multicast daemon. However,
the number of IP multicast group addresses that can be joined by any one host at
one time may be constrained by outside factors. Often, the number is limited by
the NIC, and typically this limitation is not specified in the NIC documentation.
Experimentation is often the only way to determine what the limit is for a specific
NIC and OS. With some NICs, joining too many groups will set the card to
"promiscuous mode" which will adversely affect performance.
It is also important to note that, because a channel represents both an IP multicast
group address and a destination port, there is not necessarily a one-to-one
correlation between a channel and multicast group.
A group is joined when a multicast daemon listens to an IP multicast group
address. Because a channel represents both an IP multicast group address and a
destination port, there is not necessarily a one-to-one correlation between a
channel and multicast group. For example, if you have 10 multicast channels all
using the same multicast group address but different ports, then a multicast
daemon will join at most one group. However, if the 10 multicast channels are all
using different multicast group addresses, then a multicast daemon may join up
to 10 groups.
The multicast IP address and port combinations that you choose should only be
used with TIBCO EMS. While the TIBCO Multicast Daemon can filter out corrupt
network data, receiving data packets that are not specific to EMS can yield
unpredictable results, which could destabilize your network.
Managing Bandwidth
This section discusses bandwidth considerations that are specific to multicast
deployments. There are three main aspects to bandwidth:
• Determining Available Bandwidth, page 361 — determine your available
bandwidth, and setting bandwidth limitations to maximize performance.
• Dividing Bandwidth Among Channels, page 362 — create channels to make
the best use of available bandwidth.
• Handling Slow Applications, page 363 — managing small numbers of slow
applications so that they do not slow the entire multicast network.
Restrict multicast traffic to a rate a little below the maximum capacity of your
network. If your throughput rate is slower than expected, restrict the rate further.
You may find that throughput actually increases.
To set the rate for multicast traffic on a channel, see the m a x r a t e parameter, in
c h a n n e l s . c o n f on page 224.
You can think of the bandwidth rate specified for a channel as a delivery promise
that the network layer makes to EMS. If the network layer breaks that promise,
EMS multicast throughput falls to a rate substantially below what the network
can actually deliver.
Following these recommendations will help minimize data loss due to bandwidth
inconsistencies:
• Multicast publishers and subscribers should have network interfaces of the
same speed.
• The ideal multicast deployment is over a LAN or VLAN.
For example, if you have a number of clients with 100Mb NIC cards and others
with 1Gb NIC cards, the recommended architecture is to send from a 100Mb NIC
to the slower receivers and a 1Gb NIC to the faster receivers. You can accomplish
this by configuring two multicast channels, one for the faster-speed senders and
receivers, and one for the slower senders and receivers.
Alternatively, you can configure one channel and limit the bandwidth to the
slowest receiver, or 100Mb. However, the best solution is to use a multi-homed
machine, separate the applications by defining different channels for two
interfaces, then allowing each channel to operate at its optimum speed.
For example, these two channel configurations are optimized for 100Mb NIC card
and a 1Gb NIC card:
--- channels.conf ----
[channel_100mb]
address = 239.1.1.1:10
maxrate = 7MB
interface=10.99.99.99
[channel_1Gb]
Address = 239.1.1.2:10
maxrate = 95MB
interface=10.99.99.100
This section describes the steps needed to set up a simple example TIBCO
Enterprise Message Service multicast deployment:
• Step 1: Design the Multicast Network Architecture, page 364
• Step 2: Install and Set Up EMS, page 366
• Step 3: Determine Network and Application Capabilities, page 369
This example assumes that multicast connectivity exists and available bandwidth
on the network is known. While not every aspect of a multicast deployment is
covered in this example, it does illustrate the general thought process applied to
multicast deployment.
Note that two separate channels using different interfaces are to be configured at
the server, allowing the server to simultaneously multicast on a high speed
Gigabit network and a slower 100Mb network.
3. Set the address and destination port for each channel, using the a d d r e s s
parameter.
4. Set the interface for each channel, using the i n t e r f a c e parameter.
For this example, the server is on a multi-homed machine so we must
explicitly specify interfaces for each channel. If an interface is not specified,
the EMS server uses the default interface. Note that this is also true for the
multicast daemon. Use the - i f c command line parameter when running
multicast daemons on multi-homed machines, described in Command Line
Options on page 352.
5. Set a m a x r a t e for each channel.
The m a x r a t e parameter restricts the rate at which the server sends messages
over the channel. See Estimating the Maxrate below for a discussion of how
the maxrate was determined.
Sample When you have completed your channel configuration, the c h a n n e l s . c o n f file
channels.conf should contain the following lines:
Settings [mcast-1Gb]
address=239.1.1.1:10
interface=10.99.99.99
maxrate=112MB
[mcast-100Mb]
address=239.1.1.2:10
interface=10.99.99.100
maxrate=8MB
Estimating the In this example, we have set the m a x r a t e properties using arbitrary network
Maxrate usage numbers to arrive at an estimate of network capacity. The process used to
estimate the m a x r a t e can be described as follows:
First find your average network usage, not including expected multicast data.
This assumes metric data rate measurement.
• For the 1Gb network, let us assume about 10% usage, so 900Mb is available.
• On the 100Mb network, let us assume 30% usage, so 70Mb is available.
From here, calculate the available bytes per second for your network:
• 900 Mb * 1byte/8bits ~= 112 MB (rounded down)
• 70Mb * 1byte/8bits ~= 8MB (rounded down)
These initial rates are for testing purposes, and these will be modified later to
maximize performance. Remember the cardinal rule with multicast performance
is that sometimes you have to slow down to speed up. A rate that is too high will
induce loss, which in turn causes messages to be resent, slowing the actual rate to
something far below what your network is capable of.
This example uses only one channel per network. If your architecture has
multiple multicast groups (channels with different address properties), remember
to include all channels on the network in your maximum bandwidth calculations.
This may require some balancing of data rates across channels.
2. Next, set the multicast exception listener. Ideally, this will be done before you
create a consumer of a multicast enabled topic.
com.tibco.tibjms.Tibjms.setMulticastExceptionListener(new
MulticastExceptionHandler());
To set up a multicast exception listener using the C API, see the TIBCO Enterprise
Message Service C & COBOL API Reference.
To set up a multicast exception listener using the .NET API, see the TIBCO
Enterprise Message Service .NET API Reference, available through the HTML
documentation interface.
Using the - t r a c e option is not required, but may assist in detecting any
problems. See Starting the Multicast Daemon on page 355 for more
information.
3. On each node receiving multicast data, open a command line window and
navigate to the TIBCO_HOME/ e m s / 6 . 0 / s a m p l e s / j a v a folder:
4. Launch the t i b j m s P e r f S l a v e sample program included with EMS:
> java tibjmsPerfSlave -server serverURL
or
> java tibjmsPerfMaster -topic feed-100Mb -channel mcast-100Mb
-ackmode NO -time 30 -size 100
If flow control is and FLOW tracing are enabled, you should see the following
as well:
2008-11-13 17:11:57.781 Flow control engaged on topic
'feed-100Mb'
....
When flow control is enabled, this simply means that the server is pushing
back on the publisher to slow down to the rate defined by the multicast
channel.
When the trace messages indicate that multicast channels have exceeded their
bandwidth, this indicates that the channel maxrate is too low—your publisher is
publishing faster than the channel’s m a x r a t e allows. On the other hand, when the
m a x r a t e is too high, you will see errors indicating that loss is detected.
Depending on what the trace messages show, try adjusting the maximum rate of
the channel (the m a x r a t e property) up or down, and repeat this test.
The channel’s maximum delivery rate, or m a x r a t e , should not exceed the rate at
which the slowest message consumer can consume incoming messages.
Determining the maximum message rate that your slowest application can handle
reduces the time spent during trial and error testing. If your applications can
process data faster than the network can deliver it, you will have already
determined the maximum rate from determining your network capabilities.
Largely, determining the maximum speed at which the slowest application can
process incoming data is a trial and error process. It is often useful to
programmatically determine an application's maximum rate of consumption. The
multicast daemon buffers messages for slower applications, but this increases the
latency of data and memory usage of the multicast daemon, and is not considered
a sustainable condition.
If a multicast-enabled consumer is expected to fall behind at times and can sustain
loss, you can account for this using the m a x b y t e s and m a x m s g s properties for
topics. See Destination Properties on page 55 for details about these properties.
However, operating system tuning for multicast falls outside of the scope of this
document. The TIBCO Professional Services Group can provide assistance with
advanced tuning specific for TIBCO Enterprise Message Service, and there are
many resources on the internet for general tuning of operating systems
concerning network performance.
Multicast deployment issues are often more difficult to resolve than similar
unicast issues. Reasons for the additional difficulty include:
• Older networking equipment that was not designed with multicast
deployment in mind. For example, switches that can only flood multicast or
routers that do not have modern multicast routing protocols.
• Different equipment may solve the same problem in different ways. For
example, some switches use IGMP snooping while others use CGMP.
• Multicast diagnostic tools are not readily available.
• Network administrators may not be as experienced in multicast deployment
issues as they are with unicast deployment.
• Bandwidth is automatically shared equitably among competing unicast
streams, but administrator intervention may be required to achieve desired
multicast bandwidth sharing.
Troubleshooting Tips
This section give some troubleshooting tips to help you respond to difficulties
you may experience with your multicast deployment.
General Tips
If you are experiencing problems with your deployment, begin with these
practices:
• The "bottom-up" approach generally seems best. That is, get the lowest layers
of the network stack working first.
• Begin with the EMS server and trace your way through each switch and
router to all receivers. Try moving your receiving application to the same hub
as the server (not a switch or a router), and confirm that you have multicast
connectivity. Once that works, move on to more complicated multicast
networks.
Connectivity
EMS will detect multicast connectivity issues; it may take up to 64 seconds to
detect a connectivity problem. These suggestions can help resolve issues with
connectivity:
• Verify that the network has good unicast connectivity between the sender and
all receivers before tackling multicast connectivity problems.
• Verify that IP Multicast is supported and enabled on your routers or switches
and all networks interfaces that are being used.
• Verify that address scoping at the router is not preventing multicast packets
from being forwarded.
• Test your multicast application without enabling multicast in the EMS server
to determine if a more general topic or application configuration issue is
preventing message reception. For example, a consumer that is consuming on
the wrong topic.
• Enable multicast and topic tracing in the server to ensure proper
configuration, and to verify that messages are being multicast by the server.
• Enable multicast daemon trace messages to check for any configuration
issues, warnings, or errors.
• Ensure that you are using the proper interface(s) in the server and the
multicast daemon. On a multi-homed host, it is possible that the default
interface cannot receive multicast data from the server.
• Ensure that the channel's t t l is large enough for data to cross all of your
switches and routers.
Data Loss
These suggestions can help if you are experiencing data loss:
• Enable and check statistics to see if data is being delivered and whether
excessive loss is encountered. If loss is detected, decreasing the multicast
channel's m a x r a t e property may alleviate the situation.
• Make sure that multicast streams are being generated with a time to live that
is long enough for messages to reach their destination using the
longest-possible path through the network.
• If you see increased loss as multicast rates go up, look for routers or switches
that might be configured to limit the broadcast rate. These generally limit the
multicast rate too. For example, Cisco Catalyst 5000 series switches can be
configured to limit the packet per second or percentage of
broadcast/multicast traffic with the set port broadcast command.
You will also notice in the multicast statistics that the particular channel's
r c v _ l o s s e s are growing.
Server Errors
In General, server errors are self-descriptive. It is important to note that client
errors may be returned to the server to be logged, providing a centralized place to
look for multicast errors. However, these errors do not include minor loss on a
particular client, or loss of messages from a client failover.
Topics
Overview
TIBCO Enterprise Message Service (release 4 and later) can exchange messages
with TIBCO Rendezvous (release 6.9 and later).
Scope • EMS can import and export messages to an external system through an EMS
topic.
• EMS can import messages from an external system to an EMS queue (but
queues cannot export).
EMS Server
Export
TIBCO Rendezvous
Translation tibrv
EMS Topic
Transport
Import
EMS Destination Translation tibrv
(Topic or Queue) Transport
Message Translation
EMS and Rendezvous use different formats for messages and their data. When
t i b e m s d imports or exports a messages, it translates the message and its data to
the appropriate format; for details, see Message Translation on page 414.
Configuration
tibemsd uses definitions and parameters in four configuration files to guide the
exchange of messages with Rendezvous.
RVCM Listeners When exporting messages on a transport configured for certified message
delivery, you can pre-register RVCM listeners in the file t i b r v c m . c o n f .
For details, see t i b r v c m . c o n f on page 241, and Certified Messages on page 392
Transports mediate the flow of messages between EMS and TIBCO Rendezvous.
timemsd connects to Rendezvous daemons in the same way as any other
Rendezvous client would. Transport definitions (in the file t r a n s p o r t s . c o n f )
configure the behavior of these connections. You must properly configure these
transports.
How Rendezvous The EMS server connects to the Rendezvous daemon as any other Rendezvous
Messages are client would. Messages received from the Rendezvous daemon are stored in
Imported Rendezvous queues, then are dispatched to callbacks. The EMS server creates JMS
message copies of the Rendezvous messages, and begins processing them as EMS
messages. Transports determine how messages are imported.
Rendezvous messages that are imported through a transport are held in queues
specific to that transport. Each transports is associated with a different
Rendezvous queue, which holds as many Rendezvous messages as necessary. The
number of pending messages in the queue will grow if the rate of incoming
Rendezvous messages is greater than the rate at which the EMS server is able to
process the corresponding EMS messages.
Depending on the import delivery mode defined for the transport, the EMS
messages will be persisted on disk, which increases the likelihood of backlog in
the Rendezvous queues, and which in turn results in a EMS process memory
growth. This memory growth is not accounted for in any of the EMS server
statistics.
Queue Limit In order to limit the number of pending messages in Rendezvous queues, a
Policies transport property allows you to set a queue limit policy, as you would for TIBCO
Rendezvous client applications. When the queue limit for the transport is
reached, the Rendezvous library discards a set number of messages. The default
policy is T I B R V Q U E U E _ D I S C A R D _ N O N E , which means that no message is ever
discarded. Setting T I B R V Q U E U E _ D I S C A R D _ F I R S T or T I B R V Q U E U E _ D I S C A R D _ L A S T
allows you to specify the maximum number of Rendezvous messages that can be
pending in the queue before the discard policy that you have selected is applied.
When the limit is reached, the number of messages discarded is based on the
discard amount value.
When the limit is reached, Rendezvous messages are discarded, and so are not
imported as EMS messages, regardless of the EMS import delivery mode. As
stated above, a Rendezvous message becomes a EMS message only after it has
been dispatched from the Rendezvous queue. If a queue limit is exceeded, reliable
Rendezvous messages are lost.
Rendezvous certified messages are not lost, but the message flow is interrupted.
The redelivery of the missed messages is handled automatically by the
Rendezvous libraries, and can not be controlled by the EMS server.
Reaching a queue limit also generates a Rendezvous advisory that is logged (see
RVADV log and console trace in the TIBCO Rendezvous documentation),
indicating which transport reached its queue limit. This advisory goes into an
independent, non limited, Rendezvous queue. If lots of advisories are generated,
this internal queue may also grow, signalling that the limit policy is not
appropriate for your environment.
Take care when setting a queue limit policy. In a controlled environment where
the risk of Rendezvous producers overwhelming the EMS server is low, there is
no need to set a queue limit policy.
Transport Definitions
transports.conf contains zero or more transport definitions. Each definition
begins with the name of a transport, surrounded by square brackets. Subsequent
lines set the parameters of the transport.
Parameter Description
type Required. For Rendezvous transports, the value must be either
t i b r v or t i b r v c m .
Rendezvous Parameters
Use these properties for either t i b r v or t i b r v c m transports.
The syntax and semantics of these parameters are identical to the corresponding parameters in
Rendezvous clients. For full details, see the Rendezvous documentation set.
network When absent, the default value is the host computer’s primary
network.
Parameter Description
daemon When absent, the default value is an r v d process on the local
host computer. When transporting messages between EMS and
Rendezvous, the r v d process must be configured to run on the
same host as the EMS daemon (t i b e m s d ).
To connect to a non-default daemon, supply
hostname: protocol: port. You may omit any of the three parts. The
default hostname is the local host computer. The default
protocol is t c p . The default port is 7 5 0 0 .
default_ttl This parameter sets default CM time limit (in seconds) for all
CM messages exported on this transport.
Parameter Description
EMS Parameters
Use these properties for either t i b r v or t i b r v c m transports.
Parameter Description
rv_queue_policy Set the queue limit policy for the Rendezvous queue used by
the transport to hold incoming Rendezvous messages. This
parameter has three parts:
policy:max_msgs:qty_discard
Example
These examples from t r a n s p o r t s . c o n f illustrate the syntax of transport
definitions.
[RV01]
type = tibrv
topic_import_dm = TIBEMS_RELIABLE
queue_import_dm = TIBEMS_PERSISTENT
service = 7780
network = lan0
daemon = tcp:host5:7885
[RV02]
type = tibrv
service = 7890
network = lan0
daemon = tcp:host5:7995
temp_destination_timeout = 60
[RVCM01]
type = tibrvcm
export_headers = true
export_properties = true
rv_tport = RV02
cm_name = RVCMTrans1
ledger_file = ledgerFile.store
sync_ledger = true
request_old = true
default_ttl = 600
[RVCM03]
type = tibrvcm
rv_tport = RV03
cm_name = RVCMTrans2
ledger_file = ledgerFile2.store
sync_ledger = true
request_old = true
default_ttl = 600
Topics
Topics can both export and import messages. Accordingly, you can configure
topic definitions (in the configuration file t o p i c s . c o n f ) with i m p o r t and e x p o r t
properties that specify one or more external transports:
export • export instructs t i b e m s d to take messages that arrive on the EMS destination,
and export them to Rendezvous via those transports.
The EMS server never re-exports an imported message on the same topic.
Wildcards
Wildcards in the i m p o r t and e x p o r t properties obey EMS syntax and semantics
(which is identical to Rendezvous syntax and semantics); see Destination Name—
Syntax and Semantics on page 408.
Certified Messages
You can i m p o r t and e x p o r t TIBCO Rendezvous certified messages (t i b r v c m
transport) to EMS topics. Rendezvous certified transports guarantee message
delivery.
RVCM Ledger t i b r v c m transports can store information about subjects in a ledger file. You can
review the ledger file using an administration tool command; see s h o w
r v c m t r a n s p o r t l e d g e r on page 159).
For more information about ledger files, see TIBCO Rendezvous documentation.
Subject Collisions Subscribers to destinations that import from RVCM transports are subject to the
same restrictions that direct RVCM listeners. These restrictions are described in
the TIBCO Rendezvous documentation, and include subject collisions.
When importing messages from RV, the EMS server creates RVCM listeners using
a single name for each transport. This can result in subject collisions if the
corresponding EMS subscribers have overlapping topics.
Queues
Configuration
You can configure queue definitions (in the configuration file q u e u e s . c o n f ) with
the i m p o r t property that specify one or more external transports.
• i m p o r t instructs t i b e m s d to import messages that arrive on those transports
from Rendezvous, and deliver them to the EMS destination.
(For general information about q u e u e s . c o n f syntax and semantics, see
q u e u e s . c o n f on page 234. You can also configure queues using the
administration tool command a d d p r o p q u e u e .)
Wildcards
Wildcards in the i m p o r t property obey EMS syntax and semantics (not
Rendezvous syntax and semantics); see Destination Name—Syntax and
Semantics on page 408.
EMS clients cannot subscribe to wildcard queues—however, you can define
wildcards queues in the EMS server for the purpose of property inheritance. That
is, you can configure a static queue named f o o . * and set properties on it, so that
child queues named f o o . b a r and f o o . b a z will both inherit those properties.
Import Issues
This section presents issues associated with importing messages to EMS from
Rendezvous—whether on a topic or a queue.
Field Identifiers
When importing and translating Rendezvous messages, t i b e m s d is only able to
process standard message field types that are identified by name in the
Rendezvous program application. Custom fields and fields identified using a
field identifier cannot be imported to EMS.
JMSDestination
When t i b e m s d imports and translates a Rendezvous message, it sets the
J M S D e s t i n a t i o n field of the EMS message to the value of the Rendezvous
subject. Therefore, imported destination names must be unique. When a topic and
a queue share the same name, at most one of them may set the i m p o r t property.
For example, if a topic f o o . b a r and a queue f o o . b a r are both defined, only one
may specify the i m p o r t property.
JMSReplyTo
When t i b e m s d imports and translates a Rendezvous message, it sets the
J M S R e p l y T o field of the EMS message to the value of the Rendezvous reply
subject, so that EMS clients can reply to the message.
Usually this value represents a Rendezvous subject. You must explicitly configure
t i b e m s d to create a topic with a corresponding name, which exports messages to
Rendezvous.
JMSExpiration
When t i b e m s d imports and translates a Rendezvous certified message, it sets the
J M S E x p i r a t i o n field of the EMS message to the time limit of the certified
message.
If the message time limited is exceeded, the sender program no longer certifies
delivery.
Note that if the e x p i r a t i o n property is set for a destination, it will override the
J M S E x p i r a t i o n value set by the message producer.
JMSTimestamp
When t i b e m s d imports and translates a Rendezvous message, it uses the
J M S T i m e s t a m p header field to determine when the message was created. If the
J M S T i m e s t a m p field is not set, the t i b e m s d ignores the expiration field, because
expiration is based on an unknown creation time.
The Rendezvous sender must create a field called J M S T i m e s t a m p in order to
enable message expiration.
Guaranteed Delivery
For full end-to-end certified delivery from Rendezvous to EMS, all three of these
conditions must be true:
• Rendezvous senders must send labeled messages on RVCM transports. See
the TIBCO Rendezvous Concepts manual for more information.
• The transport definition must set t o p i c _ i m p o r t _ d m or q u e u e _ i m p o r t _ d m (as
appropriate) to T I B E M S _ P E R S I S T E N T.
• Either a durable queue or a subscriber for the EMS topic must exist.
Export Issues
This section presents issues associated with exporting messages from EMS to
Rendezvous.
JMSReplyTo
Topics Consider an EMS message in which the field J M S R e p l y T o contains a topic. When
exporting such a message to Rendezvous, you must explicitly configure t i b e m s d
to import replies from Rendezvous to that reply topic.
Temporary Topics Consider an EMS message in which the field J M S R e p l y T o contains a temporary
topic. When t i b e m s d exports such a message to Rendezvous, it automatically
arranges to import replies to that temporary topic from Rendezvous; you do not
need to configure it explicitly.
Certified Messages
RVCM When an RVCM listener receives its first labeled message, it registers to receive
Registration subsequent messages as certified messages. Until the registration is complete, it
receives labeled messages as reliable messages. When exporting messages on a
t i b r v c m transport, we recommend either of two actions to ensure certified
delivery for all exported messages:
• Create the RVCM listener before sending any messages from EMS clients.
• Pre-register an RVCM listener, either with the administration tool (see c r e a t e
rvcmlistener on page 125), or in the configuration file t i b r v c m . c o n f (see
t i b r v c m . c o n f on page 241).
Guaranteed Delivery
For full end-to-end certified delivery to Rendezvous from EMS, the following
condition must be true:
• EMS senders must send persistent messages.
Message Translation
Table 54 presents the mapping of JMS header fields to Rendezvous data types
(that is, the type of the corresponding field in the exported message).
JMSPriority TIBRVMSG_U8
JMSTimestamp TIBRVMSG_U64
JMSExpiration TIBRVMSG_U64
JMSType TIBRVMSG_STRING
JMSMessageID TIBRVMSG_STRING
JMSRedelivered TIBRVMSG_BOOL
Import RVCM In addition to the two fields described above, when t i b e m s d imports a certified
message on a t i b r v c m transport, it can also set these properties (if the
corresponding information is set in the Rendezvous message):
Property Description
JMS_TIBCO_CM_PUBLISHER A string value indicating the correspondent
name of the TIBCO Rendezvous CM transport
that sent the message (that is, the sender
name).
Message Body
tibemsd can export messages with any JMS message body type to TIBCO
Rendezvous. Conversely, t i b e m s d can import messages with any message type
from TIBCO Rendezvous.
For information about JMS body types, see JMS Message Bodies on page 21.
For information about the structure of messages, see JMS Message Structure on
page 17.
JMSObject JMSObjectMessage
JMSStream JMSStreamMessage
JMSText JMSTextMessage
The field names D A T A and _ d a t a _ are reserved. We strongly discourage you from
using these field names in either EMS and Rendezvous applications, and
especially when these two message transport mechanisms interoperate.
Only standard Rendezvous fields identified by name can be imported into EMS.
Custom fields and fields identified in the Rendezvous application by field
identifiers cannot be imported.
Data Types
Table 58 presents the mapping between EMS datatypes and Rendezvous
datatypes. The mapping is bidirectional, except for the Rendezvous types that
have no corresponding EMS type (for these types the mapping is marked as
unidirectional in the middle column of Table 58).
Byte TIBRVMSG_I8
Short TIBRVMSG_I16
Integer TIBRVMSG_I32
Long TIBRVMSG_I64
Float TIBRVMSG_F32
Double TIBRVMSG_F64
MapMessage TIBRVMSG_MSG
byte[] TIBRVMSG_OPAQUE
java.lang.String TIBRVMSG_STRING
short[] TIBRVMSG_I16ARRAY
int[] TIBRVMSG_I32ARRAY
long[] TIBRVMSG_I64ARRAY
float[] TIBRVMSG_F32ARRAY
double[] TIBRVMSG_F64ARRAY
Topics
Overview
Scope • EMS can import and export messages to an external system through an EMS
topic.
• EMS can import messages from an external system to an EMS queue (but
queues cannot export).
EMS Server
Export
TIBCO SmartSockets
Translation tibss
EMS Topic
Transport
Import
EMS Destination Translation tibss
(Topic or Queue) Transport
Message Translation
EMS and SmartSockets use different formats for messages and their data. When
t i b e m s d imports or exports a messages, it translates the message and its data to
the appropriate format; for details, see Message Translation on page 414.
Configuration
tibemsd uses definitions and parameters in three configuration files to guide the
exchange of messages with SmartSockets.
Transport Definitions
transports.conf contains zero or more transport definitions. Each definition
begins with the name of a transport, surrounded by square brackets. Subsequent
lines set the parameters of the transport.
Parameter Description
type Required. For SmartSockets transports, the value must be t i b s s .
SmartSockets Parameters
The syntax and semantics of these parameters are identical to the corresponding parameters in
SmartSockets clients. For full details, see the SmartSockets documentation set.
delivery_mode This parameter determines the quality of service with which delivers
messages to the SmartSockets server over this transport:
best_effort | gmd_all | gmd_some | ordered
Parameter Description
lb_mode SmartSockets servers balance the message load by distributing messages
among several clients. This parameter determines the load balancing
regimen for messages that this transport exports to the SmartSockets server.
none | round_robin | weighted | sorted
gmd_file_delete SmartSockets clients keep data for guaranteed message delivery (GMD) in a
store file.
disable instructs t i b e m s d to open the existing GMD store file.
enable instructs t i b e m s d to delete the GMD store file and create a new one
when creating this transport.
When absent, the default is d i s a b l e .
Parameter Description
preserve_gmd This parameter determines the behavior of the EMS server when it has
exported a GMD message to SmartSockets, and SmartSockets cannot
deliver that message. When SmartSockets returns the undelivered message,
EMS can either preserve it in the EMS undelivered message queue, or
discard it.
• a l w a y s instructs EMS to preserve all undelivered GMD messages in the
EMS undelivered message queue.
• r e c e i v e r s instructs EMS to preserve only those undelivered GMD
messages that SmartSockets could not deliver despite the existence of
one or more GMD receivers. That is, if SmartSockets cannot deliver a
message because no GMD receivers exist, then EMS does not preserve
the undelivered message.
• n e v e r instructs EMS to discard all undelivered SmartSockets GMD
messages.
When absent, the default value is n e v e r.
This parameter applies only when the transport’s d e l i v e r y _ m o d e
parameter is either g m d _ a l l or g m d _ s o m e .
When the EMS server preserves a GMD message, it follows these rules to
convert the returned SmartSockets message to an EMS message:
• Follow all general rules for importing messages; see Message
Translation on page 414.
• Disregard the value of the i m p o r t _ s s _ h e a d e r s parameter, and instead
import all SmartSockets headers (as if the value of i m p o r t _ s s _ h e a d e r s
were a l l ). For a list of headers, see SmartSockets Message Properties on
page 415.
• Set the value of J M S _ T I B C O _ S S _ E X P I R A T I O N to the current time—that is,
the time at which the SmartSockets server returned the undelivered
message to EMS. (Notice that the this header would otherwise remain
unused, since GMD messages do not expire.)
Parameter Description
EMS Parameters
topic_import_dm EMS sending clients can set the J M S D e l i v e r y M o d e header field for each
queue_import_dm message. However, SmartSockets clients cannot set this header. Instead,
these two parameters determine the delivery modes for all topic messages
and queue messages that t i b e m s d imports on this transport.
TIBEMS_PERSISTENT | TIBEMS_NON_PERSISTENT | TIBEMS_RELIABLE
Example
These examples from t r a n s p o r t s . c o n f illustrate the syntax of transport
definitions.
[SS01]
type = tibss
server_names = rtHost1
username = emsServer6
password = myPasswd
project = sales_order_entry
[SS02]
type = tibss
server_names = tcp:rtHost2A:5555, ssl:rtHost2B:5571
username = emsServer6
password = myPasswd
project = mfg_process_control
override_lb_mode = enable
delivery_mode = gmd_some
Wildcard Star Although both EMS and SmartSockets both interpret the star (* ) character as a
wildcard, they differ in its semantics. In this aspect, the mapping is not
one-to-one.
In EMS, star can match any whole token of a name, but not part of a token. In
SmartSockets, star can match part of an token—for example, / f o o / b * / b a z
matches / f o o / b a r / b a z and / f o o / b o x / b a z .
If you are familiar with SmartSockets wildcards but not EMS wildcards, see
Wildcards on page 74.
Trailing Wildcard In EMS the greater-than (> ) character is a wildcard that matches any number of
trailing tokens. In SmartSockets a string of three dots (. . . ) signifies identical
semantics.
Topics
Topics can both export and import messages. Accordingly, you can configure
topic definitions (in the configuration file t o p i c s . c o n f ) with i m p o r t and e x p o r t
properties that specify one or more external transports:
export • export instructs t i b e m s d to take messages that arrive on the EMS destination,
and export them to SmartSockets via those transports.
The EMS server never re-exports an imported message on the same topic.
Example
For example, the following t i b e m s a d m i n commands configure the topic
m y T o p i c s . n e w s to import and export messages on three transports.
Wildcards
Wildcards in the i m p o r t and e x p o r t properties obey EMS syntax and semantics
(not SmartSockets syntax and semantics); see Destination Name—Syntax and
Semantics on page 408.
Queues
Configuration
You can configure queue definitions (in the configuration file q u e u e s . c o n f ) with
the i m p o r t property that specify one or more external transports.
• i m p o r t instructs t i b e m s d to import messages that arrive on those transports
from SmartSockets, and deliver them to the EMS destination.
(For general information about q u e u e s . c o n f syntax and semantics, see
q u e u e s . c o n f on page 234. You can also configure queues using the
administration tool command a d d p r o p q u e u e .)
Wildcards
Wildcards in the i m p o r t property obey EMS syntax and semantics (not
SmartSockets syntax and semantics); see Destination Name—Syntax and
Semantics on page 408.
EMS clients cannot subscribe to wildcard queues—however, you can define
wildcards queues in the EMS server for the purpose of property inheritance. That
is, you can configure a static queue named f o o . * and set properties on it, so that
child queues named f o o . b a r and f o o . b a z will both inherit those properties.
If you define a queue that imports f o o . * , t i b e m s d begins importing all matching
messages from SmartSockets. As messages arrive, t i b e m s d creates dynamic child
queues (for example, f o o . b a r and f o o . b a z ) and delivers the messages to them.
Notices that t i b e m s d delivers messages to these dynamic child queues even
when no subscribers exist to drain them.
Import Issues
This section presents issues associated with importing messages to EMS from
SmartSockets—whether on a topic or a queue.
When a topic and a queue share the same name, at most one of them may set the
i m p o r t property. For example, if a topic f o o . b a r and a queue f o o . b a r are both
defined, only one may specify the i m p o r t property.
JMSReplyTo
When t i b e m s d imports and translates a SmartSockets message, it sets the
J M S R e p l y T o field of the EMS message to the value of the SmartSockets r e p l y _ t o
header, so that EMS clients can reply to the message.
Usually this value represents a SmartSockets subject. You must explicitly
configure t i b e m s d to create a topic with a corresponding name, which exports
messages to SmartSockets.
Guaranteed Delivery
For full end-to-end guaranteed delivery from SmartSockets to EMS, all three of
these conditions must be true:
• SmartSockets senders must send messages with guaranteed message delivery
(GMD).
• The transport definition must set t o p i c _ i m p o r t _ d m or q u e u e _ i m p o r t _ d m (as
appropriate) to T I B E M S _ P E R S I S T E N T.
• A durable subscription for the EMS topic or queue must exist.
Export Issues
This section presents issues associated with exporting messages from EMS to
SmartSockets.
JMSReplyTo
Topics Consider an EMS message in which the field J M S R e p l y T o contains a topic. When
exporting such a message to SmartSockets, you must explicitly configure t i b e m s d
to import replies from SmartSockets to that reply topic.
Temporary Topics Consider an EMS message in which the field J M S R e p l y T o contains a temporary
topic. When t i b e m s d exports such a message to SmartSockets, it automatically
arranges to import replies to that temporary topic from SmartSockets; you do not
need to configure it explicitly.
Wildcard Subscriptions
Star Wildcard Both EMS and SmartSockets interpret the star character (* ) as a wildcard—but
with different semantics. EMS accepts star only as a whole element, which
matches a whole element. In contrast, SmartSockets accepts star as part of an
element, matching a substring within the element.
When a SmartSockets client subscribes to f o o . b a r * , then configure t i b e m s d to
export the superset f o o . * ; RTserver narrows the set by delivering only messages
that match subscribers. For a full discussion of the differences between EMS and
SmartSockets wildcards, see Destination Name—Syntax and Semantics on
page 408.
Guaranteed Delivery
For full end-to-end guaranteed delivery to SmartSockets from EMS, both of these
conditions must be true:
• EMS senders must send persistent messages.
• The transport definition must set d e l i v e r y _ m o d e to g m d _ s o m e or g m d _ a l l (as
appropriate).
Message Translation
Export EMS client programs may modify the values of these properties within imported
messages for re-export to SmartSockets. (However, exporting a native EMS
message does not carry these properties to SmartSockets.)
Export of these properties depends on the value of the transport parameter
e x p o r t _ p r o p e r t i e s on page 407.
Export
EMS Property SmartSockets Method Import Asymmetr.
JMS_TIBCO_SS_TYPE_NUM TipcMsgGetType type_num
all
Message Body
tibemsd can export messages with any JMS message body type to TIBCO
SmartSockets. Conversely, t i b e m s d can import messages with any message type
from TIBCO SmartSockets.
For information about JMS body types, see JMS Message Bodies on page 21.
For information about the structure of messages, see JMS Message Structure on
page 17.
SmartSockets
JMS Message Type Message Type Data Fields
Data Types
Table 62 presents the mapping between EMS datatypes and SmartSockets
datatypes. The mapping is bidirectional, except for a few SmartSockets types that
have no corresponding EMS type (for these types the mapping is marked as
unidirectional in the middle column of Table 62).
Byte T_MSG_FT_CHAR
Character T_MSG_FT_INT2
Short T_MSG_FT_INT2
Integer T_MSG_FT_INT4
Long T_MSG_FT_INT8
Float T_MSG_FT_REAL4
Double T_MSG_FT_REAL8
String T_MSG_FT_STR
Map Message
(See Import on page 416.)
Destination Names
tibemsd automatically translates destination names when importing or exporting
a message; see Slash & Dot Separators on page 408.
When importing, it translates names in the SmartSockets s u b j e c t and r e p l y _ t o
fields. When exporting, it translates names in the EMS J M S D e s t i n a t i o n and
J M S R e p l y T o fields.
System administrators must monitor and manage the TIBCO Enterprise Message
Service server. The logging, monitoring, and statistics facilities provided by the
server allow system administrators to effectively view system activity and track
system performance.
Topics
You can configure the TIBCO Enterprise Message Service server to write a variety
of information to the log. Several parameters and commands control where the
log is located as well as what information is written to the log. The log can be
written to a file, to the system console, or to both.
When you remove or move log files, it is recommended that you remove or move
all log files in the log file directory. The server can then restart its log file sequence
with 1.
You can also dynamically force the log file to be backed up and truncated using
the r o t a t e l o g command in t i b e m s a d m i n . See Command Listing on page 120 for
more information about the r o t a t e l o g command.
For other configuration parameters that affect the log file, see Tracing and Log File
Parameters on page 204.
When you want trace messages to be sent to a log file, you must also configure the
l o g f i l e configuration parameter. If you specify l o g _ t r a c e , and the l o g f i l e
configuration parameter is not set to a valid file, the tracing options are stored,
but they are not used until the server is started with a valid log file.
When configuring log or console tracing, you have a variety of options for the
types of trace messages that can be generated. Table 63 on page 424 describes the
available tracing options.
• WARNING
• ACL
• LIMITS
• ROUTE
• ADMIN
• RVADV
• CONNECT_ERROR
• CONFIG
• MSG
Specify tracing with a comma-separated list of trace options. You may specify
trace options in three forms:
• plain A trace option without a prefix character replaces any existing trace
options.
• + A trace option preceded by + adds the option to the current set of trace
options.
• - A trace option preceded by - removes the option from the current set of
trace options.
Examples
The following example sets the trace log to only show messages about access
control violations.
log_trace=ACL
The next example sets the trace log to show all default trace messages, in addition
to SSL messages, but ADMIN messages are not shown.
log_trace=DEFAULT,-ADMIN,+SSL
The next example sends a trace message to the console when a TIBCO
Rendezvous advisory message arrives.
console_trace=RVADV
Message Tracing
In addition to other server activity, you can trace messages as they are processed.
Trace entries for messages are only generated for destinations or messages that
specify tracing should be performed. For destinations, you specify the t r a c e
property to enable the generation of trace messages. For individual messages, the
J M S _ T I B C O _ M S G _ T R A C E property specifies that tracing should be performed for
this message, regardless of the destination settings. The sections below describe
the tracing properties for destinations and messages.
Message trace entries can be output to either the console or the log. The M S G trace
option specifies that message trace entries should be displayed, and the D E F A U L T
trace option includes the M S G option. See Tracing on the Server on page 423 for
more information about specifying trace options.
You must set the tracing property on either destinations or messages and also set
the M S G or D E F A U L T trace option on the console or the log before you can view
trace entries for messages.
EMS tracing features do not filter unprintable characters from trace output. If
your application uses unprintable characters within messages (whether in data or
headers), the results of message tracing are unpredictable.
The TIBCO Enterprise Message Service server can publish topic messages for
internal system events. For example, the server can publish a message when users
connect or disconnect. System event messages contain detail about the event
stored in properties of the message. This section gives an overview of the
monitoring facilities provided by the server. For a list of monitor topics and a
description of the message properties for each topic, see Appendix B, Monitor
Messages, on page 519.
Monitoring Messages
You can monitor messages processed by a destination as they are sent, received,
or acknowledged. You can also monitor messages that have prematurely exited
due to expiration, being discarded, or a m a x R e d e l i v e r y failure.
The $ s y s . m o n i t o r topic for monitoring messages has the following format:
$ s y s . m o n i t o r . D. E. destinationName
Where D is the type of destination, E is the event you wish to monitor, and
destinationName is the name of the destination whose messages you wish to
monitor. Table 64 describes the possible values of D and E in message monitoring
topics.
You must explicitly subscribe to a message monitoring topic. That is, subscribing
to $ s y s . m o n i t o r . > will subscribe to all topics beginning with $ s y s . m o n i t o r, but
it does not subscribe you to any specific message monitoring topic such as
$ s y s . m o n i t o r . T . * . f o o . b a r. However, if another subscriber generates interest
in the message monitor topics, this subscriber will also receive those messages.
You can specify wildcards in the destinationName portion of the message monitoring
topic to subscribe to the message monitoring topic for all matching destinations.
For example, you can subscribe to $ s y s . m o n i t o r . T . r . > to monitor all messages
received by all topics. For performance reasons, you may want to avoid
subscribing to too many message monitoring topics. See Performance
Implications of Monitor Topics on page 434 for more information.
The TIBCO Enterprise Message Service server allows you to track incoming and
outgoing message volume, message size, and message statistics for the server
overall as well as for each producer, consumer, or route. You can configure the
type of statistics collected, the interval for computing averages, and amount of
detail for each type.
Statistic tracking can be set in the server’s configuration file, or you can change
the configuration dynamically using commands in the administration tool or by
creating your own application with the administration APIs.
Statistics can be viewed using the administration tool, or you can create your own
application that performs more advanced analysis of statistics using the
administration APIs.
This section details how to configure and view statistics using the configuration
files and administration tool commands. For more information about the
administration APIs, see the description of c o m . t i b c o . t i b j m s . a d m i n in the
online documentation.
The TIBCO Enterprise Message Service server tracks the number of incoming or
outgoing messages, but only messages sent or received by a producer, consumer,
or route are tracked. The server also sends system messages, but these are not
included in the number of messages.
However, the server can add a small amount of data to a message for internal use
by the server. This overhead is counted in the total message size, and you may
notice that some messages have a greater message size than expected.
Detailed Statistics
In some situations, the default statistic gathering may not be sufficient. For
example, if a topic subscriber subscribes to wildcard topics, the total statistics for
all topics that match the wildcard are kept. You may wish to get further detail in
this case and track the statistics for each actual topic the subscriber receives.
The following situations may require detailed statistic gathering:
• Topic subscribers that subscribe to wildcard topics
• Message producers that do not specify a destination when they are created.
These message producers can produce messages for any destination, and the
destination name is specified when a message is sent.
• Routes can have incoming and outgoing messages on many different topics.
• Channels can also have outgoing messages on many different topics.
Collecting detailed statistics does consume memory, and can adversely affect
performance when gathering a high volume of statistics. There are two
parameters that allow you to control resource consumption when collecting
detailed statistics. First, you can control the amount of time statistics are kept, and
second you can set a maximum amount of memory for detailed statistic
gathering. When application programs create many dynamic destinations, we
recommend against gathering detailed statistics.
The s t a t i s t i c s _ c l e a n u p _ i n t e r v a l parameter controls how long detailed
statistics are kept. This parameter can be set either in the configuration file or
dynamically with the s e t s e r v e r command. By default, statistics are kept for 15
seconds. For example, if there is a topic subscriber for the topic f o o . * , and the
subscriber receives a message on topic f o o . b a r, if no new messages arrive for
topic f o o . b a r within 15 seconds, statistics for topic f o o . b a r are deleted for that
consumer. You can set this parameter to 0 to signify that all detailed statistics are
to be kept indefinitely. Of course, statistics for an object only exist as long as the
object itself exists. That is, if a message consumer terminates, all detailed statistics
for that consumer are deleted from memory.
The m a x _ s t a t _ m e m o r y parameter controls the amount of memory used by
detailed statistics. This parameter can be set either in the configuration file or
dynamically with the s e t s e r v e r command. By default, this parameter is set to 0
which signifies that detailed statistics have no memory limit. If no units are
specified, the value of this parameter is in bytes. Optionally, you can specify units
as KB, MB, or GB. When the specified limit is reached, the server stops collecting
new statistics. The server will only resume collecting statistics if the amount of
memory used decreases (for example, if the s t a t i s t i c s _ c l e a n u p _ i n t e r v a l is
set and old statistics are removed).
Displaying Statistics
When statistic collecting is enabled, you can view statistics for producers,
consumers, routes, and destinations using the s h o w s t a t command in the
administration tool.
The s h o w s t a t command allows you to filter the statistics based on destination
name, user name, connection ID, or any combination of criteria. You can
optionally specify the t o t a l keyword to retrieve only the total statistics (this
suppresses the detailed output). You can also optionally specify the "wide"
keyword when displaying statistics for destinations or routes. This specifies that
inbound and outbound message statistics should be displayed on the same line
(the line can be 100 characters or more).
The following illustrates displaying statistics for a route where detailed statistic
tracking is enabled.
tcp://server1:7322> show stat route B
Inbound statistics for route 'B':
Total Count Rate/Second
Destination Msgs Size Msgs Size
<total> 189 37.9 Kb 10 2.0 Kb
Topic: dynamic.0 38 7.6 Kb 2 0.4 Kb
Topic: dynamic.1 38 7.6 Kb 2 0.4 Kb
Topic: dynamic.2 38 7.6 Kb 2 0.4 Kb
Topic: dynamic.3 38 7.6 Kb 2 0.4 Kb
Topic: dynamic.4 37 7.4 Kb 2 0.4 Kb
Outbound statistics for route 'B':
Total Count Rate/Second
Destination Msgs Size Msgs Size
<total> 9538 1.9 MB 10 2.1 Kb
Topic: dynamic.0 1909 394.9 Kb 2 0.4 Kb
Topic: dynamic.1 1908 394.7 Kb 2 0.4 Kb
Topic: dynamic.2 1907 394.5 Kb 2 0.4 Kb
Topic: dynamic.3 1907 394.5 Kb 2 0.4 Kb
Topic: dynamic.4 1907 394.5 Kb 2 0.5 Kb
See s h o w s t a t on page 160 for more information and detailed syntax of the show
stat command.
Secure Sockets Layer (SSL) is a protocol that provides secure authentication and
transmits encrypted data over the Internet or an internal network. Most web
browsers support SSL, and many Web sites and Java applications use it to obtain
confidential user information, such as credit card numbers.
The SSL protocol is complex, and this chapter is not a complete description of
SSL. Instead, this chapter describes how to configure SSL in the TIBCO Enterprise
Message Service server and in client applications that communicate with the
server. For a more complete description of SSL, see the SSL specification at
http://wp.netscape.com/eng/ssl3/.
Topics
TIBCO Enterprise Message Service supports the Secure Sockets Layer (SSL)
protocol. SSL uses public and private keys to encrypt data over a network
connection to secure communication between pairs of components:
• between an EMS client and the t i b e m s d server
• between the t i b e m s a d m i n tool and the t i b e m s d server
• between two routed servers
• between two fault-tolerant servers
SSL provides secure communication that works with other mechanisms for
authentication available in the EMS server. When a u t h o r i z a t i o n is enabled in
the server, the connection undergoes a two-phase authentication process. First, an
SSL hand-shake between client and server initializes a secure connection. Second,
the EMS server checks the credentials of the client using the supplied username
and password. If the connecting client does not supply a valid username and
password combination, the connection fails, even if the SSL handshake
succeeded.
Implementations The TIBCO Enterprise Message Service server and the C client libraries use
OpenSSL for SSL support. For more information, see www.openssl.org.
EMS Java clients can use either JSSE (from Sun JavaSoft) or the SSL
implementation from Entrust. The EMS Java installation includes JSSE; if you
prefer to use Entrust, you must purchase and install the Entrust SSL
implementation separately.
EMS .NET 2.0 clients use the Microsoft implementation of SSL. The Microsoft
implementation of SSL is compatible with OpenSSL. Certificates required by the
client can either be stored in files or the Microsoft certificate store. However,
Microsoft requires that the root certificate be installed in the Microsoft Certificate
Store, even when certificate files are in use.
EMS distributions usually build and include the latest versions of OpenSSL and
OpenLDAP publicly available at the time of release. For exact version numbers
see the Third Party Software License Agreements documented in the TIBCO
Software Inc. End User License Agreement for TIBCO Enterprise Message
Service.
Digital Certificates
Digital certificates are data structures that represent identities. EMS uses
certificates to verify the identities of servers and clients. Though it is not necessary
to validate either the server or the client for them to exchange data over SSL,
certificates provide an additional level of security.
A digital certificate is issued either by a trusted third-party certificate authority, or
by a security officer within your enterprise. Usually, each user and server on the
network requires a unique digital certificate, to ensure that data is sent from and
received by the correct party.
In order to support SSL, the EMS server must have a digital certificate. Optionally,
EMS clients may also be issued certificates. If the server is configured to verify
client certificates, a client must have a certificate and have it verified by the server.
Similarly, an EMS client can be configured to verify the server’s certificate. Once
the identity of the server and/or client has been verified, encrypted data can be
transferred over SSL between the clients and server.
A digital certificate has two parts—a public part, which identifies its owner (a
user or server); and a private key, which the owner keeps confidential.
The public part of a digital certificate includes a variety of information, such as
the following:
• The name of the owner, and other information required to confirm the unique
identity of the subject. This information can include the URL of the web server
using the digital certificate, or an email address.
• The subject’s public key.
• The name of the certificate authority (CA) that issued the digital certificate.
• A serial number.
• The length of time the certificate will remain valid—defined by a start date
and an end date.
The most widely-used standard for digital certificates is ITU-T X.509. TIBCO
Enterprise Message Service supports digital certificates that comply with X.509
version 3 (X.509v3); most certificate authorities, such as Verisign and Entrust,
comply with this standard.
For all parameters that specify the identity (digital certificate), private key, issuer
(certificate chain), or trusted list of certificate authorities, valid files must be
specified. Not all types of files are supported for clients and servers. The
description of each parameter details which formats it supports.
Table 65 lists the valid types of files.
Extension Description
.pem PEM encoded certificates and keys (allows the certificate and
private key to be stored together in the same file)
To use SSL, each instance of t i b e m s d must have a digital certificate and a private
key. The server can optionally require a certificate chain or trusted certificates.
Set the server to listen for SSL connections from clients by using the l i s t e n
parameter in t i b e m s d . c o n f . To specify that a port accept SSL connections,
specify the SSL protocol in the l i s t e n parameter as follows:
listen = ssl://localhost:7243
SSL Parameters
Several SSL parameters can be set in t i b e m s d . c o n f . The minimum configuration
is only one required parameter—s s l _ s e r v e r _ i d e n t i t y. However, if the server’s
certificate file does not contain its private key, then you must specify it in
s s l _ s e r v e r _ k e y.
SSL Server Parameters on page 208 provides a complete description of the SSL
parameters that can be set in t i b e m s d . c o n f .
To use an SSL connection to the EMS server, a client must include these JAR files
in the C L A S S P A T H .
• tibcrypt.jar
• slf4j-api-1.4.2.jar
• slf4j-simple-1.4.2.jar
These JARs are included with the TIBCO Enterprise Message Service installation,
and are located in the EMS_HOME\ l i b directory.
Entrust To use Entrust with an EMS client, you must separately purchase and install the
Entrust libraries. If you use the Entrust libraries, you must include them in the
CLASSPATH before the t i b c r y p t JAR file. To use Entrust with JDK, you must
download the unlimited strength policy JAR files from Sun's website and install
them in your local installation of JDK. For installation and configuration details,
see Entrust documentation.
Configuring SSL
A client connecting to an EMS server can configure SSL characteristics in the
following ways:
• Create a connection factory that specifies the appropriate SSL parameters and
use JNDI to lookup the connection factory. The server URL in the connection
factory must specify the SSL protocol, and the factory must specify
appropriate SSL parameters.
A preconfigured connection factory is the preferred mechanism in many
situations. See Creating Connection Factories for Secure Connections and
Performing Secure Lookups for details on how to create a connection factory
with SSL parameters in EMS.
• Dynamically create a connection factory, as described in Dynamically
Creating Connection Factories and set the global SSL parameters locally using
the T i b j m s S S L class (Java), t i b e m s S S L P a r a m s type (C), or E M S S S L class (C#).
Specifying any SSL parameters within a connection factory causes all global SSL
parameters set with the T i b j m s S S L class to be ignored.
When configuring a connection factory, EMS does not verify any file names
specified in the SSL parameters. At the time the factory is retrieved using JNDI,
the EMS server attempts to resolve any file references. If the files do not match the
supported types or the files are not found, the JNDI lookup fails with a
ConfigurationException.
Table 66 briefly describes the parameters you can set in a connection factory, and
refers to additional information about each parameter. For more information
about each parameter, see the description of the equivalent parameter in
t i b e m s d . c o n f on page 173.
Parameter Description
ssl_vendor The vendor name of the SSL implementation that the client uses.
ssl_issuer Issuer’s certificate chain for the client’s certificate. Supply the entire
chain, including the CA root certificate. The client reads the
certificates in the chain in the order they are presented in this
parameter.
Example
ssl_issuer = certs\CA_root.pem
ssl_issuer = certs\CA_child1.pem
ssl_issuer = certs\CA_child2.pem
For more information on file types for digital certificates, see File
Names for Certificates and Keys on page 445.
ssl_private_key The client’s private key. If the key is included in the digital certificate
in s s l _ i d e n t i t y, then you may omit this parameter.
For more information on file types for digital certificates, see File
Names for Certificates and Keys on page 445.
ssl_verify_host Specifies whether the client should verify the server’s certificate. The
values for this parameter are e n a b l e d or d i s a b l e d . By default, this
parameter is enabled, signifying the client should verify the server’s
certificate.
When d i s a b l e d , the client establishes secure communication with
the server, but does not verify the server’s identity.
Parameter Description
ssl_verify_hostname Specifies whether the client should verify the name in the CN field of
the server’s certificate. The values for this parameter are e n a b l e d and
d i s a b l e d . By default, this parameter is enabled, signifying the client
should verify the name of the connected host or the name specified in
the s s l _ e x p e c t e d _ h o s t n a m e parameter against the value in the
server’s certificate. If the names do not match, the client rejects the
connection.
When d i s a b l e d , the client establishes secure communication with
the server, but does not verify the server’s name.
ssl_expected_hostname The name the client expects in the CN field of the server’s certificate.
If this parameter is not set, the expected name is the hostname of the
server.
The value of this parameter is used when the s s l _ v e r i f y _ h o s t n a m e
parameter is e n a b l e d .
ssl_ciphers Specifies the cipher suites that the client can use.
Supply a colon-separated list of cipher names. Names may be either
OpenSSL names, or longer descriptive names.
For more information, see Specifying Cipher Suites on page 452.
ssl_rand_egd The path for the entropy gathering daemon (EGD), if one is installed.
This daemon generates random data for the client.
Qualifier Description
+ Add the cipher to the list of ciphers.
ALL All ciphers from the list (except null ciphers). You can use this keyword to add or
remove all ciphers.
At least one cipher suite must be present, otherwise the SSL connection fails to
initialize. So, if you use - A L L , you must subsequently add the desired ciphers to the list.
In OpenSSL syntax, specifying a cipher suite name adds that cipher suite to the
list. Each cipher suite name can be preceded by a qualifier. Cipher suite names are
case-sensitive. Table 68 describes the qualifiers available using OpenSSL syntax.
Qualifier Description
/ When entered as the first item in the list, this option causes EMS
to begin with an empty list, and add the ciphers that follow the
slash.
If the / does not prefix the cipher list, then EMS prefixes the
cipher list with the OpenSSL cipher string D E F A U L T.
This modifier can only be used at the beginning of the list. If the
/ appears elsewhere, the syntax of the cipher suite list will be
incorrect and cause an error.
- Remove the cipher from the list of ciphers. When this option is
used, the cipher can be added later on in the list of ciphers.
Qualifier Description
ALL All ciphers from the list (except null ciphers). You can use this
keyword to add or remove all ciphers.
At least one cipher suite must be present or the SSL connection
fails to initialize. So, after using - A L L , you should add at least
one cipher to the list.
Default Cipher The EMS server and C client library hard-code a default cipher list, which is
List equivalent to A L L : ! A D H : R C 4 + R S A : + S S L v 2 : @ S T R E N G T H .
SSL_RSA_WITH_RC4_128_SHA
(RC4-SHA)
SSL_RSA_WITH_DES_CBC_SHA
(DES-CBC-SHA)
SSL_RSA_WITH_3DES_EDE_CBC_SHA
(DES-CBC3-SHA)
SSL_RSA_EXPORT_WITH_RC4_40_MD5
(EXP-RC4-MD5)
SSL_RSA_EXPORT_WITH_DES_40_CBC_SHA
(EXP-DES-CBC-SHA)
SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
(EDH-DSS-DES-CBC3-SHA)
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
(EDH-RSA-DES-CBC3-SHA)
SSL_DHE_DSS_WITH_DES_CBC_SHA
(EDH-DSS-DES-CBC-SHA)
SSL_DHE_RSA_WITH_DES_CBC_SHA
(EDH-RSA-DES-CBC-SHA)
SSL_DHE_DSS_EXPORT_WITH_DES_40_CBC_SHA
(EXP-EDH-DSS-DES-CBC-SHA)
SSL_DHE_RSA_EXPORT_WITH_DES_40_CBC_SHA
(EXP-EDH-RSA-DES-CBC-SHA)
TLS_RSA_WITH_AES_128_CBC_SHA
(AES128-SHA)
TLS_RSA_WITH_AES_256_CBC_SHA
(AES256-SHA)
TLS_DHE_DSS_WITH_AES_128_CBC_SHA
(DHE-DSS-AES128-SHA)
TLS_DHE_DSS_WITH_AES_256_CBC_SHA
(DHE-DSS-AES256-SHA)
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
(DHE-RSA-AES128-SHA)
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
(DHE-RSA-AES256-SHA)
SSL_RSA_WITH_NULL_MD5
(NULL-MD5)
JSSE only. Entrust does not support this suite.
SSL_RSA_WITH_NULL_SHA
(NULL-SHA)
JSSE only. Entrust does not support this suite.
EMS servers can use SSL for secure data exchange (standard usage), or only for
client authentication. This section describes the use of SSL for client
authentication.
Motivation Some applications require strong or encrypted authentication, but do not require
message encryption.
In this situation, application architects could configure SSL with a null cipher.
However, this solution incurs internal overhead costs of SSL calls, decreasing
message speed and throughput.
For optimal performance, the preferred solution is to use SSL only to authenticate
clients, and then avoid SSL calls thereafter, using ordinary TCP communications
for subsequent data exchange. Message performance remains unaffected.
Preconditions All three of these preconditions must be satisfied to use SSL only for
authentication:
• The server and clients must both be release 4.2 or later. (If not, EMS behavior
reverts to using SSL for all communications throughout the life of the
connection.)
• The server must explicitly enable the parameter s s l _ a u t h _ o n l y in the
t i b e m s d . c o n f configuration file.
• The client program must request a connection that uses SSL for authentication
only. clients can specify this request in factories by enabling the
s s l _ a u t h _ o n l y parameter, or by calling:
— Java: T i b j m s S S L . s e t A u t h O n l y
— C: t i b e m s S S L P a r a m s _ S e t A u t h O n l y
— C#: E M S S S L . S e t A u t h O n l y
You can enable TIBCO Enterprise Message Service to run in compliance with
Federal Information Processing Standard (FIPS), Publication 140-2.
The EMS server supports FIPS compliance only on Windows, Linux, and Solaris
10 (x86) platforms. On UNIX, only t i b e m s d 6 4 , the 64-bit version of the server, is
supported. No 32-bit support is provided.
Incompatible Parameters
In order to operate in FIPS compliant mode, you must not include these
parameters in the t i b e m s d . c o n f file:
• ssl_dh_size
• ssl_server_ciphers
• ldap_tls_rand_file
• ldap_tls_cipher_suite
• ft_ssl_ciphers
C libraries support FIPS compliance only on Windows, Linux, and Solaris 10 (x86)
platforms. On UNIX, only the 64-bit C libraries are supported. No 32-bit support
is provided.
This chapter describes the fault tolerance features of TIBCO Enterprise Message
Service.
Topics
You can arrange TIBCO Enterprise Message Service servers for fault-tolerant
operation by configuring a pair of servers—one primary and one backup. The
primary server accepts client connections, and interacts with clients to deliver
messages. If the primary server fails, the backup server resumes operation in its
place. (We do not support more than two servers in a fault-tolerant configuration.)
Shared State
A pair of fault-tolerant servers can have access to shared state, which consists of
information about client connections and persistent messages. This information
enables the backup server to properly assume responsibility for those connections
and messages. Figure 25 illustrates a fault-tolerant configuration of EMS.
Primary
Fault-Tolerant Server
Clients
lo
ck
Shared
State
Backup
Server
Locking To prevent the backup server from assuming the role of the primary server, the
primary server locks the shared state during normal operation. If the primary
server fails, the lock is released, and the backup server can obtain the lock.
Second
Server
Configuration Files
When a primary server fails, its backup server assumes the status of the primary
server and resumes operation. Before becoming the new primary server, the
backup server re-reads all of its configuration files. If the two servers share
configuration files, then administrative changes to the old primary carry over to
the new primary.
When fault-tolerant servers share configuration files, you must limit configuration
changes to the current primary server only. Separately reconfiguring the backup
server can cause it to overwrite the shared configuration files; unintended
misconfiguration can result.
Detection
A backup server detects a failure of the primary in either of two ways:
• Heartbeat Failure—The primary server sends heartbeat messages to the backup
server to indicate that it is still operating. When a network failure stops the
servers from communicating with each other, the backup server detects the
interruption in the steady stream of heartbeats. For details, see Heartbeat
Parameters on page 467.
• Connection Failure—The backup server can detect the failure of its TCP
connection with the primary server. When the primary process terminates
unexpectedly, the backup server detects the broken connection.
Response
When a backup server (B) detects the failure of the primary server (A), then B
attempts to assume the role of primary server. First, B obtains the lock on the
current shared state. When B can access this information, it becomes the new
primary server.
Shared
State
ck
B
lo
Primary
Server
Lock Unavailable
If B cannot obtain the lock immediately, it alternates between attempting to obtain
the lock (and become the primary server), and attempting to reconnect to A (and
resume as a backup server)—until one of these attempts succeeds.
Role Reversal
When B becomes the new primary server, A can restart as a backup server, so that
the two servers exchange roles.
Backup
Fault-Tolerant A Server
Clients
Shared
State
ck
B
lo
Primary
Server
Client Transfer
Clients of A that are configured to failover to backup server B automatically
transfer to B when it becomes the new primary server. B reads the client’s current
state from the shared storage to deliver any persistent messages to the client.
Client Notification
Client applications can receive notification when shared state failover occurs.
Java
To receive notification, Java client programs set the system property
t i b c o . t i b j m s . f t . s w i t c h . e x c e p t i o n to any value, and define an
E x c e p t i o n L i s t e n e r to handle failover notification; see the class
c o m . t i b c o . t i b j m s . T i b j m s in TIBCO Enterprise Message Service Java API
Reference.
C
To receive notification, C client programs call
tibems_setExceptionOnFTSwitch(TIBEMS_TRUE) and register the exception
callback in order to receive the notification that the reconnection was successful.
C#
To receive notification, .NET client programs call
T i b e m s . S e t E x c e p t i o n O n F T S w i t c h ( t r u e ) , and define an exception listener to
handle failover notification; see the method T i b e m s . S e t E x c e p t i o n O n F T S w i t c h
on page 294 in TIBCO Enterprise Message Service .NET API Reference.
Message Redelivery
Persistent When a failure occurs, messages with delivery mode P E R S I S T E N T, that were not
successfully acknowledged before the failure, are redelivered.
Synchronous When using durable subscribers, EMS guarantees that a message with
Mode P E R S I S T E N T delivery mode and written to a s t o r e with the property m o d e = s y n c ,
will not be lost during a failure.
Delivery Any messages that have been successfully acknowledged or committed are not
Succeeded redelivered, in compliance with the JMS 1.1 specification.
Transactions
A transaction is considered active when at least one message has been sent or
received by the session, and the transaction has not been successfully committed.
After a failover, attempting to commit the active transaction results in a
j a v a x . j m s . T r a n s a c t i o n R o l l e d B a c k E x c e p t i o n . Clients that use transactions
must handle this exception, and resend any messages sent during the transaction.
The backup server automatically redelivers any messages that were delivered to
the session during the transaction that rolled back.
Queues
For queue receivers, any messages that have been sent to receivers, but have not
been acknowledged before the failover, may be sent to other receivers
immediately after the failover.
A receiver trying to acknowledge a message after a failover may receive the
j a v a x . j m s . I l l e g a l S t a t e E x c e p t i o n . This exception signifies that the attempted
acknowledgement is for a message that has already been sent to another queue
receiver. This exception only occurs in this scenario, or when the session or
connection have been closed. This exception cannot occur if there is only one
receiver at the time of a failover, but it may occur for exclusive queues if more
than one receiver was started for that queue.
Acknowledged messages are never redelivered (in compliance with the JMS
specification). The case described above occurs when the application cannot
acknowledge a message because of a failover.
Heartbeat Parameters
When the primary server heartbeat stops, the backup server waits for its
activation interval (elapsed time since it detected the most recent heartbeat); then
the backup server retrieves information from shared storage and assumes the role
of primary server.
The default heartbeat interval is 3 seconds, and the default activation interval is
10 seconds. The activation interval must be at least twice the heartbeat interval.
Both intervals are specified in seconds. You can set these intervals in the server
configuration files. See Fault Tolerance Parameters on page 196 for details.
This section presents details of the unshared state failover sequence. Detailed
configuration information is provided in Configuring Clients for Unshared State
Connections on page 482.
Detection Unshared state failover is initiated by the EMS client. When a client setup for
unshared state detects a lost connection to server (A), it attempts to connect to
server (B), as defined in the connection factory.
B Current
Server
Response Clients with unshared state connections automatically connect to B after losing
the connection to A.
When clients setup for unshared state detect lost connections to server A, they
create new connections to server, B. All runtime objects from the client's
connection are recreated, including sessions, destinations, message producers,
and message consumers.
Because unshared state is defined in the connection factory, B remains the current
server as long as the connection is active. If the connection to B is lost, clients
attempt to connect to another server defined in the connection factory
Message Loss Because B does not have access to persistent messages that were not delivered or
acknowledged prior to the failover, some messages may be lost or delivered out of
order across the failover process. To prevent message loss, use shared state
failover.
Unsupported These features and Java classes are not supported with unshared state
Features connections:
• XA transactions
• Durable topic subscribers
• ConnectionConsumer
• ServerSession
• ServerSessionPool
• QueueRequestor
• TopicRequestor
A1
A2
B1
Legend
EMS Server
In this example, servers A1 and A2 share state. Servers B1 and B2 also share state.
However, A1 and A2 do not share state with B1 and B2.
The EMS clients created connections using unshared state connection factories.
The initial server connections were with server A1. When the connection to A1
failed, the failover process proceeded as described in Shared State Failover
Process on page 464, and the clients connect to A2.
A2 then failed, before A1 restarted. The clients next created connections to B1,
recreating all runtime objects from the connection (as described above in
Unshared State Failover Process). B1 is now the current server. Because B1 and B2
share state, If B1 fails, B2 becomes the current server.
Shared State
For the most robust failover protection, the primary server and backup server
must share the same state. Server state includes three categories of information:
• persistent message data (for queues and topics)
• client connections of the primary server
• metadata about message delivery
During a failover, the backup server re-reads all shared state information.
Support Criteria
Several options are available for implementing shared storage using a
combination of hardware and software. EMS requires that your storage solution
guarantees all four criteria in Table 70.
Always consult your shared storage vendor and your operating system vendor to
ascertain that the storage solution you select satisfies all four criteria.
Criterion Description
Write Order The storage solution must write data blocks to shared storage
in the same order as they occur in the data buffer.
(Solutions that write data blocks in any other order (for
example, to enhance disk efficiency) do not satisfy this
requirement.)
Synchronous Write Persistence Upon return from a synchronous write call, the storage
solution guarantees that all the data have been written to
durable, persistent storage.
Criterion Description
Distributed File Locking The EMS servers must be able to request and obtain an
exclusive lock on the shared storage. The storage solution must
not assign the locks to two servers simultaneously. (See
Software Options on page 473.)
EMS servers use this lock to determine the primary server.
Unique Write Ownership The EMS server process that has the file lock must be the only
server process that can write to the file. Once the system
transfers the lock to another server, pending writes queued by
the previous owner must fail.
Hardware Options
Consider these examples of commonly-sold hardware options for shared storage:
• Dual-Port SCSI device
• Storage Area Network (SAN)
• Network Attached Storage (NAS)
SCSI and SAN Dual-port SCSI and SAN solutions generally satisfy the Write Order and
Synchronous Write Persistence criteria. (The clustering software must satisfy the
remaining two criteria.) As always, you must confirm all four requirements with
your vendors.
NAS NAS solutions require a CS (rather than a CFS) to satisfy the Distributed File
Locking criterion (see below).
Some NAS solutions satisfy the criteria, and some do not; you must confirm all
four requirements with your vendors.
NAS with NFS When NAS hardware uses NFS as its file system, it is particularly difficult to
determine whether the solution meets the criteria. Our research indicates the
following conclusions:
• NFS v2 and NFS v3 definitely do not satisfy the criteria.
• NFS v4 with TCP might satisfy the criteria. Consult with the NAS vendor to
verify that the NFS server (in the NAS) satisfies the criteria. Consult with the
operating system vendor to verify that the NFS client (in the OS on the server
host computer) satisfies the criteria. When both vendors certify that their
components cooperate to guarantee the criteria, then the shared storage
solution supports EMS.
For more information on how the EMS locks shared store files, see How EMS
Manages Access to Shared Store Files on page 113.
Software Options
Consider these examples of commonly-sold software options:
• Cluster Server (CS)
A cluster server monitors the EMS server processes and their host computers,
and ensures that exactly one server process is running at all times. If the
primary server fails, the CS restarts it; if it fails to restart the primary, it starts
the backup server instead.
• Clustered File System (CFS)
A clustered file system lets the two EMS server processes run simultaneously.
It even lets both servers mount the shared file system simultaneously.
However, the CFS assigns the lock to only one server process at a time. The
CFS also manages operating system caching of file data, so the backup server
has an up-to-date view of the file system (instead of a stale cache).
With dual-port SCSI or SAN hardware, either a CS or a CFS might satisfy the
Distributed File Locking criterion. With NAS hardware, only a CS can satisfy this
criterion (CFS software generally does not). Of course, you must confirm all four
requirements with your vendors.
Storage Files
By default, the t i b e m s d server creates three file-based stores to store shared state:
• $ s y s . f a i l s a f e —This store holds persistent messages using synchronous
I/O calls.
• $ s y s . n o n f a i l s a f e —This file stores messages using asynchronous I/O calls.
• $ s y s . m e t a —This store holds state information about durable subscribers,
fault-tolerant connections, and other metadata.
These default files can be changed or modified. See Default Store Files on page 30
for more information.
Storage Parameters
Several configuration parameters apply to EMS storage files (even when
fault-tolerant operation is not configured); see Storage File Parameters on
page 189.
Shared State
To configure an EMS server as a fault-tolerant backup, set these parameters in its
main configuration file (or on the server command line):
• server Set this parameter to the same server name in the configuration
files of both the primary server and the backup server.
• ft_active In the configuration file of the primary server, set this
parameter to the URL of the backup server. In the configuration file of the
backup server, set this parameter to the URL of the primary server.
When the backup server starts, it attempts to connect to the primary server. If it
establishes a connection to the primary, then the backup server enters standby
mode. If it cannot establish a connection to the primary, then the backup server
assumes the role of the primary server (in active mode).
While the backup server is in standby mode, it does not accept connections from
clients. To administer the backup server, the a d m i n user can connect to it using the
administration tool.
If the two EMS Servers are not sharing a u s e r s . c o n f file, make sure that you
create a user with the same name as the EMS Server, and set the user's password
with the value of the "server" password.
For example, you have two EMS Servers (Server 1 and Server 2) that are named
"EMS-SERVER" and are to use a password of "mySecret", but which do not share a
u s e r s . c o n f file. To set the user names and passwords, start the EMS
Administration Tool on each server, as described in Using the EMS
Administration Tool on page 115, and do the following.
SSL
You can use SSL to secure communication between a pair of fault-tolerant servers.
Parameters in the main configuration file (t i b e m s d . c o n f ) affect this behavior.
The relevant parameters all begin with the prefix f t _ s s l .
The server initializing a secure connection to another server uses the f t _ s s l
parameters to determine the properties of its secure connection to the other
server. The receiving server validates the incoming connection against its own
s s l _ parameters. For more information about f t _ s s l parameters, see Fault
Tolerance Parameters on page 196. For more information about s s l _ parameters,
see SSL Server Parameters on page 208.
See Also Chapter 18, Using the SSL Protocol, on page 441
Reconnect Timeout
When a backup server assumes the role of the primary server during failover,
clients attempt to reconnect to the backup server (that is, the new primary) and
continue processing their current message state. Before accepting reconnects from
the clients, the backup server reads its message state from the shared state files.
You can instruct the server to clean up state information for clients that do not
reconnect before the time limit specified by the f t _ r e c o n n e c t _ t i m e o u t
configuration parameter. The f t _ r e c o n n e c t _ t i m e o u t time starts once the server
has fully recovered the shared state, so this value does not account for the time it
takes to recover the store files. See f t _ r e c o n n e c t _ t i m e o u t on page 197 for
details.
Unshared State
When configuring a fault tolerant pair that does not share state, you must ensure
that both servers use identical configurations. This is especially important for
these configuration settings:
• Destinations Both servers must support the same destinations.
• Routes Messages must be able to arrive at the endpoints, using equivalent or
identical routes across servers.
• Access Control Access control must be setup identically in both servers, so
that the u s e r s . c o n f , g r o u p s . c o n f , and a c l . c o n f file settings match.
• SSL When SSL is deployed, both servers must use the same certificate(s).
When a backup server assumes the role of the primary server during failover,
clients attempt to reconnect to the backup server (that is, the new primary). To
enable a client to reconnect, you must specify the URLs of both servers when
creating a connection.
Specify multiple servers as a comma-separated list of URLs. Both URLs must use
the same protocol (either t c p or s s l ). For example, to identify the first server as
t c p : / / s e r v e r 0 : 7 2 2 2 , and the second server as t c p : / / s e r v e r 1 : 7 3 4 4 (if first
server is not available), you can specify:
serverUrl=tcp://server0:7222, tcp://server1:7344
The client attempts to connect to each URL in the order listed. If a connection to
one URL fails, the client tries the next URL in the list. The client tries the URLs in
sequence until all URLs have been tried. If the first failed connection was not the
first URL in the list, the attempts wrap to the start of the list (so each URL is tried).
If none of the attempts succeed, the connection fails.
For information on how to lookup a fault-tolerance URL in the EMS naming
service, see Performing Fault-Tolerant Lookups on page 342.
The reconnection logic in the client is triggered by the specifying multiple URLs
when connecting to a server. If no backup server is present, the client must still
provide at least two URLs (typically pointing to the same server) in order for it to
automatically reconnect to the server when it becomes available after a failure.
When messages are sent in non-persistent or reliable modes, the consumer does
not normally wait for a server reply to its acknowledgements. However, a fault
tolerant consumer does wait for a server reply (when using an acknowledgement
mode other than D U P S _ O K _ A C K N O W L E D G E or
E X P L I C I T _ C L I E N T _ D U P S _ O K _ A C K N O W L E D G E ). This is true for shared state
configurations. Unshared state configurations, which tolerate lost, duplicated,
and out-of-order messages during a failover, do not wait for server
acknowledgements.
Java
Use the T i b j m s C o n n e c t i o n F a c t o r y object’s s e t R e c o n n A t t e m p t C o u n t ( ) ,
s e t R e c o n n A t t e m p t D e l a y ( ) , and s e t R e c o n n A t t e m p t T i m e o u t ( ) methods to
establish new reconnection failure parameters:
factory.setReconnAttemptCount(10);
factory.setReconnAttemptDelay(1000);
factory.setReconnAttemptTimeout(1000);
C
Use the t i b e m s C o n n e c t i o n F a c t o r y _ S e t R e c o n n e c t A t t e m p t C o u n t ,
t i b e m s C o n n e c t i o n F a c t o r y _ S e t R e c o n n e c t A t t e m p t D e l a y , and
t i b e m s C o n n e c t i o n F a c t o r y _ S e t R e c o n n e c t A t t e m p t T i m e o u t functions to
establish new reconnection failure parameters:
status = tibemsConnectionFactory_SetReconnectAttemptCount(
factory, 10);
status = tibemsConnectionFactory_SetReconnectAttemptDelay(
factory, 1000);
status = tibemsConnectionFactory_SetReconnectAttemptTimeout(
factory, 1000);
C#
Use the C o n n e c t i o n F a c t o r y . S e t R e c o n n A t t e m p t C o u n t ,
C o n n e c t i o n F a c t o r y . S e t R e c o n n A t t e m p t D e l a y, and
C o n n e c t i o n F a c t o r y . S e t R e c o n n A t t e m p t T i m e o u t methods to establish new
reconnection failure parameters:
factory.setReconnAttemptCount(10);
factory.setReconnAttemptDelay(1000);
factory.setReconnAttemptTimeout(1000);
Unshared state connections are created differently from shared state connections
in three important ways. First, there is a JAR file that must be present in the
environment C L A S S P A T H of the client. Second, the connection must be created
using an unshared state connection factory. And finally, the server URLs must be
specified using unshared state syntax.
• Dual State To combine shared state server pairs with unshared state servers,
use commas to separate the servers that share state, and plus (+ ) signs to
separate servers that do not share state. For example, this line specifies server
a 1 and a 2 as a fault-tolerant pair that share state, and servers b 1 and b 2 as a
second pair with shared state:
serverUrl=tcp://a1:8222,tcp://a2:8222+tcp://b1:8222,tcp://b2:8222
Server lookup functions do not permit unshared state syntax. That is, you cannot
separate server URLs using the plus (+ ) symbol during a server lookup.
Topics
Overview of Routing
TIBCO Enterprise Message Service servers can route messages to other servers.
• Topic messages can travel one hop or multiple hops (from the first server).
• Queue messages can travel only one hop to the home queue, and one hop from
the home queue.
You can define routes using an administrative interface (that is, configuration
files, t i b e m s a d m i n , or administration APIs).
Route
Basic Operation
• Each route connects two TIBCO Enterprise Message Service servers.
• Each route forwards messages between corresponding destinations (that is,
global topics with the same name, or explicitly routed queues) on its two
servers.
• Routes are bidirectional; that is, each server in the pair forwards messages
along the route to the other server.
For example, the compact view at the top of Figure 31 denotes a route between
two servers, A and B. The exploded view beneath it illustrates the behavior of the
route. Each server has a global topic named T1, and a routed queue Q1; these
destinations correspond, so the route forwards messages between them. In
addition, server A has a global topic T2, which does not correspond to any topic
on server B. The route does not forward messages from T2.
Server: A Server: B
Queue:
Queue: Q1
Q1@A
Topic: T1 Topic: T1
Topic: T2
Global Destinations
Routes forward messages only between global destinations—that is, for topics the
g l o b a l property must be set on both servers (for queues, see Routed Queues on
page 504). (For more information about destination properties, See Destination
Properties on page 55.)
Figure 32 illustrates a route between two servers, C and D, with corresponding
destinations T1 and T2. Notice that T1 is global on both C and D, so both servers
forward messages across the route to the corresponding destination. However, T2
is not global on C, neither C nor D forward T2 messages to one another.
T1 T1
global=true global=true
T2
T2
global=true
Note that the configuration on the right is illegal only in a multi-hop zone; it is
legal in a one-hop zone. For further information, see Zone on page 490.
A B C P Q R
D E S T
Zone
Zones restrict the behavior of routes, so you can configure complex routing paths.
Zones affect topic messages, but not queue messages.
Basic Operation
A zone is a named set of routes. Every route belongs to a zone. A zone affects the
forwarding behavior of its routes:
• In a multi-hop (m h o p ) zone, topic messages travel along all applicable routes
to all servers connected by routes within the zone.
• In a one-hop (1 h o p ) zone, topic messages travel only one hop (from the first
server).
• Queue messages travel only one hop, even within multi-hop zones.
For example, Figure 34 depicts a set of servers connected by routes within a
multi-hop zone, Z1. If a client sends a message to a global topic on server B, the
servers forward the message to A, C, D and E (assuming there are subscribers at
each of those servers). In contrast, if Z1 were a one-hop zone, B would forward
the message to A, C and D—but D would not forward it E.
A B C
Zone: Z1
mhop
D E
The goal is to forward messages from B1 and B2 to both M and R. The routing
graph seems to contain a cycle—the path from B1 to M to B2 to R duplicates the
route from B1 to R. However, since these routes belong to the one-hop zone Z2, it
is impossible for messages to travel the longer path. Instead, this limitation results
in the desired result—forwarding from B1 to M and R, and from B2 to M and R.
Zone: Z2
1hop
M R
Overlapping Zones
A server can have routes that belong to several zones. When zones overlap at a
server, the routing behavior within each zone does not limit routing in other
zones. That is, when a forwarded message reaches a server with routes in several
zones, the message crosses zone boundaries, and its hop count is reset to zero.
Figure 36 on page 492 illustrates an enterprise with one-hop zones connecting all
the servers in each of several cities in a fully-connected graph. Zone TK connects
all the servers in Tokyo; zone NY connects all the servers in New York; zone PA
connects all the servers in Paris. In addition, the multi-hop zone WO connects one
server in each city.
When a client of server TK3 produces a message, it travels one hop to each of the
other Tokyo servers. When the message reaches TK1, it crosses into zone WO. TK1
forwards the message to NY1, which in turn forwards it to PA1. When the
message reaches NY1, it crosses into zone NY (with hop count reset to zero); NY1
forwards it one hop to each of the other New York servers. Similarly, when the
message reaches PA1, it crosses into zone PA (with hop count reset to zero); PA1
forwards it one hop to each of the other Paris servers.
NY1 NY2
Zone: NY
NY4 1hop NY3
A route connects two servers. You may configure a route at either or both of the
servers.
Active-Passive When you configure a route at only one server, this asymmetry results in two
Routes perspectives on the route:
• A route is active from the perspective of the server where it is configured. This
server actively initiates the connection to the other server, so we refer to it as
the active server, or initiating server.
• A route is passive from the perspective of the other server. This server
passively accepts connection requests from the active server, so we refer to it
as the passive server.
A server can have both active and passive routes. That is, you can configure
server S to initiate routes, and also configure other servers to initiate routes to S.
You can specify and modify the properties of an active route, but not those of a
passive route. That is, properties of routes are associated with the server where
the route is configured, and which initiates the connection.
Note that defining a route specifies a zone as well (either implicitly or explicitly).
The first route in the zone defines the type of the route; subsequent routes in the
same zone must have the same zone type (otherwise, the server reports an error).
Active-Active Two servers can both configure an active route one to the other. This arrangement
Routes is called an active-active configuration. For example, server A specifies a route to
server B, and B specifies a route to A. Either server can attempt to initiate the
connection. This configuration results in only one connection; it does not result in
redundant routes.
You can promote an active-passive route to an active-active route. To promote a
route, use this command on the passive server:
create route name u r l = url
The url argument is required, so that the server (where the route is being
promoted) can connect to the other server if the route becomes disconnected.
See also c r e a t e r o u t e on page 124.
The promoted route behaves as a statically configured route—that is, it persists
messages for durable subscribers, and stores its configuration in r o u t e s . c o n f ,
and administrators can modify its properties.
You can create routes using the administration tool (see Chapter 6 on page 115), or
the administration APIs (see c o m . t i b c o . t i b j m s . a d m i n . R o u t e I n f o in the online
documentation).
Syntax To create a route using the administration tool, first connect to one of the servers,
then use the c r e a t e r o u t e command with the following syntax:
create route name u r l = URL z o n e _ n a m e = zone_name z o n e _ t y p e = 1 h o p | m h o p properties
• name is the name of the server at the other end of the route; it also becomes the
name of the route.
• URL specifies the other server by its URL—including protocol and port.
If your environment is configured for fault tolerance, the URL can be a
comma-separated list of URLs denoting fault-tolerant servers. For more
information about fault tolerance, see Chapter 19, Fault Tolerance, on
page 461.
• zone_name specifies that the route belongs to the routing zone with this name.
When absent, the default value is d e f a u l t _ m h o p _ z o n e (this default yields
backward compatibility with configurations from releases earlier than 4.0).
• The zone type is either 1 h o p or m h o p . When omitted, the default value is m h o p .
• properties is a space-separated list of properties for the route. Each property has
the syntax:
prop_name=value
For gating properties that control the flow of topics along the route, see
Selectors for Routing Topic Messages on page 501.
For properties that configure the Secure Sockets Layer (SSL) protocol for the
route, see Routing and SSL on page 495.
Example For example, these commands on server A would create routes to servers B and C.
The route to B belongs to the one-hop zone Z 1 . The route to C belongs to the
multi-hop zone Z M .
create route B url=tcp://B:7454 zone_name=Z1 zone_type=1hop
create route C url=tcp://C:7455 zone_name=ZM zone_type=mhop
Example
create route B url=tcp://B:7454,tcp://BBackup:7454 zone_name=Z1 zone_type=1hop
• When a server initiates an SSL connection, it sends the route’s SSL parameters
to identify and authenticate itself to the passive server. You can specify these
parameters when creating the route, or you can specify them in the route
configuration file, r o u t e s . c o n f .
Parameter Description
ssl_identity The server’s digital certificate in PEM, DER, or
PKCS#12 format. You can copy the digital
certificate into the specification for this parameter,
or you can specify the path to a file that contains
the certificate in one of the supported formats.
For more information, see File Names for
Certificates and Keys on page 445.
Example
ssl_issuer = certs\CA_root.pem
ssl_issuer = certs\CA_child1.pem
ssl_issuer = certs\CA_child2.pem
Parameter Description
ssl_password Private key or password for private keys.
You can set passwords using the t i b e m s a d m i n
tool. When passwords are set with this tool, the
password is obfuscated in the configuration file.
For more information, see Chapter 6, Using the
EMS Administration Tool, on page 115.
Parameter Description
ssl_verify_hostname Specifies whether the server must verify the name
in the CN field of the other server’s certificate.
The values for this parameter are e n a b l e d and
disabled.
A server forwards topic messages along routes only when the g l o b a l property is
defined for the topic; see a d d p r o p t o p i c on page 121 and c r e a t e t o p i c on
page 125.
Topic messages can traverse multiple hops.
When a route becomes disconnected (for example, because of network problems),
the forwarding server stores topic messages. When the route reconnects, the
server forwards the stored messages.
Servers connected by routes do exchange messages sent to temporary topics.
Client Client
Producer Subscriber
T1 T1
Subscriber Client If the client of server B creates a non-durable subscriber to T1, then if the client
Exit process exits, the servers delete the entire sequence of internal subscribers. When
the client restarts, it generates a new sequence of subscribers; meanwhile, the
client might have missed messages.
If the client of server B creates a durable subscriber to T1, then if the client process
exits, the entire sequence of internal subscribers remains intact; messages
continue to flow through the servers in store-and-forward fashion. When the
client restarts, it can consume all the messages that B has stored in the interim.
Server Failure In an active-active route between servers B and M, if B fails, then M retains its
internal subscriber and continues to store messages for clients of B. When B
reconnects, M forwards the stored messages.
In an active-passive route configured on B, if B fails, then M removes its internal
subscriber and does not store messages for clients of B—potentially resulting in a
gap in the message stream. When B reconnects, M creates a new internal
subscriber and resumes forwarding messages.
In an active-passive route configured on A, if either server fails, then M retains its
internal subscriber in the same way as an active-active route. However, B does not
retain its internal state which it uses to suppress duplicate messages from A and
can deliver messages to its consumers after they have consumed them. Therefore,
if it is desirable to not lose messages and to not have duplicate messages, the route
should be active-active.
maxbytes Combining durable subscribers with routes creates a potential demand for
storage—especially in failure situations. For example, if server B fails, then server
M stores messages until B resumes. We recommend that you set the m a x b y t e s or
m a x m s g s property of the topic (T1) on each server, to prevent unlimited storage
growth (which could further disrupt operation).
Example Figure 38 on page 501 illustrates an enterprise with a central server for processing
customer orders, and separate regional servers for billing those orders. For
optimal use of network capacity, we configure topic selectors so that each regional
server gets only those orders related to customers within its region.
Incoming Orders
Specifying Specify message selectors for global topics as properties of routes. You can define
Selectors these properties in two ways:
• Define selectors when creating the route (either in r o u t e s . c o n f , or with the
administrator command c r e a t e r o u t e ).
• Manipulate selectors on an existing route (using the a d d p r o p , s e t p r o p , or
removeprop administrator commands).
If you change the message selectors on a route, only incoming messages are
evaluated against the new selectors. Messages pending in the server are
re-evaluated only if the server is restarted.
Syntax The message selector properties have the same syntax whether they appear in a
command or in a configuration file:
i n c o m i n g _ t o p i c = topicName s e l e c t o r = " msg-selector"
o u t g o i n g _ t o p i c = topicName s e l e c t o r = " msg-selector"
The terms incoming and outgoing refer to the perspective of the active server—
where the route is defined.
topicName is the name of a global topic.
Wildcards You can specify wildcards in topic names. For each actual topic, the server uses
logical A N D to combine all the selectors that match the topic.
Routed Queues
Server: R L Producer
Q1
R Q1 global
- home queue M Consumer
Q1
Server: S
S Q1@R global
- proxy rcvr N Consumer
Q1
Owner & Home Server R defines a global queue named Q1. R is the owner of Q1.
Servers P and S define routed queues Q1@R. This designation indicates that these
queues depend upon and reflect their home queue (that is, Q1 on server R). Notice
that the designation Q1@R is only for the purpose of configuration; clients of P
refer to the routed queue as Q1.
Producers From the perspective of producer clients, a routed queue stores messages and
forwards them to the home queue. For example, when J sends a message to Q1 on
server P, P forwards it to the queue owner, R, which delivers it to Q1 (the home
queue).
The message is not available for consumers until it reaches the home queue. That
is, client K cannot consume the message directly from server P.
If server R fails, or the route connection from P to R fails, P continues to store
messages from K in its queue. When P and R resume communication, P delivers
the stored messages to Q1 on R.
Similarly, routed queues do not generate an exception when the m a x b y t e s and
m a x m s g s limits are exceeded in the routed server. Clients can continue to send
messages to the queue after the limit is reached, and the messages will be stored
in the routed server until the error condition is cleared.
Consumers From the perspective of consumer clients, a routed queue acts as a proxy receiver.
For example, when L sends a message to Q1 on server R, Q1 on P can receive it
from R on behalf of K, and immediately gives it to K.
If server P fails, or the route connection from P to R fails, K cannot receive
messages from Q1 until the servers resume communication. Meanwhile, M and N
continue to receive messages from Q1. When P and R resume communication, K
can again receive messages through Q1 on P.
Receiving messages from a routed queue using either a small timeout (less than
one second) or no wait can cause unexpected behavior. A small timeout value
increases the chances that protocol messages may not be processed correctly
between the routed servers. For example, queue receivers may not be correctly
destroyed.
Configuration You must explicitly configure each routed queue in q u e u e s . c o n f —clients cannot
create routed queues dynamically.
You may use the administration tool or API to configure routed queues; see
a d d p r o p q u e u e on page 120 and c r e a t e q u e u e on page 124.
To configure a routed queue, specify the queue name and the server name of the
queue owner; for example, on server P, configure:
Q1@R global
It is legal to use this notation even for the home queue. The queue owner
recognizes its own name, and ignores the location designation (@ R ).
Browsing Queue browsers cannot examine routed queues. That is, you can create a browser
only on the server that owns the home queue.
Transactions TIBCO Enterprise Message Service does not support transactional consumers on
routed queues.
A B
authorization=enabled authorization=disabled
Q2@B Q2
In Figure 40, servers A and B both configure active routes to one another.
• Because A enables authorization, A must configure a user named B.
• However, because B disables authorization, A need not identify itself to B, and
B need not configure a user named A.
ACL
When routing a secure topic or queue, servers consult the ACL specification
before forwarding each message. The servers must grant one another appropriate
permissions to send, receive, publish or subscribe.
For example, in Figure 40, you don’t need an ACL for messages to flow from A
(where a producer is sending to) to B (where a consumer is consuming from)
because B has authorization turned off and messages are being sent to and
consumed from queues. However, if messages were to flow from B to A (producer
connects to B and consumer connects to A), then server A's ACL should grant
user B s e n d permission on the queue Q2.
If we were to use topics in this example, then for messages to flow from A to B,
you would need A to grant B the s u b s c r i b e and d u r a b l e permission on the topic
(g l o b a l on both servers). And for messages to flow from B to A, you would have
to grant topic B p u b l i s h permission on the topic.
This appendix describes how to configure TIBCO Hawk so that it can be used to
administer and monitor the TIBCO Enterprise Message Service server.
For more information about TIBCO Hawk, see the TIBCO Hawk documentation.
Topics
TIBCO Hawk is a tool for monitoring and managing applications and operating
systems. TIBCO Enterprise Message Service provides classes for monitoring
administering the EMS server. Table 72 describes the provided classes.
Class Description
com.tibco.tibjms.admin.hawk.HawkListener Monitoring methods that allow you to
view the status of topics, queues, routes,
and other items on the TIBCO Enterprise
Message Service server.
If you wish to both monitor and manage the server, use the H a w k C o n t r o l l e r
class. If you only wish to monitor the server, use the H a w k L i s t e n e r class. You do
not need both classes.
To use TIBCO Hawk to manage the TIBCO Enterprise Message Service server,
you must load one of the classes provided into the TIBCO Hawk agent. Once the
class is loaded, methods for managing the EMS server are available in the TIBCO
Hawk display.
This appendix details how to install the provided classes into the TIBCO Hawk
agent and the methods available for monitoring and managing the TIBCO
Enterprise Message Service server.
Installing the provided classes is different for UNIX and Windows platforms. The
following sections detail how to install the TIBCO Enterprise Message Service
management classes into the TIBCO Hawk agent for each platform.
These instructions are specific to TIBCO Hawk Release 4.1.0 or later. Earlier
versions of TIBCO Hawk have a different mechanism for adding plugins. Refer to
your TIBCO Hawk documentation for details on installing plugins, if you are
using an earlier version of TIBCO Hawk.
Windows Installation
To install the provided classes for use in a TIBCO Hawk agent running on a
Windows platform, perform the following:
1. Locate the t i b j m s a d m i n . h m a file in the TIBCO Enterprise Message Service
installation directory under the EMS_HOME\ s a m p l e s \ a d m i n \ h a w k
subdirectory and copy it into your h a w k \ a d m i n - p l u g i n s directory.
2. Locate the following files in the EMS_HOME\ l i b subdirectory, and copy them
into the h a w k \ a d m i n - p l u g i n s directory:
— tibjmsadmin.jar
— tibjms.jar
— jms.jar
— tibcrypt.jar
3. Open the TIBCO Hawk Configuration Utility and make certain the
a d m i n - p l u g i n s directory is set to the location where you have installed
TIBCO Hawk plugins. To set the plugins directory, click the Agent tab, then
set the Plugins Directory field to the location where the plugins are located.
For more information about using the TIBCO Hawk Configuration Utility, see
TIBCO Hawk Installation and Configuration.
4. Navigate to your plugins directory and open the t i b j m s a d m i n . h m a file in a
text editor.
5. Specify the TIBCO Hawk microagent class you wish to use in the
< c l a s s n a m e > element. You can use either the H a w k L i s t e n e r class if you only
want to monitor the server, or you can specify the H a w k C o n t r o l l e r class if
you want to monitor and manage the server.
6. Specify the username and password and server URL to use to connect to the
TIBCO Enterprise Message Service server in the appropriate < a r g > elements.
See Table 73 on page 513.
For example:
<arguments>
<arg>-user</arg>
<arg>admin</arg>
<arg>-password</arg>
<arg>MyPassword</arg>
<arg>-server</arg>
<arg>tcp://server1.yourcompany.com:7222</arg>
<arg>-timeout</arg>
<arg>5</arg>
</arguments>
You should specify the predefined a d m i n user or a user that is a member of the
$ a d m i n group.
7. Restart the TIBCO Hawk agent service. See the TIBCO Hawk documentation
for more information about restarting the service.
UNIX Installation
To install these classes for use in a TIBCO Hawk Agent running on a UNIX
platform, perform the following procedure:
1. Locate the t i b j m s a d m i n . h m a file in the TIBCO Enterprise Message Service
installation directory under the EMS_HOME/ s a m p l e s / a d m i n / h a w k
subdirectory and copy it into your TIBCO Hawk plugins directory.
Usually, a TIBCO Hawk plugins directory is located in
/usr/tibco/hawk/plugins.
2. Locate the following files in the EMS_HOME/ l i b subdirectory, and copy them
into the TIBCO Hawk plugins directory:
— tibjmsadmin.jar
— tibjms.jar
— jms.jar
— tibcrypt.jar
6. Specify the username and password and server URL to use to connect to the
TIBCO Enterprise Message Service server in the appropriate < a r g > elements.
See Table 73 on page 513.
For example:
<arguments>
<arg>-user</arg>
<arg>admin</arg>
<arg>-password</arg>
<arg>MyPassword</arg>
<arg>-server</arg>
<arg>tcp://server1.yourcompany.com:7222</arg>
<arg>-timeout</arg>
<arg>5</arg>
</arguments>
You should use the predefined a d m i n user or a user that is a member of the
$ a d m i n group.
Parameters
Parameter Description
-user The MicroAgent identifies itself with this user name and password
-password when it connects to the EMS server.
When absent, the default user name is a d m i n . When absent, the default
password is the empty string.
-user To use an encrypted password, specify this pair. As the value for
-encryptedPassword - e n c r y p t e d P a s s w o r d , supply the output you obtain by running the
Hawk utility program t i b h a w k p a s s w o r d located in your h a w k / b i n
directory:
tibhawkpassword -encrypt password
where password is your current password. See the TIBCO Hawk
Installation and Configuration Guide for details.
-server The MicroAgent connects to the EMS server at this URL (host
computer and port). When absent, the default is
tcp://localhost:7222.
Parameter Description
-timeout Limits the time (in seconds) that the MicroAgent waits for the EMS
server to respond to queries.
Acceptable values are in the range [5, 3600]. When absent, the default is
60.
Method Description
The TIBCO Hawk classes have several methods for managing and monitoring a
TIBCO Enterprise Message Service server. These methods correspond to
commands you can issue in the administration tool.
Table 74 lists the methods of each class and the corresponding t i b e m s a d m i n
command for the method. The table also lists the page where you can find more
information about each command in Chapter 6, Using the EMS Administration
Tool, on page 115.
getMethods() This method returns the list of methods that this TIBCO —
Hawk class can perform.
getListenPorts() This method returns the list of ports the TIBCO Enterprise —
Message Service server is configured to listen on.
This appendix lists all topics on which the server publishes messages for system
events. The message properties for messages published on each topic are also
described. See Monitoring Server Events on page 430 for more information about
monitor topics and messages.
Topics
Table 76 describes the properties that monitor topic messages can contain. Each
monitor message can have a different set of these properties.
Property Contents
conn_connid Connection ID of the connection that generated the event.
conn_type Type of connection that generated the event. This property can
have the following values:
• Admin
• Topic
• Queue
• Generic
• Route
event_action The action that caused the event. This property can have the values
listed in Table 77 on page 528.
event_class The type of monitoring event (that is, the last part of the topic
name without the $ s y s . m o n i t o r ).
For message monitoring, the value of this property is always set to
message.
Property Contents
event_reason The reason the event occurred (usually an error). The values this
property can have are described in Table 78 on page 530.
event_route For routing, the route that the event occurred on.
mode Message delivery mode. This values of this property can be the
following:
• persistent
• non_persistent
• reliable
Property Contents
source_name Name of the source object involved with the event. This property
can have the following values:
• XID (global transaction ID)
• message_id
source_object Source object that was involved with the event. This property can
have the following values:
• producer
• consumer
• topic
• queue
• permissions
• durable
• server
• transaction
• user
• group
• connection
• message
• jndiname
• factory
• file
• transport
Property Contents
source_value Value of source object.
target_created Time that the consumer was created (in milliseconds since the
epoch).
target_name Name of the object that was the target of the event. This property
can have the following values:
• XID (global transaction ID)
• message_id
Property Contents
target_object The general object that was the target of the event. This property
can have the following values:
• producer
• consumer
• topic
• queue
• permissions
• durable
• server
• transaction
• user
• group
• connection
• message
• jndiname
• factory
• file
• transport
target_value Value of the object that was the target of the event, such as the
name of a topic, queue, permission, and so on.
This appendix lists all possible error messages that the server can output,
alphabetized by category.
Resolution The resolution indicates possible recovery actions that administrators should
consider.
Errors These strings represent all instances of the error, as they appear in EMS server
code. Some categories have many error instances; others have only one. These
strings can include formatting characters.
Description An admin tool or program using the admin API attempted an operation that
failed for the given reason.
Resolution The admin tool or admin API provides the failure reason. The user of the tool or
API should examine the error and correct the syntax, parameter or configuration
that is causing the failure.
Errors %s: create %s failed: conflicting zone: existing consumer has a different zone
%s: create %s failed: detected duplicate durable subscription [%s] for topic [%s].
%s: create %s failed: illegal to use wildcard %s [%s].
%s: create %s failed: invalid %s [%s].
%s: create %s failed: invalid session id=%d.
%s: create %s failed: invalid syntax of %s [%s].
%s: create %s failed: invalid temporary %s [%s].
%s: create %s failed: not allowed to create dynamic %s [%s].
Invalid consumer in recover one msg request.
Invalid sequence number in recover one msg request.
Category A durable consumer was found in the store file for a route that does not exist
Description On server startup a durable consumer was found in the store file for a route that is
not listed in the routes.conf file. This happens if the routes.conf file is manually
edited.
Errors Discarding durable '%s' for route '%s' because the route does not exist.
Resolution Determine if the backup server is running. If it is running, check for a network
partition.
Resolution Change the value of the named parameter to an acceptable value; for information
about tibemsd command line parameters, see EMS documentation.
Description A warning message indicating that the commit of a client application's transaction
failed either because there were earlier errors when processing this transaction or
because the transaction was started on the primary server prior to a fault-tolerant
failover.
Errors Compaction failed on file '%s': %d (%s). Please shutdown and restart tibemsd.
Compaction failed on file '%s': %d (%s).
Description The durables configuration file specifies a durable with a given name and client
identifier with attributes that are different from the identically named durable
found in the meta.db file.
Resolution Correct the durables configuration file to match the durable defined in the
meta.db file or administratively delete the durable and re-define it.
Errors Configured durable '%s' differs from durable in storage, storage version used.
Category Create of global routed topic failed: not allowed to create dynamic topic
Description A server received an interest notification from another server that does not match
the allowed topics in its configuration.
Resolution This only is printed when the trace includes ROUTE_DEBUG. If the server's topic
definitions are as expected, this statement can be ignored or remove the
ROUTE_DEBUG trace specification to prevent printing.
Errors Create of global routed topic failed: not allowed to create dynamic topic [%s].
Category Create of routed queue failed: not allowed to create dynamic queue
Description A warning indicating that a tibemsd with a route to this daemon has a queue
configured to be global but this daemon does not permit the creation of that
queue dynamically.
Resolution Add the specified queue or a pattern that includes it to this daemon if you want
the queue to be accessible from this daemon, otherwise the warning can be
ignored.
Errors Create of routed queue failed: not allowed to create dynamic queue [%s].
Resolution Send details of the error and the situation in which it occurred to TIBCO Support.
Resolution Ensure the user is defined to EMS by one of the methods allowed by the
user_auth parameter in the main configuration file. The user is either specified by
the application or in the SSL certificate. If the user is defined, reset the password
and try again.
Description Warning generated when tibemsd receives a message with a message id that
matches another message's message id.
Resolution Examine the appropriate configuration file and correct the syntax error.
Errors Configuration warning: file=%s, line=%d: route '%s' does not have a user
configured for authorization.
SSL Configuration error: file=%s, line=%d: invalid certificate file name, unknown
extension or invalid encoding specification
Configuration error: file=%s, line=%d: illegal to specify %s for routed queue
Configuration error: file=%s, line=%d: bad destination specification: %s
Configuration warning: file=%s, line=%d: illegal to specify prefetch=none for
global or routed queue. Prefetch reset to default.
Configuration warning: file=%s, line=%d: illegal to specify prefetch=none for
topic. Prefetch reset to default.
Configuration error: file=%s, line=%d: ignored alias '%s' for %s '%s' because such
alias already exists
Configuration error: file=%s, line=%d: both tibrv_export and tibrvcm_export are
specified, ignoring tibrv_export
Configuration error: file=%s, line=%d: ignoring transport '%s' in %s list, transport
not found
Configuration error: file=%s, line=%d: multiple bridge entries for the same
destination '%s' are not allowed.
Configuration error: file=%s, line=%d: Ignoring durable, name cannot start with
$sys.route, use route property instead.
Configuration error: file=%s, line=%d: Rendezvous transport not specified for
Rendezvous CM transport '%s'
Configuration error: file=%s, line=%d: ignoring invalid max connections in the
line, reset to unlimited
Configuration error: file=%s, line=%d: ignoring invalid max_client_msg_size in
the line, reset to unlimited
Configuration error: file=%s, line=%d: value of %s out of range, reset to default
Configuration error: file=%s, line=%d: unable to create %s '%s': invalid
destination name, invalid parameters or out of memory
Configuration error: file=%s, line=%d: value of db_pool_size too big or less than
allowed minimum, reset to default value of %d bytes
Configuration error: file=%s, line=%d: Ignoring durable, route does not allow
clientid, selector or nolocal.
Configuration error: file=%s, line=%d: Route '%s' does not exist for configured
durable.
Configuration error: file=%s, line=%d: unable to process selector in route
parameters, error=%s
Category Error writing commit request, errors already occurred in this transaction
Description A client application's attempt to commit a transaction failed because the server
encountered an error during an operation associated with the transaction.
Resolution Examine previous error statements to determine the cause of the operation failure
and correct that before attempting the transaction again.
Errors Error writing commit request, errors already occurred in this transaction.
Description tibemsd was unable to update one of its configuration files following a
configuration change.
Resolution Check that the user that started the tibemsd has permission to change the
configuration files and that there is sufficient disk space on the device.
Description tibemsd was unable to write data to one of its store files.
Resolution Ensure that the directory containing the store files is mounted and accessible to
the tibemsd, and that there is free space available on the device
Resolution Shutdown process that is using the port or change the value of the 'listen'
parameter in the server's tibemsd.conf file to a port that is not in use.
Resolution Check that the path name is correct and the directory exists, the user that started
tibemsd has permission to read the specified directory and path, the file exists if it
isn't one that the tibemsd can create, the file is not being used by another tibemsd
or some other process.
Errors Recovery flow stall for destination %s failed: invalid route connection
Errors %s: create %s failed: Not permitted to use reserved queue [%s].
%s: %s failed: illegal to use wildcard %s [%s].
%s: %s failed: %s [%s] not configured.
At least one bridge is referencing %s [%s] as a target. This destination does not
exist and there is no parent that would allow its dynamic creation. The
destination has been forcefully created. To avoid this, the bridge(s) referencing
this target should be destroyed.
Use of '$' destination prefix is not supported [%s %s].
Description The server could not parse the listen parameter in the tibemsd.conf file
Resolution Correct the listen parameter to match the form [protocol]://[url] as specified in
the manual.
Description tibemsd received a request that referred to a session that doesn't currently exist.
Resolution Send details of the error and the situation in which it occurred to TIBCO Support.
Description An attempt to authenticate a client's userid and password using the external
LDAP server failed.
Resolution Examine the error code printed by the messaging server and consult the manual
for the external LDAP server.
Errors Filter '%s' contains an illegal type substitution character, only %%s is allowed
Filter '%s' contains too many occurrences of %%s, max allowed is: %d
Filter '%s' too long, max length is %d characters
Invalid search scope: %s
LDAP Configuration error: file=%s, line=%d: invalid property value
LDAP is not present
Resolution This error only occurs with the evaluation version of the server or in an
embedded form. To correct this error either replace your evaluation version with
a production version or contact the vendor who supplied the embedded version.
Resolution Change the tibemsd.conf file so that a value for the attribute is provided.
Description A client application attempted to change the state of a transaction that the
tibemsd does not have in its list of current transactions.
Resolution Check tibemsd trace logs to see if the transaction had been committed or rolled
back by an administrator, if not then check the client code to see if it or its
transaction manager are calling the transaction operations in the correct order.
Resolution Check how much memory the server process is using according to the operating
system. Compare this with how much memory and swap space the host actually
has. If there are sufficient memory and swap space, check the operating system
limits on the server process to determine if this is the cause. If the limits are set to
their maximum and this error occurs, reduce the load on this server by moving
some topics and queues to another server.
Description The tibemsd received an XA End instruction from the third party Transaction
Manager which referred to a different transaction from the one currently in use by
the session.
Resolution This error is most likely caused by an external transaction manager that allowed
two separate client applications to use the same XA transaction identifier (XID).
Consult the manual for the transaction manager or report this to the transaction
manager vendor.
Errors Cannot process xa start for a session when another transaction is already active on
that session. connID=% PRINTF_LLFMT d sessID=% PRINTF_LLFMT d %s
Cannot process xa start with TMNOFLAGS when the transaction is already
active. connID=% PRINTF_LLFMT d sessID=% PRINTF_LLFMT d %s
Resolution Send details of the error and the situation in which it occurred to TIBCO Support.
Description A client application attempted to connect to the server's TCP port using the SSL
protocol.
Resolution Change the client application's URL from ssl to tcp or change the server's listen
parameter from tcp to ssl. To activate a change of the server listen parameter
requires a restart of the server.
Description A client application attempted to connect to the server's SSL port using the TCP
protocol.
Resolution Change the client application's URL from tcp to ssl or change the server's listen
parameter from ssl to tcp. To activate a change of the server listen parameter
requires a restart of the server.
Description The multi-hop route support of the server does not support configuring a cycle.
However, it detected a configuration that would create a cycle.
Resolution See Rendezvous documentation for details of what the error means and how to
remedy it.
Errors Unable to create dispatcher for import event for %s '%s' on transport '%s', error is
%s
Unable to create inbox for import event for %s '%s' on transport '%s'
Unable to create Rendezvous Certified transport '%s': %s
Unable to create Rendezvous Certified transport '%s' because unable to create
Rendezvous transport '%s'
Unable to create Rendezvous transport '%s': %s
Description Warnings indicating that the tibemsd has run out of memory and is now using its
reserve memory
Running on reserve memory, no more send requests accepted. Pending msg count
= % PRINTF_LLFMT d
Pending msg count = % PRINTF_LLFMT d
Resolution See SmartSockets documentation for details of what the error means and how to
remedy it.
Unable to process undelivered SS GMD message, can not register EMS message,
error='%s', tport='%s', GMD seq=%d
Unable to process undelivered SS GMD message, can not add to undelivered EMS
queue, error='%s', tport='%s', GMD seq=%d
Unable to process undelivered SS GMD message, failed to build EMS message,
error='%s', tport='%s', GMD seq=%d
Unable to convert undelivered SS GMD message into EMS message, error='%s',
tport='%s', GMD seq=%d
Resolution Examine the OpenSSL error and the EMS User's Guide chapter describing the use
of SSL.
Resolution Report the error to your system administrator and ask them to remedy the
problem.
Errors Accept() failed: too many open files. Please check per-process and system-wide
limits on the number of open files.
Accept() failed: %d (%s)
Resolution Send details of the error and the situation in which it occurred to TIBCO Support.
Resolution Run the server with the -help option and compare it with the command line
containing the unrecognized option.
Description Seen when tibemsd starts up and detects that the zone for a route as specified in
routes.conf has been changed.
Resolution Either delete the route or change its zone back and restart the tibemsd.
Errors Restoring consumer failed: Conflicting zone for route to [%s]: The route was
initially zone %s type %s, but now %s type %s. Zone change not allowed while
there are durable subscribers. Please delete the route first and create new one.
[%s] %s
Active server '%s' not found.
Backup server '%s' has connected.
Error in ldap_set_option: %s
%s:%s queue browser failed: access denied for queue [%s]
Ignoring inbound routed topic '%s', no corresponding topic.
%s: created user '%s'
Unable to initialize route: expected route name '%s', received '%s'.
Evaluation Software Notice: remaining uptime is %d minutes.
%s: created topic '%s'%s%s
Connected to LDAP server %s
Processed %d msgs
Error, LDAP is disabled
Configuration warning: file=%s, line=%d: illegal to use '.' in server name, replaced
with '_',
%s: %s %s '%s' administrative permissions: %s
Warning: statistics database memory exceeded limit
[%s@%s]: rejected connect from route: this shouldn't happen: route exists with no
zone setting
Rejected connect from route '%s' at %s, routing disabled.
Missing heartbeats from primary server '%s'.
Flow stall recovery request received, send to IO
Unable to initialize route '%s': route server returned: '%s'
RUNNING SWAPPER %d %d needed = %u!
Restoring consumer warning: zone of id %d does not exist in zone mapping
entries
Ignoring inbound routed queue '%s', no corresponding queue.
%s:%s queue browser failed: illegal to use reserved queue [%s]
%s: committed transaction %s
Trying to send flow stall recovery request for destination: %s
%s: destroyed connection % PRINTF_LLFMT d
Resolution Check the status of the both server (primary, standby). In case of both active, the
file store data may be corrupted already and we recommend shutting down both
servers and investigate the situation.
Resolution Check your database server vendor and database administrator for failures
occuring during writes,deletes,reads of different records, for failures occuring
during database store open check with the database administrator for
permissions and the existence of the database. For failures occuring during a FT
setup where all the stores are database stores, please check with the database
server vendor or database administrator. In the case where both are active, we
recommend shutting down both the servers and investigating the problem.
Resolution Check the configuration of the Multicast Daemon and Server, as well as the health
of the network.
Description General multicast errors that can occur in the Server and Multicast Daemon.
Resolution Check the configuration of the Multicast Daemon and Server, as well as the health
of the network.
Description Indicates that a multicast channel's allotted bandwidth has been exceeded.
Resolution Either slow down the publisher(s), enable flow control, or increase the multicast
channel's allotted bandwidth by increasing the channel's maxrate property or
increasing the server's multicast_reserved_rate property.
Description The store files specified were created from a different version of EMS that is not
supported by this version.
Resolution Revert to use the version of EMS that created the store file or locate the store file
conversion tool and use it to convert the store file to this version.
Resolution If you are not able to fix the problem and need to restart the system, make a
backup of the store files and restart the server with the '-forceStart' command line
parameter. The server will then attempt to start regardless of errors (expect
out-of-memory errors). In this mode, application messages and/or internal
records causing problems (due to file corruption or other) will be deleted.
Therefore, dataloss is likely to occur, so this command line parameter should be
used with extreme caution and only after understanding the consequences. A
copy of the store files can be sent to TIBCO Support for post-mortem analysis.
Errors The recovery process stopped while processing a '%s' record (id=%
PRINTF_LLFMT d), error: %d - %s. Check the section 'Problems on Startup' from
chapter 'Running the EMS Server' in the User's Guide before attempting to restart
the server
Resolution Module loading is affected by the presence of shared libraries in the module path.
Use the +load tracing flag to get more information about how the server is
loading modules. See the section on Starting the EMS Server for more details.
Description An error occurred while starting or running the server in FIPS 140-2 compliant
mode.
Resolution Check the configuration of SSL related parameters to make sure that no
incompatible ciphers or operations are requested.
Description The system resources are inadequate for timely processing of server activities.
Resolution Increase the specified resource or reduce the workload on this server.
Errors Slow clock tick %d, delayed messaging and timeouts may occur.
Resolution Send details of the error and the situation in which it occurred to TIBCO Support.
Errors Cannot request second state change for transaction while the first request is in
progress (%d, %d) %s.
Unexpected request to roll xa txn forward with previous operation (%d)
incomplete: %s.
Unexpected request to roll xa txn back with previous operation (%d) incomplete:
%s.
Unexpected request to prepare xa txn with previous operation (%d) incomplete:
%s.
Unexpected request to commit xa txn with previous operation (%d) incomplete:
%s.
Unexpected request to commit session with previous operation (%d) incomplete.
Resolution Most likely, transaction manager error prevented it from advancing this
transaction in a timely manner. Verify correct operation of the transaction manner.
Index
Symbols bridges 79
bridges.conf file 223
.NET
assembly version 309
programmer’s checklist 308
$sys.redelivery.delay 67 C
C
programmer’s checklist 303
A c#
assembly version 309
acknowledgement 38 programmer’s checklist 308
acl.conf file 222 certificates
add member command 120 file names 445
addprop factory command 120 changes from the previous release of TIBCO Enter-
addprop queue command 120 prise Message Service User’s Guide xxvi
addprop route command 121 channel property 56
addprop topic command 121 channels
admin detailed statistics 437
connect 122 channels.conf file 224
password 110 cipher suites
user 118 .NET clients 457
admin user 110 Java clients 454
administrator client tracing 205
assign password 118 CLIENT_ACKNOWLEDGE mode 38, 39
anonymous client_heartbeat_server parameter 194
user and security 110 client_timeout_server_connection parameter 196
architecture client_trace parameter 205
multicast 364 cm_name parameter 382
authorization parameter 184 command line options
AUTO_ACKNOWLEDGE mode 38, 317 multicast 352
autocommit command 121 commit command 121
compact command 122
compiling samples 89
compliant_queue_ack parameter 184
B compression, message 37
configuring
bandwidth external directory for authentication 261
managing multicast 360 LDAP 261
I K
ibrvcm.conf file 241 key
import file names 445
queue property 59
topic property 59
import property 59
info command 131 L
inheritance 77
property 77 LDAP 261
inheritance of property 50 ldap_all_groups_filter parameter 217
intervals ldap_all_users_filter parameter 216
mstore 32 ldap_cache_enabled parameter 213
ldap_cache_ttl parameter 213
ldap_conn_type parameter 213
ldap_credential parameter 212
J ldap_dynamic_group_attribute parameter 218
ldap_dynamic_group_class parameter 217
jaas_classpath parameter 218 ldap_dynamic_member_url_attribute parameter 218
jaas_config_file parameter 218 ldap_group_base_dn parameter 216
jaas_login_timeout parameter 219 ldap_group_filter parameter 216
jaas.conf file 234 ldap_group_scope parameter 216
jaci_class parameter 219 ldap_principal parameter 212
jaci_classpath parameter 219 ldap_static_group_attribute parameter 217
jaci_timeout parameter 220 ldap_static_group_class parameter 217
Java ldap_static_member_attribute parameter 217
programmer’s checklist 302 ldap_tls_cacert_dir parameter 213
JMS_TIBCO_SS_CORRELATION_ID property 416 ldap_tls_cacert_file parameter 213
JMS_TIBCO_SS_DELIVERY_MODE property 416 ldap_tls_cert_file parameter 214
JMS_TIBCO_SS_EXPIRATION property 416 ldap_tls_cipher_suite parameter 214
JMS_TIBCO_SS_LB_MODE property 416 ldap_tls_key_file parameter 214
JMS_TIBCO_SS_MESSAGE_ID property 416 ldap_tls_rand_file parameter 214
JMS_TIBCO_SS_PRIORITY property 416 ldap_url parameter 212
JMS_TIBCO_SS_SENDER property 415 ldap_user_attribute parameter 215
JMS_TIBCO_SS_SENDER_TIMESTAMP property 416 ldap_user_base_dn parameter 215
JMS_TIBCO_SS_SEQ_NUM property 416 ldap_user_class parameter 215
JMS_TIBCO_SS_TYPE_NUM property 416 ldap_user_filter parameter 215
JMS_TIBCO_SS_USER_PROP property 416 ldap_user_scope parameter 215
jre_library parameter 220 ledger_file parameter 382
jre_option parameter 220 length limitations
JVM naming conventions 119
parameters 220 library files 304
linking 304
load balancing 4, 57, 79, 233, 336, 405
load balancing URL 229, 230
O properties
channel 56
options definitions 55
tibemsadmin 116 exclusive 56
overflowPolicy property 62 expiration 57
export 58
flowControl 58
global 59
P import 59
maxbytes 60
password maxmsgs 61
admin 110 maxRedelivery 61
setting 118, 134 overflowPolicy 62
password parameter 186 prefetch 65
permission queue 55
protection 255 redeliverydelay 67
secure property and 68 secure 68
persistent messages 26 sender_name 69
in queues 26 sender_name_enforced 69
in topics 26 store 70
synchronous fle storage 27 topic 55
PGM 5 trace 71
point-to-point property 16, 16, 16, 16
example 92 export 58
messaging model 3 import 59
policy.1.0 309 inheritance 50, 77
prefetch property 65 protection permissions 255
producers publish and subscribe
detailed statistics 437 example 93
programmer checklists 302 messaging model 4
C 303 purge all queues command 131
C# 308 purge all topics command 132
Java 302 purge durable command 132
purge queue command 132
purge topic command 132
Q
queue import property 59
queue limit policy 380
queue properties 55
queue property list 55
queue_import_dm parameter 383
U
undelivered message queue 20
UNIX system
using for user authentication 261