Connecting a Servlet to a ESB Process

Posted by Admin on 30-Jul-2008 06:06

Hi all,

I have made my desired ESB Process and uploaded it to the container.

I have tested it from a TestClient and also using a Servlet.

But somehow I feel the servlet isn't coded well enough, though I get the intended output.

I would really be appreciable if someone could come up with a standard way to connect an ESB process/service via a servlet.

Thanks.

My servlet code is below is attached herewith.

MyServlet.java

All Replies

Posted by dmillman on 19-Aug-2008 09:17

There would be a few changes that I would suggest. The servlet is essentially a JMS client so the same techniques as required for a JMS Client, this would include:

1) If this is a CAA deployment make sure that this is coded in the connection and the appropriate properties are set.

2) You want to ensure that a URL list can be passed in for primary/backup brokers and/or other brokers in the cluster.

3) Think about initializing the servlet from JNDI objects, this would ensure that the the username/password do not need to be placed in the war file and also this should be consistent with other JMS clients.

4) add reconnect logic in case of the connection goes down.

5) the servlet only seems to use a single parameter called customerId. When I've used this pattern in the past I've passed all the parameters as a single XML document this way a single servlet instance can manage all requests.

6) one thing that I am not seeing is the reply to property that you should be setting. You have one of two options here, use a new temporary reply to for each request and/or ensure that the request/response have a unique id in it so that you can correlate the request with the response and ensure the correct response is sent back to the client.

Of note To build a simple web front end you can set a display stylesheet in the response, this allows the presentation to be completely independent of the servlet.

David

This thread is closed