HTTP Analyzer :: Cru 2008

As I am spending more and more time with BPEL and more complex deployment layout, trapping the SOAP messages going across multiple nodes was becoming harder, until I got introduced to one of the new features from JDeveloper. With the 11g TP3, available from OTN (see announcement), there is a new feature that makes working with the HTTP Analyzer tool even better; the Rules and Filters.

You can define rules and associate with your HTTP listner. Back in 2006, I was explaining how to navigate from message to message with the blue arrows. With this release, you have a new TAB - named correlation - that groups message by logical unit; the grouping is done with the WS-Addressing MessageID (see Figure 1).
Let starts by getting the setup right. For that, you will need to do the following (the exact step may varied, based on you specific configuration setup):
  1. Find the IP address (or hostname) of the system where you run JDeveloper, and make sure that this system can be access from the location where your BPEL server runs - 130.35.74.160 in our current scenario. You will also need to find the port number assigned to the HTTP Analyzer instance you run - 8099 in our scenario.
  2. Find out if you have already some proxy setting setup on your SOA installation. If you don't have any, then you will just need to had a new entry, but if you have already some default setup, it's important to find it, so that you can overwrite the existing setup - in our current scenario, I have a script, $HOME/soa/bin/soaenv, which define a system property.
    old: JAVA_PROXY="-Dhttp.proxySet=true -Dhttp.proxyHost=proxy.rajkovic.org -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=happy|happy.rajkovic.org|localhost|127.0.0.1|*rajkovic.org"
    new: JAVA_PROXY="-Dhttp.proxySet=true -Dhttp.proxyHost=130.35.74.160 -Dhttp.proxyPort=8099"
  3. Start HTTP Analyzer first - click on the green arrow.
  4. Start the remote process for your SOA server instance - $HOME/soa/bin/startsoa in our scenario.
Once this is done, it's business as usual. In my case, I use SOAP UI to invoke my composite, but you have many other options available, including HTTP Analyzer and the 'send request' feature.

During setup, there are a few mistakes to avoid, to get this working right the first time :
  1. If you remove all the entries from the exclude list (-Dhttp.nonProxyHosts option), you need to start your HTTP Analyzer process before you start the server. The ping perform during startup will fails unless you are already listening to request on 130.35.74.160:8099. You can see the ping request as entry #1 in the Sequence pane (Figure 2).
  2. If you are using localhost within BPEL, you need to setup rules to forward request back to the original service endpoints, as illustrated with the Rules Configuration (Figure 3). Without this rule setup, the HTTP Analyzer process does not know how to route request to 'http://localhost:8880' - This is what happened to me with entry #11 in the Sequence pane (Figure 2).
  3. If you don't want to have all the requests going through your HTTP listener, you can change the way you deploy your process, and use either the IP address or the hostname in your BPEL process, instead of localhost, and handle the exclude list appropriately. I have found that using the IP address is a simple way to filter those request, as all your 'normal' request will continue to use the fully qualified name of the server. This is illustrated with the 3 groups of messages in Figure 1, where we used IP@ (#2-#5), fully qualified hostname (#7-#10), and localhost (#12-#15) in turns.
If you don't see any message, at first, make sure you toggle back to the 'Sequence' pane; you will not get message correlated with each other, unless you have the magic correlation ID in those messages, and you get successful MEP (code 200 or 202).


HTTP Analyzer :: Sequence PaneFigure 2 :: Sequence Pane

Setting up the rules to forward requests targeted at localhost back to the reel location is a very neat feature, as it does not requires to make any change on the remote applications.

HTTP Analyzer :: Rules ConfigurationFigure 3 :: Rules Configuration
Here is a very simple rule, that works with a single service endpoint. As you get more and more endpoint going through your HTTP Analyzer, remember that you can setup more than one listener, with different port numbers and different sets of rules.

To make this google friendly, here are the error message seen on the first time errors I encounter. Hope this solve you some grief too.

SOA startup, waiting for ping to succeed:
08/04/14 09:49:01 Oracle Containers for J2EE 11g (11.1.1.0.0) initialized.
08/04/14 09:49:49 -------> CompositeDeployerTimer triggered
08/04/14 09:49:49 -------> CompositeDeployerTimer trying http connection to http://happy.rajkovic.org:8880
08/04/14 09:49:49 -------> CompositeDeployerTimer ping failed.
08/04/14 09:49:49 -------> CompositeDeployerTimer: Server not ready. Will retry in 30 seconds.
HTTP Analyzer error when trying to reach localhost:8880 (without the rule):
An exception occurred while retrieving the response for http://localhost:8880/SetTransform/SetTransformService.
java.net.ConnectException: Connection refused: connect
...
And finally, remember that you can save those messages captured into a file, using the WS-I.org file format. It's a great way to exchange those SOAP M.E.P. around, with your co-workers or in house WS-Residents.

With this, have fun in today's world of SOA.

Comments

Popular posts from this blog

Changing the version of JDK used by JDeveloper

Connection reset from a WCF Web Service

unexpected null value for literal data