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

How to setup an WSO2 API manager distributed setup with a clustered gateway with WSO2 ELB

In this blog post I am going to describe about how to configure a WSO2 API Manager in a distributed setup with a clustered gateway with WSO2 ELB and the WSO2 G-REG for a distributed deployment in your production environment. Before continuing with this post, you need to download the above mentioned products from the WSO2 website. WSO2 APIM - http://wso2.com/products/api-manager/ WSO2 ELB - http://wso2.com/products/elastic-load-balancer/ Understanding the API Manager architecture API Manager uses the following four main components: Publisher Creates and publishes APIs Store Provides a user interface to search, select, and subscribe to APIs Key Manager Used for authentication, security, and key-related operations Gateway Responsible for securing, protecting, managing, and scaling API calls Here is the deployment diagram that we are going to configure. In this setup, you have 5 APIM nodes with 2 gateway...

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 puppet works in your IT infrstructure

What is Puppet? Puppet is IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to orchestration and reporting. Using Puppet, you can easily automate repetitive tasks, quickly deploy critical applications, and proactively manage change, scaling from 10s of servers to 1000s, on-premise or in the cloud. How the puppet works? It works like this..Puppet agent is a daemon that runs on all the client servers(the servers where you require some configuration, or the servers which are going to be managed using puppet.) All the clients which are to be managed will have puppet agent installed on them, and are called nodes in puppet. Puppet Master: This machine contains all the configuration for different hosts. Puppet master will run as a daemon on this master server. Puppet Agent: This is the daemon that will run on all the servers, which are to be managed using p...