Thursday, May 23, 2013

Messaging Battle

Thursday May 16, half of the i8c team gathered for the "Messaging Battle". In our daily life, we typically work with Integration solutions (ESB's) and Message Oriented Middleware (MOM) from the same vendor.

But as integration specialists we also encounter situations where we need to communicate with a MOM product from another vendor. ESB's come with adapters to interconnect with other queuing solutions: JMS adapter, WebSphereMQ adapter etc.

Four teams of 5 people (half of the 40 i8c consultants) went for the challenge to combine 5 ESB's from different vendors with 5 messaging solutions (queuing products).

The following ESB's were used
in combination with the following messaging solutions:
Note: for JBoss, the JEE application server was used with message driven beans, without any specific integration framework.

Team 1


Team 2

Team 3

Team 4

Of course there were the typical issues: network connectivity with a DHCP server sometimes refusing to cooperate, an undersized Virtual Machine for the brand new but rather heavy SAP PI server etc. Also some interesting learning points while configuring JMS e.g. with different JNDI providers.

Team 1 were declared winners: regardless of their technical challenges, they were the quickest to have messages flying around the whole chain of 5 ESB's and 5 queuing products. Interesting to see how connections was established from Apache Camel to Azure Messaging and from Microsoft BizTalk to a JMS server using the JNBridge JMS adapter for BizTalk.

An afternoon of technical challenges but also fun.  Learning about other ESB's while looking over the shoulders of colleagues.

Author: Guy

Friday, May 3, 2013

Aspect oriented programming in TIBCO ActiveMatrix BusinessWorks

TIBCO ActiveMatrix BusinessWorks ActiveAspects Plug-in extends TIBCO ActiveMatrix BusinessWorks by adding an Aspect Oriented Programming capability. This allows you to enhance your BW processes at deploy time while keeping the original BW process intact.

The plug-in works by providing the developer a JAVA API that can be used to develop and build a custom java application, packaged in a jar file. This jar file can alter the execution of any TIBCO ActiveMatrix BusinessWorks application. Naturally, if used correctly.

Before you can start, you should at least understand what process aspect oriented programming is. The following screenshot, from the TIBCO Documentation, provides a very good explanation.

A Process-Oriented Aspect (POA) alters the execution of a process by injecting Advices, which are user defined code, at specific points of the process called Join Points. The selection of the Join Points is made based on the expressions called Point Cuts.

An Aspect is the collection of Point Cuts and Advices. Aspects implement features that cut across different layers of a BW application (that is, across different BW processes). One of the key  characteristics of the POA style programming is that these features can be developed, packaged and deployed independent of TIBCO ActiveMatrix BusinessWorks applications.

Let’s take an example to see how it works. The following business process subscribes on an event, does some transformation and writes it to disk.

You can now use the plug-in to change dynamically the destination file location. In real life, you could execute an external business rule to determine dynamically the file location. 

Creating the advice implementation.
After creation of a java project in eclipse (or any other IDE you prefer), you need to add the jar files that are located in the directory $TIBCO_HOME\bw\plugins\lib\palettes (bwaa-palette.jar, bwconfig-api.jar, bwconfig-impl.jar, gxml.jar, gxmlBridges.jar, gxmlProcessors.jar, poa-api.jar, poa-bwaa.jar, poa-core.jar). You can also add the poa-bwaa-samplesImpl.jar from the examples since it contains a useful GxmlUtil class (also used in all the examples given by Tibco).

The first thing to decide is whether you need an asynchronous advice implementation or not.  An asynchronous advice implementation does not execute its business logic on the engine job thread. During this time, the engine can execute other advice pipelines or activities if any of them exist in the same process instance on a parallel track. A synchronous advice implementation does not allow this and ‘blocks’ the execution in the job thread.

The above sample is based on the examples and Java API provided by Tibco.

Once you’ve written the java class, you’ll have to package it into a jar file. Best location to save this jar file would be $TIBCO_HOME\bw\plugins\bwaa\lib because this location will be, by default, included on the classpath of a businessworks engine (bwengine). However if you want to run the aspect in your designer, you’ll need to adjust the tibco.env.CUSTOM_CP_EXT in the designer.tra. You can look in the bwengine.tra for the variable BW_AA_HOME to see how it should be set.

When the advice implementation is made, you’ll have to create an aspect xml file. The aspect file will define your point cuts and which advice implementation should be executed when the point cut is reached. The plug-in defines a query language used for writing point cut expression. The query language defines four basic primitives that can be used (and combined) to narrow down your point cut:
  • Activity
  • Process
  • Project
  • Engine
This aspect xml file should be packaged as a jar file (although it’s not a java implementation) and should be put in the location $TIBCO_HOME\bw\plugins\bwaa\aspects. This is the default location as configured in the bwengine.tra. For testing in the designer, you'll need to use a custom property file and add the following to it: %BW_AA_HOME%/aspects

The tibco designer project can be downloaded here.
The aspect implementation can be downloaded here.
The aspect configuration xml can be downloaded here.

Author: G√ľnther