TIBCO EMS 8 on CentOS 6 VM

I needed to create a Virtual Box VM for my TIBCO experiments.

Here is how I created my base system, a CentOS VM with EMS 8.1.

This tutorial include all relevant scripts, and associated Gnome launchers.

Prerequisites

  1. Install VirtualBox and extensions on my laptop
  2. Create a CentOS 6.5 VM on virtual box (I chose “Minimal Desktop”)
    • (follow only the first section, the guest additions are better explained at step 4).
  3. Update the packages on CentOS
  4. Install the virtual box guest additions. (Great How-to here)
  5. Install a modern Oracle JDK. I installed version 7 (yum localinstall jdk-7u60-linux-x64.rpm).

Note: You could also take an existing image from a site like this one, but I prefer making my own.

On the target VM, I created only one non-root user (name=”user”).

I use the shared folder feature of Virtual Box to share file between the host and guest systems. If you choose this path, please make sure that the user you are using is in the group vboxsf, like so:

/etc/group file in vim editor
/etc/group file in vim editor

Install EMS

Nothing difficult here… a simple wizard based java installer. In my case, the tibco home is /opt/tibco. I specified /opt/cfgtibco as the configuration folder. In both cases, I had to create the folder with root and change the rights.

# /bin/bash
# As root !

cd /opt
mkdir tibco
mkdir cfgtibco
chown user tibco
chown user cfgtibco
chgrp user tibco
chgrp user cfgtibco
chmod 770 -R tibco
chmod 770 -R cfgtibco
Installer command
Installer command
TIBCO HOME setup
TIBCO HOME setup
Configuration folder setup
Configuration folder setup
Installation validation - Done !
Installation validation – Done !

Note: The installer did not work at first with the OpenJDK provided by CentOS. Hence the Oracle JDK prerequisite.

Note 2 : DO NOT try to reorganize the configuration folder. As will be seen below, EMSCA can regenerate and deliver a configuration. When it does, it take into account the original configuration folder.

Converting the configuration

I used the provided utility to convert the old configuration fileS to the single JSON config file required for EMSCA:

cd /opt/cfgtibco/tibco/cfgmgmt/ems/data
/opt/tibco/ems/8.1/bin/tibemsconf2json -conf tibemsd.conf -json tibemsd.json

Cleanup of old configuration (optional)

As they will not be used anymore, I like to move the “old-style” EMS configuration to another folder:

cd /opt/cfgtibco/tibco/cfgmgmt/ems/data
mkdir OLD_CONFIG
mv *.conf OLD_CONFIG/
mv *.txt OLD_CONFIG/
mv *.conf_template OLD_CONFIG/

Creation of “EMS JSON” launcher

To use the new configuration, the lauching script (in my case EMS_HOME/bin/tibemsd64.sh) must be adjusted:

cd /opt/tibco/ems/8.1/bin
./tibemsd64 -config "/opt/cfgtibco/tibco/cfgmgmt/ems/data/tibemsd.json"

Then, I create a launcher for the script :

gnome-terminal -e "gnome-terminal -e /opt/tibco/ems/8.1/bin/tibemsd64.sh"
Properties view of the desktop launcher
Properties view of the desktop launcher

Install EMSCA

EMSCA is better managed with a simple initiator properties files, such as this one:

com.tibco.emsca.data.dir=/opt/cfgtibco/tibco/cfgmgmt/ems/emsca_data
com.tibco.emsca.http.hostport=*:8080

Don’t forget to create the esmca_data folder:

cd /opt/cfgtibco/tibco/cfgmgmt/ems
mkdir emsca_data

The final setup should look like this:

EMS configuration directory structure
EMS configuration directory structure

The self contained web server can then be started with this command, which I decide to include in a launcher script on the desktop:

/opt/tibco/ems/8.1/bin/tibemsca --config /opt/cfgtibco/tibco/cfgmgmt/ems/data/emsca.properties

OR, as a Gnome shortcut:

gnome-terminal -e “/opt/tibco/ems/8.1/bin/tibemsca –config /opt/cfgtibco/tibco/cfgmgmt/ems/data/emsca.properties”

We then use the browser to connect…

Empty EMSCA
Empty EMSCA

At first, EMSCA is empty of any servers. We must “create” a server (connection)

9 localhost server creation

Then, it it a simple matter of following the server hyperlink to get in the main screen

NICE !
NICE !

Use EMSCA from your host system

To use EMSCA (or any other guest OS service) from your host system, follow this tutorial on port redirection with CentOS and VirtualBox.

EMS is nicer on Chrome in Mac OS !
EMS is nicer on Chrome in Mac OS !

Install Hermes JMS

1. Install a fresh Hermes with root (on Linux in my case)

Hermes as a simple Java installer wizard
Hermes as a simple Java installer wizard
Hermes installer is a simple "next,next,next" installer.
Hermes installer is a simple “next,next,next” installer.

2. Create a /home/USER/.hermes or /home/USER/hermes directory and copy the files from the /usr/local/HermesJMS/SOMETHING/cfg directory (again, only important on Linux)

mkdir ~/hermes
cp /usr/local/HermesJMS/cfg/* ~/hermes

Then I was able to start Hermes with /usr/local/HermesJMS/bin/hermes.sh

You can even a nice Gnome desktop launcher.
You can even a nice Gnome desktop launcher.

3. In Hermes, the first step is to get into the “Options-> Configuration…->Providers” section
4. Then, you can right-click to create a new provider. I named mine “EMS8.1”, but the value can be anything.

Pictured above : Not orignal naming.
Pictured above : Not orignal naming.

5. Again, use the right-click to select “add jars” and select EVERY JARS in the EMS_HOME/lib directory (use *.jar in the textbox to clean other files). Select the “Scan” option when asked.  Click “Apply” and close the configuration window with “OK”.

Use "*.jar" in the filename textbox to make it easier.
Use “*.jar” in the filename textbox to make it easier.
Hermes-Config-2
The end result should look like this.

6. The last step is to create a new Tibco EMS session (by right clicking on sessions in the main screen or using the menu bar). This usually looks a lot like this:

Could not be more simple...
Could not be more simple…

Everything is important here:

  • The first important selection is the “Loader”, which should match the provider we just created. This is critical for the rest of the form to work.
  • The TibjmsConnectionFactory is selected (see image above for complete class name), so Queues and Topics connections are possible.
  • The “Plug in” selection is also mandatory : choose “Tibco EMS”
  • Then, create the 3 required parameters in the Connection Factory section:
    • serverURL = tcp://HOST:PORT
    • userName = admin
    • userPassword = [empty in my case]

You can now right click on the session and try to discover the destinations (Topics & Queues). They will be added automagically if the connection is successful.

HermesJMS

Note: There may be a way to do some of this with JNDI, but I have not played with than yet.

Install GEMS

GEMS is a “native(TIBCO EMS APIs) and JMS based” administration and debugging tool. It is rough on the edges and unsupported by TIBCO, but it can also be more powerful than Hermes.
It is available for download here.(Original Article)

The installation is not complex. It consist of:

  • Unziping the file (I chose ~/Gems as the destination directory)
  • Slight adjustment of the startup script, like so:
#!/bin/sh

#Edit 1 : to allow script to be executed from anywhere
cd ~/Gems

#Edit 2 : Adjust EMS location
TIBEMS_ROOT=/opt/tibco/ems/8.1

TIBEMS_JAVA=${TIBEMS_ROOT}/lib
#Edit 3 : Change to jms-2.0.jar for EMS8 or higher
CLASSPATH=${TIBEMS_JAVA}/jms-2.0.jar:${TIBEMS_JAVA}/jndi.jar
CLASSPATH=Gems.jar:looks-2.3.1.jar:jcommon-1.0.16.jar:jfreechart-1.0.13.jar:${TIBEMS_JAVA}/tibjms.jar:${TIBEMS_JAVA}/tibcrypt.jar:${TIBEMS_JAVA}/tibjmsadmin.jar:${CLASSPATH}
CLASSPATH=${CLASSPATH}:${TIBEMS_JAVA}/slf4j-api-1.4.2.jar:${TIBEMS_JAVA}/slf4j-simple-1.4.2.jar
# echo ${CLASSPATH}
java -classpath ${CLASSPATH} -Xmx128m -DPlastic.defaultTheme=DesertBluer com.tibco.gems.Gems gems.props

Please note:

  • The “cd” in the beginning
  • The modification of TIBEMS_ROOT
  • The modification from jms.jar to jms-2.0.jar (EMS > 8.0 only)

The script can now be executed directly, or via launcher:

The cool icon is called gnome-gemsvt.png
The cool icon is called gnome-gemsvt.png
GEMS
GEMS just may be the most powerful graphical tool to configure and test EMS

TIBCO EMS Admin CLI

Last, but certainly not least, we add a launcher to the TIBCO EMS admin tool.

Note the "Application in terminal" option
Note the “Application in terminal” option
tibemsadmin(64) is crude, but powerful
tibemsadmin(64) is crude, but powerful

Conclusion

We now have a great testing VM, with administrative tools included !

The next steps could be to play with multiple instances of EMS and/or with SSL settings, or to explore EMSCA…

…then I’ll install more TIBCO products : BusinessWorks 6, BusinessEvents or others, and write more articles !

Done ! For now.
Done ! For now.

 

One thought on “TIBCO EMS 8 on CentOS 6 VM”

Leave a Reply

Your email address will not be published. Required fields are marked *