Enterprise Message Service Architecture
Enterprise Message Service Architecture
TIBCO Enterprise Message Service is a standards-based messaging solution that supports the implementation of
a Service-Oriented Architecture by providing Java Message Service (JMS) compliant communications across a
wide range of platforms and application technologies.
It uses a hub-and-spoke architecture. A hub-and-spoke architecture provides a central intermediary (called a hub)
through which applications communicate with each other.
In this architecture, each application (which represents a spoke) communicates with the intermediary (the hub),
which in turn manages communication with the other applications. Applications do not communicate directly
with each other.
Enterprise Message Service integrates support for connecting other TIBCO message services, such as TIBCO
FTL, TIBCO Rendezvous, and TIBCO SmartSocket. It uses C based server process for optimum performance
and is fully compliant with the Oracle JMS versions 1.1 and 2.0.
Administration Options
The slide shows various options available for Enterprise Message Service administration:
Tibemsd.conf File
The main configuration file that controls the characteristics of TIBCO Enterprise Message Service server
is tibemsd.conf.
It contains many general configuration parameters, like, server name, password, listen port, message storage
location, memory parameters etc.
It also refers to other configuration files containing the additional parameters. Additionally, this file also contains
other parameters like fault tolerance, SSL server, LDAP etc.
You can update configuration files using administration tools listed in the previous slide, or by editing them
directly via text editor. Configuration changes done by administration tools have immediate effect, while changes
done by editing becomes active only after you restart the EMS server.
A few configuration items can only be altered by editing. Use caution when you edit configuration files directly -
an error in configuration may prevent the server from starting.
factories.conf File
Factories.conf file defines the connection factories stored as Java Naming and Directory Interface (JNDI) names
on the Enterprise Message Service server.
The file format is as shown in the slide.
The mandatory parameters are factory name i.e. the name of the connection factory, type of the connection
factory, and url, that specifies the servers to which this factory creates connections.
Other parameters like clientID, ssl-prop etc. are optional.
An example of configured factories.conf file is as shown on the slide. Tibemsadmin tool is used to configure
connection factories in the file using the command ‘createfactory’
Enable global access control for the system by enabling authorization. The authorization is enabled either by
editing the configuration file tibemsd.conf or by using the administration tool.
Enable access control for the destinations. Determine which destinations require access control and enable access
control for those destinations by setting destination properties in the topics.conf or queues.conf file. You can
also set these properties by using the administration tool.
Determine users who need administration permissions and grant the administrator permissions to the selected
users in the acl.conf file.
Determine the names of the authorized users of the system and create usernames and passwords for these users.
Create the access control list by granting specific permissions to the users (or groups) for destinations that need
to be secure.
Acl.conf File
Access control list file defines all the permissions on topics and queues for all users and groups.
The image at top-right of the slide shows the file format and the image at bottom-right shows an example of
configured acl.conf file.
Administration tool command grant can also be used to provide permissions to specified user or groups on
specified topic or queue.
Administration Tool
The Enterprise Message Service Administration Tool is located in EMS_HOME/bin directory and is a stand-
alone executable named tibems admin on UNIX and tibemsadmin.exe on Windows platforms. The Enterprise
Message Service server instance must be running before you start the Administration Tool.
Type tibemsadmin -help to display information about tibemsadmin startup parameters.
Enter help for a summary of all available commands. Enter help command for help on a specific command.
For example: help remove command gives command description and syntax to remove users from a group.
The command line interface of the administration tool allows you to perform a variety of administrative
functions, like, grant permission, add/remove users and groups, etc. After all the tasks are performed you can
disconnect the tool and exit from the server.
Lab
In this exercise, gain basic familiarity with the Enterprise Message Service™ Administration Tool, such as,
use the help feature, connect to the server, create new users, create a group, assign users to a group, and create
destinations.
#Command to grant the TALKERS group permission to publish and subscribe on the
TESTCHAT topic
grant topic TESTCHAT TALKERS publish,subscribe
You can use wildcards when specifying statically created destinations in queues.conf and topics.conf. The use of
wildcards in destination names is used to define parent and child destination relationships, where the child
destinations inherit the properties and permissions from its parents.
You can subscribe to wildcard topics, but not publish to them. You cannot send or receive to wildcard queue
names.
Two wild card patterns are used:
o * (asterisk) means any token can be in the place of *.
o > (greater than) matches one or more trailing elements.
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 the
topic TIBCO.* is failsafe, then the topics TIBCO.CHOC and TIBCO.boo will also be failsafe. Removal of
inherited properties is not supported.
The following property does not comply with the inheritance rules:
The maxbytes property (used for both queues and topics) can be overridden by the topic or queue instance that would
normally inherit the value as a result of the registered wildcard based subscription stored in the properties file.
Inheritance of Permissions: Permissions that the user has been individually assigned, as well as permissions that
the user has as a result of membership in a group are inherited. For example, ifa user has permission to publish
on topic TEST.*, then the user also has permission to publish on TEST.new, TEST.hello, etc., but not
TEST.new.account.
Export and import properties allow messages to travel between EMS and external systems with configured
transports.
The flowControl property specifies the target maximum size the server can use to store pending messages for the
destination.
Prefetch creates a read-ahead buffer in each message consumer.
Secure property enforces permissions on a destination whenever a user attempts to perform an operation on that
destination.
Store identifies a storage configuration for messages produced with persistent delivery mode.
Trace prepares log entries to record when messages are produced or consumed on the destination.
Destination properties maxbytes, maxmsgs and overflowPolicy can be set on temporary topics and queues, using
inheritance. Properties are not shared between topics and queues.
The topic permission durable allows an application to create a consumer for a new durable subscription. In contrast,
the use_durable permission allows an application to (re-)create a consumer only for an existing durable subscription.
Temporary destinations operate under access controls outside of the normal permissions system.
Apply and Revoke Permissions
The wildcard inheritance of permissions, and the granting of permissions to users both directly and via group
membership, creates a comprehensive permissions system.
Permissions can be revoked by removing or editing entries in the acl.conf file, using the revoke command in
tibemsadmin, or by using the administration API.
Administrators can revoke permissions for users that have created topic subscriptions or are queue consumers.
Once the permission is revoked, the destination still exists, but the user can no longer perform that operation on
the destination. You cannot revoke a permission from a user that the user receives from a group. Also, you
cannot revoke a permission that is inherited from a matching wildcard destination. The revoke administrative
operation only removes permissions from an individual destination or wildcard. The revoke operation cannot
prevent inheritance of a permission resulting from a matching wildcard’s permission.
Administrative Permissions
Administrator permissions control what administrators can view and change in the server only when using the
administration tool. Administrator commands create entries in each of the configuration files (for example, tibemsd.conf,
acl.conf, routes.conf, and so on).Access to the configuration files must be controlled so that only certain system
administrators can view or modify the configuration files. Use your file system permissions to prevent uncontrolled access
to the server’s configuration files. You cannot grant or revoke administrator permissions from any user that is a member of
the $admin group.
Administrative permissions:
Administrative permissions are granted and revoked using the grant and revoke commands. Global and
destination-level permissions are granted and revoked separately using applicable administrator commands.
If a user has both global and destination-level administrator permissions, the actions that the user can perform are
determined by combining all global and destination-level administrator permissions granted to the user.
The admin user or all users in the $admin group can grant or revoke any administrator permission to any user.
All other users must be granted the change-admin-acl permission before they can grant/revoke administrator
permissions to other users. If a user has the change-admin-acl permission, that user can only grant or revoke
permissions that have been granted to the user.
Destination level permissions control the administration functions a user can perform on a specific destination, like, view
information for destination, create specified destination, delete destination, change properties for destination, etc
Protection Permissions
An administrator is able to view users that have a different protection permission set, but the administrator can
only perform actions on users with the same protection permission, i.e. Administrator with protect2 is limited to
govern only users with protect2.
There are four protection permissions, protect1, protect2, protect3, and protect4 that allow you to create four
groups of administrators. You can grant a protection permission, in addition to the all permission. This signifies
that the user has all administrator privileges for anyone who also has the same protection permission.
For example, SalesAdmin is able to perform any action on any user in the sales group, as well as see any users in
the engineering group. However, SalesAdmin is not able to grant permissions, change passwords, delete users
from, or perform any other administrative action on users of the engineering group. However, a user of a $admin
group is able to perform any action on any user, regardless of their protection permission.
No client authentication – This is default behavior with no security at all. Any client application can connect to
the server.
Authentication of valid digital certificate – With this level of security, any user with a valid identity can connect
to the TIBCO EMS server.
Authentication of valid identity and the username matches the CN field from client’s certificate and has valid
password for the user. This level guarantees that an illegal user cannot work with a valid certificate stolen from a
legal user.
ssl_require_client_cert: Only accepts SSL connections from clients that have digital certificates
ssl_server_trusted: List of trusted certificates, must be in PEM, DER, or PKCS#7 format
ssl_use_cert_username: Extracted from the CN field of the client’s digital certificate
ssl_cert_user_specname: Applications connecting as the user in ssl_cert_user_specname are authenticated
based on the CN name in their identity certificate
ssl_identity: File containing client certificate and (optionally) extra issuer certificate(s), and the private key
ssl_password: Private key/PKCS#12 password
Cipher Suites
A cipher suite is a set of algorithms that help secure a network connection that uses Secure Socket Layer (SSL).
Enterprise Message Service uses OpenSSL to provide SSL support. Therefore, the cipher suite names can be
specified as the OpenSSL name for the cipher suite.
Cipher suites are specified using ssl_server_ciphers parameter in the configuration file.
When specifying cipher suites, you specify a qualifier (for example, + to add the suite) followed by the cipher
suite name. You can list more than one cipher suite by separating each suite name with a colon (:).
To use SSL, each instance of tibemsd must have a digital certificate and a private key.
Server parameters: Specify server digital certificate parameters.
Client parameters: Specify parameters needed to verify client identity.
Miscellaneous parameters: These are various parameters needed for SSL communication. Details are as follows:
o ssl_dh_size: 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.
o ssl_server_ciphers: 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.
A client that uses an SSL connection to Enterprise Message Service server must have the following JAR files
included in the CLASSPATH as shown in the slide.
These files are included with Enterprise Message Service, and located in the $TIBEMS_HOME/lib directory.
If entrusting on the JMS client is needed, you must separately purchase and install the Entrust libraries. If you
use the Entrust libraries, you must include them in the CLASSPATH before thetibcrypt.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.
Configure Enterprise Message Service™ User
Permissions
Play Video
In this exercise, configure various levels of user permissions by setting up an administration hierarchy and then
testing the setup.
#Restore the config files
sudo cp /home/tibco/Lab_Files/Solution/LabA/*.conf
/opt/tibco/ems/8.5/samples/config/
Enter password: TIBCO7222
#Start the EMS server
cd /home/tibco/Scripts
./start-ems-server.sh
#Start Admin tool and connect to server
cd /opt/tibco/ems/8.5/bin
tibemsadmin
connect
#Verify group TALKERS and create WATCHERS group
show group TALKERS
create group WATCHERS
#Create users and add them to group
create user observeWOMAN
create user observeMAN
add member WATCHERS observeWOMAN,observeMAN
#Verify users are created
show members TALKERS
show members WATCHERS
#Create topic groups
create topic TOPIC.NEWS.TALK.> secure
create topic TOPIC.NEWS.WATCH.> secure
#Assign admin privileges to CHATWOMAN user
grant admin CHATWOMAN view-all
grant topic TOPIC.NEWS.TALK.> CHATWOMAN create,modify,delete,purge
#Assign admin privileges to CHATMAN user
grant topic TOPIC.NEWS.TALK.> CHATMAN publish,subscribe,durable,view
Test the capabilities of CHATWOMAN.
#Connect admin tool to server as CHATWOMAN user
connect
Login name: CHATWOMAN
Password: CHATWOMAN
#Commands to check capabilities of CHATWOMAN user
show topics
create topic TOPIC.NEWS.TALK.1
addprop topic TOPIC.NEWS.TALK.> store=$sys.failsafe
addprop topic TOPIC.NEWS.WATCH.> store=$sys.failsafe
#Connect admin tool to server as CHATMAN user
connect
Login name: CHATMAN
Password: CHATMAN
#Commands to check capabilities of CHATMAN user
show topics
show topic TOPIC.NEWS.TALK.>
#Grant the protection permissions to the TALKERS group, and assign the
CANTCHATMAN user as the administrator
grant admin TALKERS protect2
grant admin CANTCHATMAN protect2,all
For this exercise, set the server identity using the following digital certificates.
To use an SSL connection with the TIBCO Enterprise Message Service server, a client must
include these JAR files in the CLASSPATH.
#Create a topic
create topic EMS.SSL
Message Selector
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 true. Consumers can request that the server deliver only
those messages that match a selector.
As mentioned in the previous slide, you can optionally specify a message selector for each bridge and route to determine
which messages are sent over that bridge.
Identifiers refer to the values of message headers and properties, but not to the message body. 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 NULL.
String Expressions:
Every selector is a conditional expression. A selector that evaluates to true matches the message; a selector that
evaluates to false or unknown does not match. Three types of expressions are available, naming, Arithmetic,
Conditional, and Order of evaluation.
Message Selector Operators
Logical Operator: Logical operators in precedence order: NOT, AND, OR.
Comparison Operator: =, >, >=, <, <=, <> (not equal).
o These operators can compare only values of comparable types. (Exact numeric values and approximate
numerical values are comparable types.)
o Attempting to compare incomparable types yields false. If either value in a comparison evaluates to
NULL, then the result is unknown (in SQL3-valued logic).
o Comparison of string values is restricted to = and <>.
o Two strings are equal if and only if they contain the same sequence of characters. Comparison of
Boolean values is restricted to= and <>.
Arithmetic Operator: Arithmetic operators in precedence order are +, -, *, and /.
Between operator: Defines a range. This operator includes its endpoints. For example, age between 5 and 9 is
equivalent to >=5 AND age <=9.
String set Membership: The identifier must evaluate to either a string or NULL. If it is NULL, then the value of
this expression is unknown. You can use a maximum of 32,767 string-literalsin the string set.
Pattern Matches: The pattern-value is a string literal, in which some characters bear specialmeaning:
o _ (underscore) can match any single character.
o % (percent) can match any sequence of zero or more characters.
Routing Fundamentals
Enterprise Message Service 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 cannot 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. 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.
Enterprise Message Service stores and forwards messages in most situations to provide operation when a route is
not connected.
Route types:
o An active route is specified in a server’s route configuration file and initiates the connection to the
other, routed server.
o A passive route is not specified in the server’s routes configuration, and the connection is initiated to
that server from a server with an active route.
Because passive routes are not specified in a server’s configuration, route properties cannot be specified or
changed on passive routes. Only active routes have configuration properties.
Zone
With Enterprise Message Service, routes are arranged in zones. A zone is a named set of routes. Every route
belongs to a zone. Zones restrict the behavior of routes, so you can configure complex routing paths.
There are two zone types: one-hop (1-hop) and multi-hop (mhop). Type of a zone affects the forwarding
behavior of its routes, so you can configure complex routing paths.
In a 1-hop zone, messages are restricted to just one hop from an Enterprise Message Service server to its
neighboring Enterprise Message Service server through the 1-hop route. Alternatively, when routes belong to a
multi-hop zone, messages can travel an unlimited number of hops along routes in that multi-hop zone. When
creating multi-hop zone, cycle dependency i.e. parallel routing paths should be avoided.
A single server can support multiple routes, each route belonging to a different zone and zone type. Zones affect
topic messages, but not queue messages. Queue messages always travel only one hop, even within multi-hop
zones.
One-hop zone example shown on the left side of the slide forward messages from both branches to both Finance
and Marketing. When the left route is configured as one hope and the msg is produced on Branch A then it will
reach to only Finance and Marketing as from Branch A, Finance and Marketing are at one hop.
The routing graph seems to contain a cycle: the path from Branch A to Marketing to Branch B to Finance
duplicates the route from Branch A to Finance. However, since these routes belong to the one-hop zone, it is
impossible for messages to travel the longer path. Instead, this limitation results in the desired result, forwarding
from Branch A to Marketing and Finance, and from Branch B to Marketing and Finance.
In the multi-hop zone example, when a client of Japan1 produces a message, it travels one hop to reach Japan
Finance. When the message reaches Japan Finance, it crosses into zone Finance. Japan Finance forwards the
message to Finance, which in turn forwards it to the USA. When the message reaches USA Finance, it crosses
into zone USA (with hop count reset to zero); USA Finance then forwards it one hop to USA1.
Multi-hop
Create Routes
A route can be created from either of the available following options:
To create a route by Administration tool use the following command shown in the slide. Parameters used in the syntax are:
name: Name of the server you wish to route to. It is also the name of the route.
URL: URL for the remote server that includes protocol and port (URL can be a comma-separated list of URLs
for fault-tolerant servers, if fault-tolerance is configured in your environment).
Zone_name: Specifies that the route belongs to the routing zone with this name.
Properties: A space-separated list of connection properties for the route (this is a list of properties for
configuring the Secure Sockets Layer (SSL) protocol for the route).
When a server’s authorization parameter is enabled, other servers that are actively connected to it must
authenticate themselves by name and password. Additionally, 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.
The image on the slide shows an example for authorization between active routes.
o Server X has a queue named myQueue@ServerY defined as a routed queue. The global property is set
for this queue.
o Server Y has a queue named myQueue defined with the global property.
o Server X must have a user named Server Y and Server Y must have a user named Server X.
o A message is sent to Server X, and that message must be routed to the queue on Server Y. For this to
work, the Server Y user created on Server X must have the receive permission. Also, the Server X user
created on Server Y must have the send permission.
#Create topics
create topic source.topic.xx
create topic target.topic.xx
create queue target.queue.xx
Configure Routing
In this exercise, configure routing between two Enterprise Message Service™ servers.
Later create a global topic between EMS-SERVER and EMS-SERVER2, so that message sent on this topic is
routed between the two servers.
To route messages among servers, the destination must be specified as “global”.
Global topics can be routed among any number of servers; global queues, on the other hand, can only be routed
between two servers.
#Commands to create a new folder
cd /opt/tibco/ems/8.5/samples
sudo mkdir config2
password: TIBCO7222
#Copy all the files from config folder to the newly created folder
sudo cp -r /opt/tibco/ems/8.5/samples/config/*
/opt/tibco/ems/8.5/samples/config2
#Change the owner of datastore files in config2 folder
cd /opt/tibco/ems/8.5/samples/config2/datastore
sudo chown tibco:tibco async-msgs.db sync-msgs.db meta.db
#Grant read/write permission to the .conf files
cd /opt/tibco/ems/8.5/samples/config2
sudo chmod a+rwx *.conf
#Commands to open and edit the config file
cd /opt/tibco/ems/8.5/samples/config
sudo gedit tibemsd.conf
password: TIBCO7222
#Commands to open and edit routes.conf file
sudo gedit routes.conf
#Start the server
./start-ems-server.sh
#Commands to open and edit the config file for second server
cd /opt/tibco/ems/8.5/samples/config2
sudo gedit tibemsd.conf
password: TIBCO7222
#Start the second server
cd /opt/tibco/ems/8.5/samples/config2
source ~/.bashrc
/opt/tibco/ems/8.5/bin/tibemsd64 -config tibemsd.conf
#Start administration tool and connect to server as admin user
connect tcp://localhost:7222 (for user name and password press <Enter>)
#Create route
create route EMS-SERVER-2 url=tcp://localhost:7333
#Create a global topic in EMS-SERVER
create topic route.topic1 global
#Create a global topic in EMS-SERVER-2
tibemsadmin
connect tcp://localhost:7333 (for user name and password press <Enter>,
if prompted)
create topic route.topic1 global
# Run consumer client program to test topic-based routing
cd /opt/tibco/ems/8.5/samples/java
source setup.sh
javac *.java
java tibjmsMsgConsumer -server "tcp://7333" -topic route.topic1
#Run producer client program
source setup.sh
javac *.java
java tibjmsMsgProducer -server "tcp://7222" -topic route.topic1
"Hello.This is a message from EMS-SERVER."
Unit 4: Lecture
Message Persistence Modes
JMS messages with PERSISTENT delivery mode are guaranteed to be delivered in case of the provider failure.
TIBCO Enterprise Message Service™ writes these messages into persistent storage only if they are sent to a
queue or to a topic with at least one durable subscriber. The messages sent to topics with no durable subscribers
are stored in memory, eliminating unnecessary I/O.
Hence, there are two message storage modes in Enterprise Message Service: disk-based and memory-based.
For disk-based storage, it is further divided between the options of file-based stores or database stores.
Each has controls to ensure the system is not overwhelmed by the persisted messages.
Enterprise Message Service also offers an additional message store option mstore, designed for systems storing
large numbers of messages who desire fast recovery times in the event of a failover.
Memory-Based Storage
Following are the features of memory-based storage:
In this file, set the max_msg_memory parameter to specify how much EMS memory should be used for
messages. Best practice indicates that the amount of memory allocated should be in the range 20-25% of total
memory used by the EMS server.
Also in tibemsd.conf is the reserve_memory parameter. This parameter comes into play when server memory
resources are fully utilized. When reserve_memory is set to a non-zero value, the EMS server allocates a block of
memory to be utilized in low memory situations to keep the EMSserver from becoming unstable.
The reserve_memory parameter, in conjunction with immediate message consumption or disposal, can be used as
a reactive mechanism to avoid memory-based failures.
Stores.conf File
Stores.conf file defines the locations, either store files, mstore, or a database, where the EMS server will store messages or
metadata. You can configure one or many stores in the stores.conf file.
As discussed earlier, by default, 3 file-based stores are declared: $sys.meta, $sys.nonfailsafe, and $sys.failsafe.
The image in the slide shows the configuration for file store, dbstore and mstore. Configuration parameters for file store
and mstore are as follows:
The type parameter of the store defines whether the messages are persisted to a file, mstore or database table. The
options are file, dbstore, or mstore.
File parameter specifies the filename that is used when creating the store file. The location for this file can be
specified using absolute or relative path names. If no path separators are present, the file will be saved in the
location specified by the store parameter in the tibemsd.conf file. This parameter is required for both file and
mstore types.
The mode parameter is only used with file-based stores and specifies whether messages are persisted using
buffered I/O or raw I/O. The options are async or sync.
File crc parameter specifies whether the EMS server uses CRC to validate data integrity when reading the store
files. It is only used with file store.
Mstore_truncate parameter is used to truncate the mstore files, to give up unused disk space. Scan_iter_interval
determines the span of time between each interval of the store scan. These two parameters are used only with
mstore.
For the database store type, all the four of the parameters shown in the image are required.
Parameter dbstore_driver_url is the connection string of the database,
with dbstore_driver_username and dbstore_driver_password specifying the credentials needed for database select,
insert, update and delete access.
Multiple Store Configuration Example
The slide give details of an example to configure multiple stores. Following configuration is done: Two file-
based stores naming SafeStore and LocalStore are configured and these stores are assigned to the topics and
queues from EMS administrator console as shown in the images on slide.
Note: In tibemsd.conf, the store parameter must point to the parent directory where the store files are located.
Database Implementation
Database implementation requires:
The reason the database store implementation requires a Java Virtual Machine is to federate the EMS Server from the
persistence operations. Should the JVM fail, the failure is localized, allowing the EMS Server to continue messaging
operations.
Configure Database Persistence
Database persistence requires following configuration steps:
After installing the Hibernate Core, the first step in configuring database persistence is to enable Java Virtual
Machine binary in EMS server. This is done by defining jre_library path in tibemsd.conf file.
Next, add following database parameters in tibemsd.conf file:
o dbstore_classpath – paths to the Hibernate, JDBC, and EMS jar files
o dbstore_driver_name – JDBC driver class
o dbstore_driver_dialect – Hibernate SQL version for your database
Then setup and configure stores in the stores.conf file.
Associate your destination with the new database store in topics.conf and queue.conf files by using the following
command:
o addprop destination destination_name store=store_name
Finally, export the database tables using the tibemsd_util.jar program available in the bin folder.
EMS Message Persistence Benefits
Benefits of TIBCO Enterprise Message Service message persistence are:
Unit 5: Lecture
Shared State
Shared state consists information about all the persistent messages for queues and topics, client connections and
metadata related to data delivery.
During normal operation of the primary server, all persisted messages are stored then delivered. During a
failover, all shared state information that exists is retrieved by the backup server.
Shared state can be implemented by shared storage or through other means such as replication. The shared state
must be accessible to both the primary and backup servers.
To prevent the backup server from assuming the role of the primary server unnecessarily, 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 a lock on the shared state.
Storage Files
In tibemsd.conf, the store parameter points to the parent directory where the store files are located.
The EMS server defines three default store files to write the persistent messages and meta data:
meta.db - information about durable subscribers, fault-tolerant connections and other metadata are stored in this
file
sync.db - messages for failsafe destinations are stored in this file
async.db - messages for non-failsafe destinations are stored in this file
Server: This parameter should be same for both primary and secondary servers.
ft_active: When the backup server starts, it attempts to connect to the primary server. If the connection can be
established, the backup server enters standby mode for the primary. If the connection cannot be established, the
backup server becomes the primary server. The primary server should set the ft_active parameter to the URL of
the backup server. This allows the primary and backup servers to exchange roles in the event of a failure.
ft_reconnect_timeout: When the primary server goes down and the backup server assumes the role of the primary
server during failover, all of the client connections can reconnect to the backup server and continue with
processing their current message state. The backup server reads the clients’ state from the shared state, and the
server can be configured to clean up any state information for clients that have not reconnected after a certain
period of time. The default value of this parameter is 60.
SSL parameters: The fault tolerance parameters that begin with the prefix ft_ssl are used to secure
communications between pairs of fault tolerant servers. Few examples of ft_ssl parameters are ft_ssl_identity,
ft_ssl_private_key, ft_ssl_password, etc.
Detect Failover
The primary and backup servers detect failures of either server in two ways:
Loss of the connection between the servers (for example, the socket for the fault-tolerant connection is
terminated).
The primary and backup servers exchange heartbeats to indicate both are still operating. If there is a loss of
connectivity (for example, network failures that do not close the connection), the length of time between
heartbeats can be used to detect failures.
ft_heartbeat: This parameter specifies the time interval at which the server have to send aheartbeat signal to its
peer to indicate that it is still operating. Default value for this parameter is 3 seconds.
ft_activation: This parameter indicates the maximum amount of time between heartbeat signals which indicates
that server has failed.
Connection load balancing allows a client to connect to the least busy server in the "cluster" of EMS servers that
have routed visibility to the same destination.
EMS supports a mechanism for message processing load balancing. For non-exclusive queues, multiple
consumers can process messages in a round robin fashion.
o Each message is only processed by one EMS consumer. If you have routed queues setup, you can do
both load balanced connections and load balanced processing of messages, both of which will solve
different performance issues.
EMS load balanced connections are configured using routes and connection factories in the EMS servers. No hardware or
application software need to be modified.
Open a new terminal and enter the command as shown or copy it from the code snippet to restore the original
configuration files to config directory
Close the terminal window
Edit the main tibemsd.conf file to enable routing
o Open a new terminal and enter the commands as shown or copy them from code snippet
o Update the parameters server and routing
o Save and close the file
Next, edit the route configuration file
o In the same terminal, enter the commands as shown or copy them from code snippet
o Add the parameters as shown at the end of the file
o [EMS-SERVER2] (should be there by default)
o url = tcp://7144 (change the default port number)
o zone_name = default_mhop_zone
o zone_type = mhop
o Save and close the file
Now, edit the factories.conf file
o In the same terminal, enter the commands as shown or copy them from code snippet
o Add the parameters as shown at the end of the file
o [LBTopicConnectionFactory]
o url = tcp://7222|tcp://7144
o metric = connections
o [LBQueueConnectionFactory]
o url = tcp://7222|tcp://7144
o metric = connections
o Save and close the file
#2
Configure Backup Server for Load Balancing
Play Video
Create a directory for the data storage files of the load balanced server
o In the same terminal, enter the commands as shown or copy them from code snippet
o Enter the commands as shown to change the owner of the datastore-2 folder
Next, copy datastore files from original datastore directory to datastore-2 directory
o In the same terminal, enter the commands as shown or copy them from code snippet
o Enter the commands as shown to change the owner of the datastore files in datastore-2 folder
o Use file browser and navigate to /opt/tibco/ems/8.5/samples/config/LB/datastore-2
o Verify the datastore files are copied
Now, copy configuration files from config folder to LB folder
o In the same terminal, enter the commands as shown or copy them from code snippet
o Enter the commands as shown or copy them from code snippet to grant read/write permission to the
conf files
#3
Update Configuration Files for Backup Server
Play Video
During the message transfer, verify that both the PRIMARY and SECONDARY servers are sharing the load supporting
several JMS topic publishers.
START
#1
Start the two Load Balanced Servers
Play Video
Open a new terminal, name it as Primary Server, and enter the commands as shown or copy them from the code
snippet to start the primary server
Open another terminal tab and name it as Secondary Server
o
o Enter the commands as shown or copy them from the code snippet to start secondary server
o Verify that both servers are active
o Note that the Secondary server acknowledges accepting the route from the Primary, and the Primary
reports it is connected to the Secondary
#2
Launch the Admin Tool and Multiple JMS Topic
Publishers
Play Video
Open a new terminal window and run the commands as shown or copy them from the code snippet
Several terminals open; the front two are the Admin tools for their respective servers
o Press <Enter> in each Admin tool terminal to connect
There are six tibjmsMsg Producer repeatedly sending messages
o Their (client) connections are distributed between the two servers; three are handled by the primary
server (7222) and the other three by the secondary server (7144)
Note that each topic publisher will send 99 messages. After that rerun the clients to continue testing
#3
Verify Client Connection Load Balancing Between the
two Servers
Play Video
Go to the terminal titled Primary Admin: 7222 and issue the command show connections
Go to the terminal titled Secondary Admin: 7144 and issue the command show connections
Observe some clients are connected to the primary server, while others are connected to the secondary server
because they are being load balanced
Analysis: The Enterprise Message Service server uses one of the two metric options for load balancing. By
default, it uses connections i.e. connect to the server with the fewest client connections. The alternative is
byte_rate i.e. connect to the server with the lowest byte rate. Byte rate includes both inbound and outbound data.
Shutdown the servers (<Ctrl+c>) and close all the terminals when done with exploring
Open a new terminal window and enter the commands as shown or copy them from code snippet to save the
updated config files
o Close the terminal
This completes the exercise
Code Snippets
#Start the primary server
cd /home/tibco/Scripts
./start-ems-server.sh
Trace messages and server activities: These are written to a log file or the console
Server events: Published as messages
Server statistics: Administration tool command
TIBCO Hawk: Built-in Hawk microagent
This data is be sent to the console or logged to a file, or both. Tracing is configured in the following ways:
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, specify the trace property to enable the generation of trace messages.
For individual messages, the JMS_TIBCO_MSG_TRACE property specifies that tracing should be performed
for this message, regardless of the destination settings.
Message trace entries can be output to either the console or the log.
The JMS_TIBCO_MSG_TRACE property set for a message specifies that trace entries are generated for the message as it
is processed, regardless of whether the trace property is set for any destinations the message passes through. Trace
messages are generated for the message when it is sent by the producer and when it is received by the consumer.
Configure the Log File
The log file is specified in tibemsd.conf file. Following parameters are configured in the file:
The logfile configuration parameter in tibemsd.conf controls the location and the name of the log file.
You can specify that the log file should be backed up and emptied after it reaches a maximum size. This allows
you to rotate the log file and ensure that the log file does not grow boundlessly. The logfile_max_size
configuration parameter allows to specify the maximum size of the current log file. Set the parameter to 0 to
specify no limit. Use KB, MB, or GB unit.
Once the log file reaches its maximum size, it is copied to a file with the same name as the current log file except
a sequence number is appended to the name of the backup file, for example, server.log.1, server.log.2, etc.
Logfile_max_count parameter specifies the maximum number of log files to keep, including the current log file.
You can also dynamically force the log file to be backed up and truncated using the rotatelog command in tibemsadmin.
Server Events
The TIBCO Enterprise Message Service server can publish topic messages for several system events.
For example, the server can publish a message when users connect or disconnect.
System event messages contain details about the event stored in properties of the message.
Monitor topics are created and maintained by the server. These topics are not listed in the topics.conf file and
users cannot create them.
Following are the features of system monitor topics:
They contain sensitive internal system information.
Authentication and permissions are always needed for clients to access a monitor topic.
Topic subscribers can use message selectors to filter the monitor messages so that application receives
only the messages it is interested in.
All system event topic names begin with $sys.monitor. The remainder of the name is the event class followed by
the event.
For example, the server publishes a message to the topic $sys.monitor.connection.disconnect whenever
a client disconnects from the server. The rest of the name is the event class followed by the event.
Note that server only generates messages for monitor topics that currently have subscribers. Generating monitor
topic message consumes system resources.
System performance is affected by the number of subscribers for monitor topics as well as the
frequency of messages for those topics.
For production systems, monitoring all events may have an adverse effect on system performance.
Subscriptions to monitor topics in production systems should always be limited to specific monitor
topics or wildcard subscriptions to specific classes of monitor topics that are required.
Using message selectors to limit monitor messages can improve performance slightly.
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.
All these parameters are set either in configuration file or dynamically with set server admin command.
Display Detailed Statistics
When statistics collection is enabled, you can view statistics for producers, consumers, routes, and destinations
using the show stat command in the administration tool.
The show stat command allows you to filter the statistics based on destination name, username, connection ID,
or any combination of criteria. Statistics for consumers, producers, destinations or routes can be viewed. Show
stat command options are shown in the slide.
You can optionally specify the ‘total’ keyword to retrieve only the total statistics i.e., total number of messages
and total message size (this suppresses the detailed output). The ‘wide’ keyword is used 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 image in the slide shows an example of consumer statistics.
show db: Summarizes the usage of just async-msgs.db, sync-msgs.db, or both, if you omit the parameter. The
image shown in the slide displays the console output for show db command.
show stores: Lists the persistent stores in use.
show store store-name: Shows the details of a specific store. This command is used to get details about either
file-based store or database store.
In this exercise, explore the Enterprise Message Service™ monitoring utility tibemsmonitor that is provided with the
TIBCO Enterprise Message Service™ product.
Note that this utility is not designed for use in a production environment.
START
#1
Start the Monitoring Tool as Admin User
Play Video
Open a new terminal and enter the command as shown or copy it from the code snippet to restore the original
configuration files to config directory
o Close the terminal window
Open a new terminal, name it as EMS Server, and enter the commands as shown or copy them from code
snippet to start the server
Open a new terminal, name it as Monitoring and issue the command as shown to view help information for
tibemsmonitoring utility
o The utility’s help screen is displayed, providing the syntax and parameter descriptions for monitoring
server activities
Now, from the same terminal, enter the command as shown or copy it from the code snippet to start the
monitoring tool
o When prompted for the password, press <Enter>
o Note that no password is required
o If the tool is not connected, ensure that the command entered is correct, and the server is running
#2
Perform Activities in the Admin Tool and Observe
Tracing Messages in Monitoring Tool
Play Video
#Start the Admin tool and connect to server as the admin user
cd /$EMS_HOME/bin
tibemsadmin
connect (press <Enter> for Login name and Password)
From the terminal named Admin enter the command as shown or copy it from code snippet to create a new user
From the Adminterminal, type the command show config
o Under the # settings heading, verify the line: authorization = disabled
o If it is enabled, then disable it using the command set server authorization=disabled
From the terminal named Monitoring, disconnect tibemsmonitor as admin user (use <Ctrl+c>) and start it again
as labuser using the command shown
o If prompted for a password, press <Enter>
o The exception error as shown should be received
#2
Monitor System Events using Monitoring Tool
Play Video
From Admin tool, type the command as shown or copy it from code snippet to grant subscription for a topic to
the labuser
Start tibemsmonitor using the command as shown
o This time you should be able to successfully monitor all system events while logged in
to tibemsmonitor as labuser
From Admin tool, enter the command create queue myqueue to create a new queue
o Observe output in monitoring tool
Close the monitoring terminal
This completes the exercise
Code Snippets
#Create a new user
create user labuser
#Create a queue
create queue myqueue
Lab F Exercise 3
View Server Statistics
Play Video
In this exercise, view the server statistics using the Administration tool.
START
#1
Set Statistics Parameters
Play Video
Use the Administration tool to verify that the statistics parameter is enabled
o From the terminal named Admin, enter the command show config
o Under the statistics settings heading, verify the line: statistics = enabled
o Note that the statistics parameter allows to globally enable and disable statistics gathering.
From the same terminal, enter the commands as shown or copy from code snippet to create three topics
Next, enter the command as shown or copy it from code snippet to set the detailed statistics for the consumer
object
o Note that this command enables the detailed statistics for topic subscribers with wildcard topic names
#2
Run the Producer Client
Play Video
#3
Run the Consumer Client
Play Video
Code Snippets
#Create three new users
create topic stats.topic1
create topic stats.topic2
create topic stats.topic3
#run the producer three times to produce messages for all three topics created
java tibjmsMsgProducerPerf -topic stats.topic1
java tibjmsMsgProducerPerf -topic stats.topic2
java tibjmsMsgProducerPerf -topic stats.topic3
Working directory: Stores the last configuration retrieved from the EMS Server. It also stores lock file if the
configuration is currently being edited via Web Interface.
Deployment directory: Contains the details of each configuration that has been previously deployed to the EMS
Server.
Commands issued through the Central Administration web interface modifies the configuration files in these two
directories. Image in the slide shows the configuration information flow for each action performed through web interface.
Lock & Edit enables the user to edit the configuration, and the edits are saved in the lock file stored in working
directory.
Save action saves configuration changes made to the EMS server through the web interface to the lock file.
Deploy action takes the configuration lock file from the working directory, and deploys it to the EMS server. If
the deployment succeeds, the lock file is copied to the deployment directory for the current deployment and to
the working file for the EMS server.
Refresh action retrieves the currently deployed configuration file from the running EMS server, and save that
file in the working directory.
If SSL is configured, all Enterprise Message Service servers managed by the same Central Administration server must
use the same configuration scenario. There are two supported configuration scenarios:
No parameters are set in the Central Administration Server (EMS Server does not require an identity certificate
from the Central Administration Server)
Central Administration Server is configured to supply identity certificate/password (EMS Server requires an
identity certificate)
.
Server List page: It is the home page of the web interface. It displays the complete list of Enterprise Message
Service servers managed by the Central Administration server.
Server Overview page: This page is a gateway to all server configuration options. Contains set of links to the
properties pages, organized by following categories: Destinations, Connections, Server and Security.
Deployments page: Provide details about every deployment executed from Central Administration server. From
this page you can revert to earlier deployment or delete a deployment history if needed.
Property page: Each property page contains configuration details for a specific property type.
Following command icons are available in the upper right corner of the web interface:
Lock & Edit - Creates a modifiable copy of the configuration file, and stores it in the working directory. The
configuration file is locked so that only the current user can modify the file.
Deploy - Deploys all the modified server configurations. Saves the modified configuration files of all the EMS
servers locked by the user to the working directory and packages them as a deployment. Then it sends the
deployment package to EMS servers and releases the locks upon successful deployment.
Revert - Reverts all the modifications, stops editing, and releases all the locks.
Refresh - Discards all the modification and retrieve the current configuration file from the Enterprise Message
Service server.
Save - Saves modifications to the working directory. Central Administration frequently auto-saves modifications
to the working directory. This command forces a save.
Download - Downloads the server’s JSON configuration file.
Manipulating icons available in web interface are: Add, Delete, View, Duplicate, and Undo.
Deploy Configuration
Deploy action deploys the every EMS server locked by the current user. Once the deploy command is given, the Central
Administration performs the following actions:
Deploys the working copy of the JSON configuration file to the EMS server
Updates the deployment archive with the new configuration
Releases the lock on the EMS server and displays the deployments page
Deployment fails if there are any errors while connecting to and updating the EMS Server. If the failed deployment
involved multiple EMS servers and some deploy correctly while others fail, servers that did not deploy can attempt
redeployment later. The server lock file remains in its edited state.
You can use the option --keep-max-deployments to configure how many deployments to keep in your EMS Central
Administration server. When the maximum deployment is reached, the older configurations are removed.
Redeploy and Refresh
Redeploy reverts all EMS servers deployed in the selected deployment. EMS servers that failed in the original
deployment are excluded from the redeployment.
Redeploying updates the EMS server but does not affect the working directory or the lock file. As a result, the
working copy and lock files in Central Administration are out of sync with the running EMS server. To obtain
the current configuration, refresh the EMS server configuration.
Refresh obtains the current configuration from the EMS server. If changes have been made to the EMS server
configuration using the Administration Tool, API calls, or by directly editing the configuration file, the Central
Administration server must be refreshed to retrieve these changes from the server
In this exercise, explore the Enterprise Message Service™ monitoring utility tibemsmonitor that
is provided with the TIBCO Enterprise Message Service™ product.
Note that this utility is not designed for use in a production environment.
In this exercise, explore the Enterprise Message Service™ monitoring utility tibemsmonitor that is provided with the
TIBCO Enterprise Message Service™ product.
Note that this utility is not designed for use in a production environment.
START
#1
Start the Monitoring Tool as Admin User
Play Video
Open a new terminal and enter the command as shown or copy it from the code snippet to restore the original
configuration files to config directory
o Close the terminal window
Open a new terminal, name it as EMS Server, and enter the commands as shown or copy them from code
snippet to start the server
Open a new terminal, name it as Monitoring and issue the command as shown to view help information for
tibemsmonitoring utility
o The utility’s help screen is displayed, providing the syntax and parameter descriptions for monitoring
server activities
Now, from the same terminal, enter the command as shown or copy it from the code snippet to start the
monitoring tool
o When prompted for the password, press <Enter>
o Note that no password is required
o If the tool is not connected, ensure that the command entered is correct, and the server is running
#2
Perform Activities in the Admin Tool and Observe
Tracing Messages in Monitoring Tool
Play Video
Code Snippets
#Restore the original configuration files to config directory
sudo cp /home/tibco/Lab_Files/Original/*.conf
/opt/tibco/ems/8.5/samples/config/
Enter password: TIBCO7222
#Start the Admin tool and connect to server as the admin user
cd /$EMS_HOME/bin
tibemsadmin
connect (press <Enter> for Login name and Password)
From the terminal named Admin enter the command as shown or copy it from code snippet to create a new user
From the Adminterminal, type the command show config
o Under the # settings heading, verify the line: authorization = disabled
o If it is enabled, then disable it using the command set server authorization=disabled
From the terminal named Monitoring, disconnect tibemsmonitor as admin user (use <Ctrl+c>) and start it again
as labuser using the command shown
o If prompted for a password, press <Enter>
o The exception error as shown should be received
#2
Monitor System Events using Monitoring Tool
Play Video
From Admin tool, type the command as shown or copy it from code snippet to grant subscription for a topic to
the labuser
Start tibemsmonitor using the command as shown
o This time you should be able to successfully monitor all system events while logged in
to tibemsmonitor as labuser
From Admin tool, enter the command create queue myqueue to create a new queue
o Observe output in monitoring tool
Close the monitoring terminal
This completes the exercise
2
Code Snippets
#Create a new user
create user labuser
#Create a queue
create queue myqueue
Lab F Exercise 3
View Server Statistics
Play Video
In this exercise, view the server statistics using the Administration tool.
START
#1
Set Statistics Parameters
Play Video
Use the Administration tool to verify that the statistics parameter is enabled
o From the terminal named Admin, enter the command show config
o Under the statistics settings heading, verify the line: statistics = enabled
o Note that the statistics parameter allows to globally enable and disable statistics gathering.
From the same terminal, enter the commands as shown or copy from code snippet to create three topics
Next, enter the command as shown or copy it from code snippet to set the detailed statistics for the consumer
object
o Note that this command enables the detailed statistics for topic subscribers with wildcard topic names
#2
Run the Producer Client
Play Video
#3
Run the Consumer Client
Play Video
#4
View Overall Server Statistics
Play Video
Code Snippets
#Create three new users
create topic stats.topic1
create topic stats.topic2
create topic stats.topic3
#run the producer three times to produce messages for all three topics created
java tibjmsMsgProducerPerf -topic stats.topic1
java tibjmsMsgProducerPerf -topic stats.topic2
java tibjmsMsgProducerPerf -topic stats.topic3
Realm Service: A realm is a namespace that defines resources and configurations available to application
programs.
o The realm service maintains the realm definition, distributes it to clients, and collates operating metrics
from clients.
o Every FTL client uses realm service to load metadata at startup. This service distributes to each client a
version of the realm definition that is tailored for that specific client.
o The client process stores this tailored realm definition in a realm object. Client applications and services
send their operating metrics to the realm service.
Authentication Service: The realm service can authenticate users against a separate authentication service or an
internal authentication service.
Transport Bridge Service: Bridge service forward messages between two endpoints.
Persistence Service: Persistence services store messages for durable subscribers.
eFTL Service: eFTL services forward messages between eFTL clients and FTL clients.
-h: The FTL server prints a usage message summarizing its command line parameters.
-c: Specifies the configuration file path. The FTL server reads the configuration file at the given path.
-n: This parameter designates the name of the FTL server and selects one of the core servers.
--init-security: The FTL server uses the password_specifier argument to secure the keystore file. When present,
the FTL server generates new TLS data, and then immediately exits.
--init-auth-only: The FTL server generates new authentication data, and then immediately exits. If the FTL server
detects existing authentication files, it does not generate a new one. However, the server does not decrypt or
inspect existing files.
Globals section contain values that are mandatory and directly affect the operation of the FTLservers. The
globals section can contain any of the following items:
o Key/value pairs that directly affect the operation of FTL servers.
o Key/value pairs that all applicable services can inherit. You can override these values in service
sections, or in the individual service sections within any server section.
Services section is optional and this section contains a section for each type of service (for example, realm,
persistence, bridge, eFTL). It can also contain an FTL section with parameters that apply to the FTL server as a
whole, but are not inherited by other services or servers. Within each service section, you can specify key/value
pairs that apply through inheritance to all instances of a service in any FTL server. These values override values
inherited from the globals section. Specifying a service section does not imply that every FTL server provides
that service.
The servers section contains a map of the FTL servers you are configuring. Each item in the map pairs a server
name with a list of services that the server provides. The map must contain an item configuring each core server,
and may also include optional items configuring auxiliary servers. For each server, you need to configure a list of
services that server provides. An FTL server provides a service if and only if the service is configured at this
level. Within each server section, you may override key/value pairs inherited from the global section or a global
service section. You can omit the servers section, if the configuration file specifies only one core server, and
specifies its extended server name with host and port.
Configuration Parameters
The table in the slide enlists few of the configuration parameters in the globals and services section in the
configuration file.
Spare some time and go through the table.
For other parameters, refer TIBCO FTL Administration guide.
1x
Playback Rate
Picture-in-PictureFullscreen
Mute
In this exercise, configure the TIBCO FTL server using yaml configuration file and run the FTL server using the same
configuration.
START
#1
Configure FTL Server using YAML Configuration File
Play Video
Create folder to store FTL server data
o Open a new terminal window and name its title as FTL Server
o Enter the commands as shown or copy from code snippet to create data folder
Next, configure FTL server using YAML configuration file
o From the same terminal, enter the command as shown or copy from code snippet to open and edit the
configuration file
Configuration file opens in text editor
o Verify the following default configurations:
o Globals section: 3 core servers
o Services section: realm and data location
o Servers section: All 3 servers with default realm and eftl service
o Edit the configuration file as shown
o Delete or comment the configurations for ftlserver2 and ftlserver3 from globals and servers
section
o Enter the path for data parameter (The FTL server stores its working data files in this path location.
Ensure that this folder is present at the given path, if not create the folder.)
o Save and close the file
Note that YAML coding is very sensitive to spaces and indentation
Therefore, correctly indent, use spaces and new lines to avoid any errors while making any entries in the YAML
files
#2
Start the FTL Server and Access it Using a Browser
Play Video
From the same terminal, enter the commands as shown or copy from code snippet to start the FTL server
o This command starts the FTL server process and its configured services
o You can minimize the terminal window, but do not close it
Now, access FTL server using a browser window and view application loaded by default
o Open Firefox Browser
o Enter the FTL server URL
o Click SIGN IN with User Id anyone
o Verify Applications tab is displayed with the default application as shown
3
4
#3
Start a New Receiver Client Application
Play Video
#4
Send Messages and Verify the Messages are Received
Play Video
Open a new tab in the Receive Messages terminal and name it as Send Messages
Examine the options for the message sender program as shown
Run the sender program with the updated application and endpoint names as shown
Go back to Receive Messages terminal and observe the client received the message
Both the programs are terminated after one message
Analysis: This shows that the application definition in the FTL server can be used by a properly configured
client program. The client program locates the definition of the application and sends and receives messages
using the transports and endpoints defined for that application. Application definition (metadata) and clients are
truly decoupled.
Open a new terminal and enter the commands as shown or copy from the code snippet to stop the FTL server
Close all the terminals and Firefox browser window
Open a new terminal and enter the command as shown or copy from the code snippet to take backup of the
configuration file
o Close the terminal window
This completes the exercise
1
2
Code Snippets
#create data folder
cd /opt/tibco/ftl/6.4/samples/yaml/eftl
sudo mkdir data
password: TIBCO7222
From the same terminal, enter the commands as shown or copy from code snippet to start the FTL server
o This command starts the FTL server process and its configured services
o You can minimize the terminal window, but do not close it
Now, access FTL server using a browser window and view application loaded by default
o Open Firefox Browser
o Enter the FTL server URL
o Click SIGN IN with User Id anyone
o Verify Applications tab is displayed with the default application as shown
#3
Start a New Receiver Client Application
Play Video
#4
Send Messages and Verify the Messages are Received
Play Video
Open a new tab in the Receive Messages terminal and name it as Send Messages
Examine the options for the message sender program as shown
Run the sender program with the updated application and endpoint names as shown
Go back to Receive Messages terminal and observe the client received the message
Both the programs are terminated after one message
Analysis: This shows that the application definition in the FTL server can be used by a properly configured
client program. The client program locates the definition of the application and sends and receives messages
using the transports and endpoints defined for that application. Application definition (metadata) and clients are
truly decoupled.
Open a new terminal and enter the commands as shown or copy from the code snippet to stop the FTL server
Close all the terminals and Firefox browser window
Open a new terminal and enter the command as shown or copy from the code snippet to take backup of the
configuration file
o Close the terminal window
This completes the exercise
Code Snippets
#create data folder
cd /opt/tibco/ftl/6.4/samples/yaml/eftl
sudo mkdir data
password: TIBCO7222
#4
Send Messages and Verify the Messages are Received
Play Video
Open a new tab in the Receive Messages terminal and name it as Send Messages
Examine the options for the message sender program as shown
Run the sender program with the updated application and endpoint names as shown
Go back to Receive Messages terminal and observe the client received the message
Both the programs are terminated after one message
Analysis: This shows that the application definition in the FTL server can be used by a properly configured
client program. The client program locates the definition of the application and sends and receives messages
using the transports and endpoints defined for that application. Application definition (metadata) and clients are
truly decoupled.
Open a new terminal and enter the commands as shown or copy from the code snippet to stop the FTL server
Close all the terminals and Firefox browser window
Open a new terminal and enter the command as shown or copy from the code snippet to take backup of the
configuration file
o Close the terminal window
This completes the exercise
Code Snippets
#create data folder
cd /opt/tibco/ftl/6.4/samples/yaml/eftl
sudo mkdir data
password: TIBCO7222
Unit 9: Lecture
Applications and Transports
Update a Realm
To make any configuration changes the administrator needs to lock the realm to edit. The default mode is
unlocked, so a novice user can browse through the settings without any impact on the configuration.
Once the realm is locked changes can be made. A realm is locked and a workspace is created. Administrators
make changes in this workspace and then decide if they want to deploy changes or discard them.
Changes are not activated until the administrator deploys the changes. The administrator can save, discard, revert
or deploy the changes that have been made.
The deployment history shows all the deployments that have been made to the realm. You can roll back to a
point of time of last or earlier deployments if needed, and that is why it is important to do each deployment with
the right name and description.
Transports
Transports represent a physical connection configuration for communication. Messages travel from publishers to
subscribers over transports. The publishers and subscribers on a transport all use the transport in common as a shared
communication medium. The supported transport types are:
Dynamic TCP Transport: Decouples transport definitions from hosts and ports.
Static TCP Transport: Communicates over a set of dedicated connections.
Multicast Transport (mcast): Carries a reliable multicast communication among endpoints on many host
computers. Multicast transports are efficient for high fan-out communication across a LAN. It uses a negative
acknowledgement protocol for reliable message transfer.
Process Transport (PROC): For endpoints within a single program process. Process transports communicate at
high speeds and exhibit very low latency.
Shared Memory Transport: Endpoints in programs that run on the same host computer. Shared memory
transports communicate at high speeds and exhibit very low latency.
Direct Shared Memory Transport: Like shared memory transports, with some additional restrictions. They
communicate at high speeds and exhibit extremely low latency.
Reliable UDP Transport (RUDP): Carries reliable communication over a set of dedicated connections.
Endpoints on an RUDP bus exchange UDP datagrams. Uses a positive acknowledgment protocol.
Remote Direct Memory Access Transport (RDMA): Network adapters can move data directly from memory
in one computer to memory in another computer across a network.
Unitary: Transports use the same transport definition to establish a bus. Definitions of dynamic
TCP mesh transports, shared memory transports, and process transports are inherently unitary.
Fragmentary: Transports use at least two different transport definitions, which cooperate to
establish a bus. Definitions of static TCP, dynamic TCP listen/connect pairs, RDMA, and
Reliable UDP transports are inherently fragmentary. Dynamic TCP transport supports both
patterns:
Define Transports
Use FTL server GUI to define transport. The name, description and transport type parameters of a transport are
mandatory fields.
The details for a transport being configured depends on the transport type selected. For example, if you select
TCP, you see the hostname and TCP port settings window.
You can also specify the abilities that the transport carries for the endpoint. Available abilities are Receive, Send,
Receive Inbox, and Send Inbox. At least one ability for each transport must be enabled
You can define your own applications, endpoints and transports to be used with tiblatsend and tiblatrecv.
Furthermore, you can vary the message count and get results for a smaller test set.
Request/Reply Messaging
The tiblatsend sends a ping message and the tiblatrecv replies back with a pong message. These messages are
not visible to the user, as the focus is on sending plenty of messages (5 million is the default setting) to test
latency.
Latency is the time between the request and response.
The tiblatsend program sends 5 million messages and calculates the total latency for all messages, and displays
the numbers at the end of the run. The tiblatrecv program does not display messages. If the tiblatsend program
does not end, it indicates that it did not connect to the receiver and did not receive any pong replies.
Unit 9: Lab
Lab I Exercise 1
Implement Reliable UDP Transport
Play Video
In this exercise, define a Reliable UDP transport and create an application for it from TIBCO FTL server UI.
Later deploy the configuration and test the performance of RUDP transport.
START
#1
Start the FTL Server and Access using a Browser
Play Video
Open a new terminal and enter the command as shown or copy it from the code snippet to restore the original
configuration files
Close the terminal window
Next, start the FTL server
o Open a new terminal and name it as FTL Server
o Enter the commands as shown or copy from the code snippet to start the server
Now, access FTL server using a browser window
o Minimize the terminal window
o Open Firefox Browser
o Enter the FTL server URL (http://localhost:8585)
o Click SIGN IN with User Id anyone
#2
Define RUDP Transports
Play Video
#3
Define an Application and Deploy the Changes
Play Video
From FTL server UI, select Applications tab and click + to add a new application
Enter the details for the following parameters as shown:
o Name: udp-app
o Endpoint: listen-ep
o Transport: rudplisten
Add another endpoint to the udp-app application
o Click ellipsis (...) sign above the udp-app name and select Add Endpoint option
o Enter the following parameter details as shown
o Endpoint: connect-ep
o Cluster: ftl.default.cluster
o Store: ftl.nonpersistent.store
o Durable Template: ftl.pubsub.template
o Transport: rudpconnect
Now, validate and deploy the changes
o Click Validation Results tab under Validation menu and verify that there are no errors
o Click Deploy option at the top right of the window
o In the Deploy dialog, enter the Name
o Click Test and then click Deploy
o The deployment summary screen is displayed
o Verify that the deployment is successful and then click Done
After the deployment, if the FTL server stays in edit mode, turn edit mode to off and discard changes before
continuing
#4
Send and Receive Messages
Play Video
In this exercise, define a multicast transport and an application for it from TIBCO FTL server UI.
#1
Define a New Multicast Transport
Play Video
#2
Define a New Application that uses the Multicast
Transport
Play Video
#3
Send and Receive Messages using the mcast-app
Definition
Play Video
Go to the terminal named Receive Messages and run the command as shown to start the receiver program
Go to the terminal window named Send Messages and enter the command as shown or copy from the code
snippet to start the sender program
o The program sends 1000 messages and quits as shown
Observe the Total time required to send 1000 messages using multicast transport
Open a new terminal and enter the commands as shown or copy from the code snippet to stop the FTL server
Close all the terminals and Firefox browser window
Lastly, open a new terminal and enter the command as shown to take backup of the configuration file
Close the terminal window
This completes the exercise
Code Snippets
#Start receiver program
./tiblatrecv -a mcast-app -et common-ep -er common-ep http://localhost:8585
Features
Following are the features of transport bridge:
A transport bridge operates within a single realm. It means that messages cannot be forwarded between two
realms using a transport bridge.
A transport bridge provides a low latency alternative to forwarding messages as compared to another FTL client.
Transports can be of the same type, or they can be of different transport protocols. For example, you can bridge
between shared memory and RDMA transports.
A transport bridge only supports bi-directional non-blocking transports. For example, a bridge cannot support a
multicast transport configured with a send group but without a listen group, nor vice versa.
You can define multiple transport bridges, but make sure that the bridges do not end up creating a loop as
transport bridge does not support loop configuration. Transport bridges can forward one-to-many messages and
one-to-one messages. Transport bridges support one-to-one messages on transports that support inbox abilities.
Topologies
Transport bridge supports three topologies.
One Bridge: The most common topology is to bridge two transports using a bridge. These transports can be on
the same host or different hosts.
Serial Bridge: Serial bridge topology is useful for bridging shared memory transports on different hosts. Shared
Memory messages are restricted to the same host. This requires two bridges, the first bridge is between Shared
Memory and RDMA transports on the first host. The second bridge is between RDMA and Shared Memory
transports on the second host to consume the messages. Since RDMA goes across hosts, this is a logical solution.
The third topology is explained in the next slide.
Topologies
Hub-and-Spoke bridge topology is useful to connect partner enterprises, specially at remote sites.
In this topology, you can use multiple transport bridges as shown above.
On the “hub” side, a single transport (in one set) forwards messages to multiple transports (in another set).
Each “spoke” has a transport bridge to have one-to-one forwarding from one transport. So all Static TCP
messages may be forwarded to TCP, all Dynamic TCP messages may be forwarded to UDP and so on.
Messages can be further restricted by using content matchers. The partner enterprises (spokes) share data with
main enterprise (hub), but the partner enterprise must not share data with each other.
To extend this topology, you can add transport sets, or add transports to the transport sets.
You may also extend this topology by adding more spokes, each consisting of a spoke bus, a spoke bridge, and a
local bus.
You cannot extend this topology by adding a third serial bridge, neither to the main enterprise hub bus, nor to
any local spoke bus.
Also, this topology cannot be extended by adding a second branching spoke bridge to any transport in the
transport set.
Bridge Service
Transport bridge services are defined in the FTL server configuration file.
Bridge services implement the transport bridges that are defined in the realm definition. Any FTL server can
provide and manage a bridge service.
Each bridge service can implement one or more bridge objects as defined in the realm definition. These bridge
objects are independent. Even though one bridge service could implement several bridge objects, messages do
not cross from one bridge to another bridge.
When the bridge definitions or the transport definitions are modified or updated, the FTL server automatically
restarts the affected bridge services that implement those bridge objects.
Open a new terminal window and name its title as FTL Server
Enter the command as shown or copy from code snippet to create a new folder named data
From the same terminal, enter the command as shown or copy from the code snippet to open and edit the
configuration file
o Edit the configuration file as shown
o Delete or comment the configurations for ftlserver2 and ftlserver3 from globals and servers section
o Enter the path for data parameter
o The FTL server stores its working data files in this path location
o Change the bridge name brdg to SHM-DTCP from servers section
Save and close the file
#2
Start the FTL Server and Access it using a Browser
Window
Play Video
From the same terminal, enter the commands as shown or copy from the code snippet to start the FTL server
o Observe that FTL server starts but with a warning _Bridge_SHM-DTCP does not exist
Note: The warning indicates that the bridge name defined in the configuration file does not exist in the realm
data. Once the bridge with defined name is created in the FTL server UI, this warning is removed.
Now, access FTL server using a browser window
o Open Firefox Browser
o Enter the FTL server URL
o Click SIGN IN with User Id anyone
From the FTL server UI, set Edit Mode to On
Click Actions option at the top right corner and select Upload config
o Browse to /home /Lab_Files /Export /LabJ
o Select RealmForBridges.json and click Open
Check the updated realm and confirm the following:
o From Applications tab,
o There are 3 applications
o myshmapp uses shared memory transport (myshm-tport)
o mydtcpapp uses Dynamic TCP Transport (myDTCP)
o From Transports tab,
o There are three defined transports
Click Services option at top of the window and observe that Bridge service is not yet running
1
#3
Add a New Bridge to Connect Shared Memory and
Dynamic TCP Transports
Play Video
#4
Test the Working of Transport Bridge
Play Video
Start the message subscriber program using the shared memory transport application
o Minimize the Firefox browser
o Open a new terminal and name it as Receive Messages
o Type the commands as shown or copy from the code snippet to start the receiver program
Next, open a new terminal tab and name it as Send Messages
Type the commands as shown or copy from the code snippet to start the sender program and send 10 messages
Go back to Receive Messages terminal and verify the receiver receives 10 messages and terminates
This confirms the working of the transport bridge
Open a new terminal and enter the commands as shown or copy from the code snippet to stop the FTL server
Close all the terminals and Firefox browser window
Lastly, open a new terminal and enter the command as shown to take backup of the configuration file
Close the terminal window
This completes the exercise
Code Snippets
#Create a folder
cd /opt/tibco/ftl/6.4/samples/yaml/bridge
sudo mkdir data
password: TIBCO7222
From the same terminal, enter the commands as shown or copy from the code snippet to start the FTL server
o Observe that FTL server starts but with a warning _Bridge_SHM-DTCP does not exist
Note: The warning indicates that the bridge name defined in the configuration file does not exist in the realm
data. Once the bridge with defined name is created in the FTL server UI, this warning is removed.
Now, access FTL server using a browser window
o Open Firefox Browser
o Enter the FTL server URL
o Click SIGN IN with User Id anyone
From the FTL server UI, set Edit Mode to On
Click Actions option at the top right corner and select Upload config
o Browse to /home /Lab_Files /Export /LabJ
o Select RealmForBridges.json and click Open
Check the updated realm and confirm the following:
o From Applications tab,
o There are 3 applications
o myshmapp uses shared memory transport (myshm-tport)
o mydtcpapp uses Dynamic TCP Transport (myDTCP)
o From Transports tab,
o There are three defined transports
Click Services option at top of the window and observe that Bridge service is not yet running
#3
Add a New Bridge to Connect Shared Memory and
Dynamic TCP Transports
Play Video
Select Bridges tab and click + to add a new Bridge definition
Enter the following parameters details as shown:
o Bridge: SHM-DTCP
o Transport Set 0: myshm-tport
o Transport Set 1: myDTCP
Validate and Deploy the changes
o Enter Deployment Name
Click Services option and verify that the bridge service is running
o If the Bridge service is still not running, refresh the browser and check again
#4
Test the Working of Transport Bridge
Play Video
Start the message subscriber program using the shared memory transport application
o Minimize the Firefox browser
o Open a new terminal and name it as Receive Messages
o Type the commands as shown or copy from the code snippet to start the receiver program
Next, open a new terminal tab and name it as Send Messages
Type the commands as shown or copy from the code snippet to start the sender program and send 10 messages
Go back to Receive Messages terminal and verify the receiver receives 10 messages and terminates
This confirms the working of the transport bridge
Open a new terminal and enter the commands as shown or copy from the code snippet to stop the FTL server
Close all the terminals and Firefox browser window
Lastly, open a new terminal and enter the command as shown to take backup of the configuration file
Close the terminal window
This completes the exercise
Code Snippets
#Create a folder
cd /opt/tibco/ftl/6.4/samples/yaml/bridge
sudo mkdir data
password: TIBCO7222