Using Shared Libraries in IIB v10

IBM Integration Bus v10 has introduced many new features. One of the important feature, from my point of view, is the introduction of Shared Library concept.

We all know that WebSphere Message Broker v8 provided new ways of organizing resources in toolkit by introducing

  • Application container, as per the info-center, is a container for all the resources that are required to create a solution.
    • Provides run-time isolation –> resources inside the application are not visible to other resources
    • Used when updates to one group of deployed resources should not affect another group of deployed resources
  • Library container, for organizing resources for re-usability. Can be referenced by applications or services or integration projects.
    • WMB v8 introduced Static library

The behavior of the library container introduced in WMB 8 and used in IIB v9, as per info-center are provided below

StaticLib

Drawback of Library used in WMB 8 / IIB 9: Owing to Application / Service’s run time isolation behavior, we solution developers faced major challenges on deciding whether to organize our solution using Applications / Services or using Integration Projects.When solutions were organized using Applications / Services and the reusable artifact(s), like Common Error Handling framework / logging framework, organized using libraries, each application / services carried copy of library within themselves. As a result, any changes made to these reusable artifact always resulted in need to re-deploy all applications / services.

In that regards, organizing the resources as Integration Projects was better and very much appealing.

But IIB v10 has addressed this concern / problem by introducing Shared Libraries. Now the Applications / Services do not take copy of the Shared Library within themselves. As the Shared Libraries are deployed directly at the Integration Server level.

Advantages of Shared Libraries

  1. Shared Libraries can be added to the BAR file independently of referencing Applications / Services
  2. Deployment of updated Shared Library results in the changes immediately picked up by all referencing applications / services at run-time. Hence no need to redeploy all referencing applications / services
  3. Enables using / referencing to multiple XML or DFDL schema files that declare the same elements and types, by having them stored in separate Shared Libraries

Reference: http://www.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.etools.mft.doc/bc23067_.htm?lang=en

SharedLib

Shared Library vs Static Library from Toolkit to Run-time

  • In the New Library window, specify the name for the library and selecting the library type as “Shared Library”, click FinishLoggerSL
  • Below Images shows the Shared and Static libraries in the toolkit

StaticVsShared

  • Referencing to Shared Library / Static library from Application is shown belowLibReferences
  • When adding to the BAR file, Shared Libraries are displayed in the BAR Editor separately and have to be selected explicitly for adding to the bar file. This is not the case with Static Library as they are added automatically when application referencing them is added to BAR file.

BAREditor

  • After deployment, you could notice the difference between Shared & Static library. Static library copy will be present within the application container, where as the Shared Library is outside the application container and directly under the Integration Server.

Runtime

Hope this blog provides insight into Shared Library feature of IIB 10.

For any corrections / suggestions / query please do drop a note to reachnebula@learnibmesb.com (or) reachnebula@gmail.com.

 

Advertisements

Pub/Sub in IBM Integration Bus v10 – Using built-in MQTT Server

As I had stated in my previous post, from IBM Integration Bus v10 MQ has been made optional. Those who have worked with earlier version of IIB / WMB might wonder

“What about the pub/sub feature of Integration Node / Broker?”

That’s because, till previous version, i.e. IBM Integration Bus v9, Integration Node was using the MQ’s publish/subscribe engine for all its pub/sub activities, like Event Monitoring etc.

Now with the change in the architecture from v10, Integration Node now comes with built-in MQTT broker thus allowing to use MQTT lightweight publish/subscribe messaging protocol. You could also choose to configure Integration Node to either use an external MQTT server or MQ’s queue manager as pub/sub broker as  an alternative to default built-in MQTT server.

The built-in MQTT server is enabled by default for the Integration Node with the default port as 11883. The MQTTServer gets started automatically along with the Integration Node and also can be shared / used across multiple Integration Nodes.

To view the status of the MQTT server of an Integration Node you could use the following command

mqsireportproperties -b pubsub -o MQTTServer -n enabled

To view the port of the MQTT server of an Integration Node you could use the following command

mqsireportproperties -b pubsub -o MQTTServer -n port

Am going to focus on Event Monitoring, esp. Business Events on this blog to illustrate using built-in MQTT server in IIB v10 integration node SNABRK10.

The IIB Events can be broadly classified as shown below

IBM Integration Bus Events Classification

IBM Integration Bus Events Classification

Of the above 3 classification, if MQ is not installed, Integration node will publish both Operational & Admin events to the built-in MQTT broker by default. Business Events publication to built-in MQTT server is not enabled by default and hence has to be enabled using the following command

mqsichangeproperties SNABRK10 -b pubsub -o BusinessEvents/MQTT -n enabled -v true

To illustrate how to change the port of built-in MQTT server we will configure the Integration Node SNABRK10 to use the port 12885. To change the port use the following command

mqsichangeproperties SNABRK10 -b pubsub -o MQTTServer -n port -v 12885

Please note, message flow should be configured for emitting monitoring events (business events), which is not in the scope of this blog.

Assuming that the solution / message flow with monitoring enabled is deployed and activated, the message flow will publish the business events now to the built-in MQTT Server on port 12885 on the topic specified below

IBM/IntegrationBus/<IntNode>/Monitoring/<IntServer>/<MsgFlowName>/

To subscribe to these business events, we could then develop message flow using the built-in MQTT nodes MQTTSubcribe node, the configuration of which is shown below

IBM Integration Bus v10 - Using MQTTSubscribe

IBM Integration Bus v10 – Using MQTTSubscribe

Hope this provides overview about using built-in MQTT server of Integration Node in IIB v10. Please let me know your comments or any queries that will help me in refining my blogs and focus on areas of your concerns.

Looking forward to your feedbacks !!!

Installing IBM Integration Bus v10 on Linux

From IIB v10, IBM has removed the dependency of Integration Node / Broker on WebSphere MQ, by making it as optional product. Considering the operational dependency that Integration Node / Broker had on MQ in all its earlier version, I would say this is major architectural change for IIB. By doing so, what has happened is the reduction of number of components required to be installed.

In IIB v9, the number of components that were to be installed comprised of

  • IBM WebSphere MQ
  • IBM Integration Toolkit
  • IBM Integration Bus (Runtime Component)
  • IBM Integration Explorer
  • IE02 – ODBC Extender (not required for Windows though)

With IIB v10, the number of components to be installed has reduced to only 2, thus simplifying the entire process of installation

  • IBM Integration Toolkit
  • IBM Integration Bus (Runtime Component)

Now the installation package of IIB v10 comprises of single exe on windows. And on linux, there are no more installation to be performed but only extraction of the installation package. As part of installation, IE02 (ODBC Extender) also gets installed.

Also on linux, we have now have the option of Single User Installation (to be used only by one user) or as Shared Installation. Options has also been provided to covert the Single User installation to the Shared Installation at later stage too, if need be.

In this blog, I will be illustrating the steps for performing shared installation on Linux. Have used CentOS v7 for this illustration

  • Step 1: Login to the Linux server as root. Create a new directory IBM in the /opt folder.
IIB v10 Linux Installation - Creating IBM folder in /opt

IBM Integration Bus v10 Linux Installation – Creating IBM folder in /opt

  • Place the IIB v10 Linux installation  archive into /opt/IBM folder as shown

    IBM Integration Bus v10 Linux Installation - Place installation file in /opt/IBM directory

    IIB v10 Linux Installation – Place installation file in /opt/IBM directory

  • Extract the installation package using tar command. Use –exclude option to omit IBM Toolkit installation,i.e. only to install IBM Integration Bus runtime component

tar -xzf 10.0.0.0-IIB-LINUX64-DEVELOPER.tar.gz –exclude iib-10.0.0.0/tools

IBM Integration Bus v10 Linux Installation - Extract the package using tar command into /opt/IBM

IBM Integration Bus v10 Linux Installation – Extract the package using tar command into /opt/IBM

  • For shared installation, group mqbrkrs and /var/mqsi folder needs to be created. Run the following command to accept the license as well create the requisite folders and groups

./iib make registry global accept license silently

IBM Integration Bus v10 Linux Installation - Creating shared Installation

IBM Integration Bus v10 Linux Installation – Creating shared Installation

  • The above step creates the group mqbrkrs, if not existing, and the /var/mqsi folder. Verify the same as shown below
IBM Integration Bus v10 Linux Installation - Verifying group mqbrkrs & /var/mqsi creation

IBM Integration Bus v10 Linux Installation – Verifying group mqbrkrs & /var/mqsi creation

IBM Integration Bus v10 Linux Installation - Verifying /var/mqsi creation

IBM Integration Bus v10 Linux Installation – Verifying /var/mqsi creation

  • To verify the installation, navigate to /opt/IBM/iib-10.n.n.n and run the following command
IBM Integration Bus v10 Linux Installation - Verifying Installation - Part 1

IBM Integration Bus v10 Linux Installation – Verifying Installation – Part 1

IBM Integration Bus v10 Linux Installation - Verifying Installation - Part 2

IBM Integration Bus v10 Linux Installation – Verifying Installation – Part 2

This completes the installation of IIB v10 on Linux. Next steps would be to create IIB user account and configure the user profile for running IIB commands. This could be done by editing the .bash_profile file of the user and adding the following statement to it.

. /opt/IBM/iib-10.0.0.0/server/bin/mqsiprofile

IBM Integration Bus: Enabling ODBC Connectivity for Integration Node on Linux – Illustrated for Oracle Database

This blog covers the steps required for configuring ODBC connectivity to remote database for Integration node running on Linux Server, in IBM Integration Bus v9. The steps are illustrated using Oracle XE Database.

Pre-requisites (Out-of-scope of this blog)

  1. IBM Integration Bus Runtime Component installed on the Linux machine
  2. Integration Node to be used is created
  3. Database installed and configured on remote machine

Step 1: Configuring odbc.ini File For ODBC Connectivity in IBM Integration Bus Runtime Server (Linux)

  1. Create a new directory, say /odbc, to place the ODBC related ini files and configuring them to our requirement.
User Defined ODBC directory

User Defined ODBC directory

  • Copy the odbc.ini & odbcinst.ini sample files supplied with IIB Runtime component, located in <IIB_Install_dir>/ODBC/unixodbc/ directory, to the /odbc directory we had created for the purpose. Each broker service user ID on the system can therefore use its own DSN definitions.
Sample ODBC Files provided with IIB

Sample ODBC Files provided with IIB

Copying Sample ODBC files provided with IIB to the user defined /odbc directory

Copying Sample ODBC files provided with IIB to the user defined /odbc directory

  • Change the ownership of the /odbc/odbc.ini file to mqbrkrs group and also its permissions to 664
Changing the ownership of /odbc/odbc.ini file to mqbrkrs group and setting permission level to 664

Changing the ownership of /odbc/odbc.ini file to mqbrkrs group and setting permission level to 664

  • Change the ownership of /odbc/odbcinst.ini file to mqm user and mqbrkrs group and retain its permission as per the sample file provided with IIB.
Changing the ownership of /odbc/odbcinst.ini file to mqm user & mqbrkrs group

Changing the ownership of /odbc/odbcinst.ini file to mqm user & mqbrkrs group

  • Login to the IIB Admin user account, say iibadmin, and configure the user’s profile file to set the ODBC related environment variables – ODBCINI & ODBCSYSINI

export ODBCINI = <path>/odbc.ini

export ODBCSYSINI = <path of odbcinst.ini file>

Setting the ODBC environment variables in the IIB administrator profile file .profile (or) .bash_profile in the user's home directory

Setting the ODBC environment variables in the IIB administrator profile file .profile (or) .bash_profile in the user’s home directory

  • Edit the odbc.ini file, in /odbc folder to edit the last stanza of it to specify the required driver details and adding the required DSN entry for the Oracle XE database
Adding ODBC DSN entry for Oracle database in the ODBC.ini

Adding ODBC DSN entry for Oracle database in the ODBC.ini

  • Create a new DSN Entry NEBULADB in the /odbc/odbc.ini file to the Oracle XE database specifying the connection details as shown
DSN entry added to /odbc/odbc.ini specifying Oracle database connection details

DSN entry added to /odbc/odbc.ini specifying Oracle database connection details

Step 2: Configuring Integration Node for ODBC Connectivity

  • Login to the IIB Server using the IIB administrator user id, say iibadmin, and start the Integration Node, if not running already
  • Associate the ODBC DSN to the Integration node using the mqsisetdbparms command as shown below and enter the db2 password when prompted.

    mqsisetdbparms <Integration Node> -n <DSN Name> -u <DB user>

     e.g: To associate our DSN IIBDB_ODBC to the TRNGBRK Integration Node using the user id db2admin, use the following command. Enter the password for the db2admin user when prompted mqsisetdbparms TRNGBRK -n NEBULADB -u nebula

Associating ODBC DSN to Integration Node

Associating ODBC DSN to Integration Node

  • To verify the Integration Node connectivity to the DB2 database using the associated DSN, use the command mqsicvp as shown below

mqsicvp <Integration Node Name> -n <DSN Name>

 e.g: To test connectivity to DB2 database using NEBULADB DSN from TRNGBRK integration node, use the following command

 mqsicvp TRNGBRK -n NEBULADB

Verifying Integration Node's connectivity to database using specified DSN

Verifying Integration Node’s connectivity to database using specified DSN