Saturday, November 2, 2013

A first look at Oracle Business Transaction Management (BTM)


Monitoring and debugging Oracle SOA Suite environments is often a topic not paid much attention to. The people who write the software are often not much involved in the maintenance of the running software and the maintenance people do not have much application knowledge.

Usually Oracle SOA applications are composed of several components which interact with each other. These components are often of different technologies. Personally I tend to use databases, BPEL processes and Java Webservices a lot. For the maintenance people it is difficult to understand all application call chains and debug these in case of problems.

I was curious if the Oracle BTM product would provide a solution for this; http://www.oracle.com/technetwork/oem/btm-496775.html. BTM is part of the SOA Management Pack Enterprise Edition. It used to be a product from AmberPoint before Oracle bought them in 2010. I've used SOA Suite 11.1.1.7 with BTM 12.1.0.4.1 on an XE 11r2 Db for this tryout. I did not read much documentation about this product or followed any courses, so it would also be a test of intuitiveness.


Implementation

Installation

First I considered using the well known Oracle SOA Virtualbox image; http://www.oracle.com/technetwork/middleware/soasuite/learnmore/vmsoa-172279.html. Here I encountered several problems during the installation so I decided to start out with a fresh install / clean server and not a preconfigured one.

I used the following document to get Oracle BTM installed; http://oemgc.files.wordpress.com/2013/03/installing-oracle-btm-12-1-0-3.pdf. Since I only wanted to use one virtual machine for everything, I created one domain with an AdminServer and 5 Managed Servers. Four where used by Oracle BTM and one by SOA. I couldn't use one managed server since 4 EAR files needed to be deployed as part of the installation and they had some overlap in the endpoints they used. Also it was a bit of a challenge to get OS, Database, Oracle SOA Suite, Oracle BTM running in an 8Gb virtual machine but of course I managed.


When I read the manual, I accidentally skipped over the part which said the tables/indexes could be generated by the configuration wizard so I did this part manually (with plain old sqlplus...). After deployment of the EAR files and creation of the database schema's, you are welcomed by a web-interface for some additional configuration.


On the next screen I was surprised that an embedded database could be used. I went to all the trouble of creating users in my own database and schema's and now they tell me I could maybe have skipped that step.


Since I had already created my own users, I decided to use them. After the configuration was complete, The server was running. I was however not monitoring anything.


I needed to register a monitor using a CLI. Next I needed to deploy an observer. For the installation of the observer I've used; http://docs.oracle.com/cd/E24628_01/install.121/e37016/observer_weblogic.htm#CI

Tracking a complex message flow

I wondered if Oracle BTM would allow discovery and debugging of an application flow with technologically different components. My sample application consisted of three BPEL processes, some database software and a servlet. The first BPEL process is a consumer on a queue and receives a message (the 'receive' process). The second process (having the very distinctive name of 'process') calls a 'validate' process and saves the result. The 'validate' process uses a dynamic partnerlink to call three JAX-WS webservices.


I wanted to see the flow from the queue to the BPEL process 'receive' to the BPEL process 'process' to the BPEL process 'validate' to the validation services. Also I wanted to be able to track and obtain the message. I enqueued some messages to test BTM. The first graph I found interesting was the following;
This image showed some of the classes involved. A messaging service was involved, the validation service was involved. A lot of database was involved (we're talking Oracle here of course). I however wanted to resolve this to the level of BPEL processes.

I did find the following;


This would most likely be my 'validate' BPEL process which contained a dummy endpoint which was replaced with a real one during runtime. Apparently it did not realize this endpoint was a dummy. It did show however that it was not called.

I did not see any BPEL endpoints in the service to endpoints view. Also I was not able to track the flow in this case.

Something simpler

I tried something even more simple. I created a synchronous HelloWorld BPEL process. I deployed this process. I created a HelloWorldCaller proces which synchronously called the HelloWorld process. This was the result;


The endpoint for the HelloWorldCaller proces was detected. The HelloWorld process however was not. Then I considered something; BPEL processes can use local transport which avoids having to translate the message back to SOAP in order to call another local BPEL process.



I called the HelloWorld process from the EM test page and the HelloWorld endpoint became visible in BTM. To prove this was the cause, I implemented some properties to make sure local optimizations were not used (http://docs.oracle.com/cd/E23943_01/admin.1111/e10226/soainfra_config.htm#BHCGEBFJ) and tried again. Notice that the 'Local invocation' part is missing in the below screenshot.


This time BTM did discover that HelloWorldCaller was calling HelloWorld. I wonder though if it is possible to distinguish between implicit database actions (dehydration store usage) and explicit calls by using the DbAdapter.

Conclusion

BTM requires some work to install; more then a relatively simple SOA Suite installation. Even though it provides a nice user interface which gives a lot of information, it is not suitable for business users. Every call it detects, is timed (useful for performance testing!) and it provides insight to very low level. Certain peculiarities are harder to track such as AQ, locally optimized BPEL processes and dynamic endpoints. BTM might have provided better information when the test case was executed using a JMS queue with plain old Java and EJB's. I did not see any transactions in my environment. Maybe when BTM considers something a transaction, it will provide more information on what the transaction is about or even message contents. I only looked at discovery of the happy flow. This is of course not the main focus of the product. I did not perform any additional configuration. This might also unlock certain nice new views and functionality. BTM collects a lot of information. How this information is efficiently managed and stored, might also be something to think about when implementing this product