Skip to main content

Learning Apache Axis2 from level zero - Part II

Today I am going to discuss about what happens to a message come in to an axis2 engine. Here is a pictorial representation of what is happening inside an axis2 engine.


The key functionality of any given web service framework is processing an incoming message and delivering it to the targeted application (service), and once the result is produced, delivering it to the client. Today, for business critical applications, we need a lot more than just processing the messages. Thus, support, for example reliability, security, transactions, and throttling is required. In addition, a framework should also be easily extensible to support new customer requirements and other quality services. To provide those features, most of the SOAP processing frameworks utilize the concept of pipes, where any incoming or outgoing message goes through the pipe and the extensible pipe is divided into small pieces. Such a piece is known as an interceptor. One can add new interceptors, change them, or delete them, to cope with the requirements.

Let's see what each of the above components do inside an axis2 engine.


  • Handlers

Handler is the message interceptor. In any messaging system, the interceptor has its factual meaning in the context of messaging too, which intercepts the messaging flow and does whatever task it is assigned to do. In fact, the interceptor is the smallest execution unit in a messaging system.

Handlers, in Axis, are stateless, meaning they do not keep their past execution states in memory. A handler can be considered as a logic invoker with the input for the logic evaluation taken only from the MessageContext. Handler has both read and write access to MessageContext (MC) and to incoming SOAP messages. Thus, a handler can read SOAP messages, remove elements from the message (mostly headers), add new elements (headers), or modify elements as well as add, delete,
or modify content from the MessageContext.


  • Phases

The concept of a phase is introduced by Axis2 and it was mainly to support the dynamic ordering of handlers to provide better extensibility, and better flexibility of the handler chain. A phase can be defined in various ways:
It can be considered as a logical collection of handlers
It can be considered as a specific time interval in the message execution
It can be considered as a bucket into which one can put his/her handler
One can consider a phase as a handler too


  • Pipe (Flow)

A flow is the message pipe where the message enters from one end of the flow and leaves from the other end of the flow. A flow or execution chain can be considered as a collection of phases. Although it has been mentioned earlier that the Axis engine will call the invoke method of a handler. That is not totally correct. At a very high level, what the engine really does is call the invoke method of each phase in a given flow, and then the phase will sequentially invoke all the handlers in it (the following figure illustrates how an engine calls a phase and then a phase calls handlers).


In the above figure, P - Phase, H - Handler

This blog post is prepared with the help of the book "Apache Axis2 Web Services 02nd Edition" by Afkham Azeez and Deepal Jayasinghe.

Comments

  1. How to Earn More cash from Google adsense by adding keywords... ( Top 500+ High Paying Google Adsense Keywords 2017 )
    http://rottary.blogspot.com/2017/02/how-to-earn-more-cash-from-google.html

    ReplyDelete

  2. It is amazing to visit your site. Thanks for sharing this information, this is useful to me...
    Microservices Online Training
    Microservices Training in Hyderabad

    ReplyDelete

Post a Comment

Popular posts from this blog

Understanding Threads created in WSO2 ESB

WSO2 ESB is an asynchronous high performing messaging engine which uses Java NIO technology for its internal implementations. You can find more information about the implementation details about the WSO2 ESB’s high performing http transport known as Pass-Through Transport (PTT) from the links given below. [1] http://soatutorials.blogspot.com/2015/05/understanding-wso2-esb-pass-through.html [2] http://wso2.com/library/articles/2013/12/demystifying-wso2-esb-pass-through-transport-part-i/ From this tutorial, I am going to discuss about various threads created when you start the ESB and start processing requests with that. This would help you to troubleshoot critical ESB server issues with the usage of a thread dump. You can monitor the threads created by using a monitoring tool like Jconsole or java mission control (java 1.7.40 upwards). Given below is a list of important threads and their stack traces from an active ESB server.  PassThroughHTTPSSender ( 1 Thread )

WSO2 ESB tuning performance with threads

I have written several blog posts explaining the internal behavior of the ESB and the threads created inside ESB. With this post, I am talking about the effect of threads in the WSO2 ESB and how to tune up threads for optimal performance. You can refer [1] and [2] to understand the threads created within the ESB. [1] http://soatutorials.blogspot.com/2015/05/understanding-threads-created-in-wso2.html [2] http://wso2.com/library/articles/2012/03/importance-performance-wso2-esb-handles-nonobvious/ Within this blog post, I am discussing about the "worker threads" which are used for processing the data within the WSO2 ESB. There are 2 types of worker threads created when you start sending the requests to the server 1) Server Worker/Client Worker Threads 2) Mediator Worker (Synapse-Worker) Threads Server Worker/Client Worker Threads These set of threads will be used to process all the requests/responses coming to the ESB server. ServerWorker Threads will be used to pr

How to configure timeouts in WSO2 ESB to get rid of client timeout errors

WSO2 ESB has defined some configuration parameters which controls the timeout of a particular request which is going out of ESB. In a particular  scneario, your client sends a request to ESB, and then ESB sends a request to another endpoint to serve the request. CLIENT->WSO2 ESB->BACKEND The reason for clients getting timeout is that ESB timeout is larger than client's timeout. This can be solved by either increasing the timeout at client side or by decreasing the timeout in ESB side. In any of the case, you can control the timeout in ESB using the below properties. 1) Global timeout defined in synapse.properties (ESB_HOME\repository\conf\) file. This will decide the maximum time that a callback is waiting in the ESB for a response for a particular request. If ESB does not get any response from Back End, it will drop the message and clears out the call back. This is a global level parameter which affects all the endpoints configured in ESB. synapse.global_timeout_inte