Sekhar
Sekhar

Reputation: 343

Java Axis WebService Overload Control

We want to implement a overload mechanism on our axis Web Service. Basically we want to reject the incoming the SOAP requests when the TPS(Transactions Per Second) value reaches a specified value say 100 or 150. To make this we need to count the number of requests received and the number of responses sent.

Could you please suggest me on where to start for this implementation? How to count the requests and responses?

Many Thanks, Sekhar

Upvotes: 3

Views: 490

Answers (1)

rolve
rolve

Reputation: 10218

I think you should implement the message counting and dropping in a handler. Here's a good description in the Axis documentation of how to write and register handlers in your web service: Using handlers in JAX-WS Web services.

Basically, what you do code-wise: You create a handler class implementing javax.xml.ws.handler.soap.SOAPHandler. In the handleMessage(...) method, you count the incoming messages and, as the Javadoc for the Handler interface indicates, return false if the overload limit is reached.

Hope this helps you to get started!

Upvotes: 1

Related Questions