when request
message comes from client to the ESB as we know initially it hits the
transport so when we go deep into the transport there we know there
are two interfaces implemented namely TransportListener and
TransportSender. So TransportListener is responsible to receive and
process the client request and TransportSender is responsible for
process and send response back to the client.wso2 ESB support no of
transport in order to do establish better communication between
client and the back-end service
One of the Two
Transports Supported wso2 ESB are
-
HTTP Pass Through Transport
-
HTTP NIO Transport
In Wso2 ESB 5.0.0
the default transport is HTTP Pass Through the reason is when
comparing HTTP Pass Through Transport and HTTP NIO Transport, HTTP
Pass Through provided high performence.
So why to use
HTTP Pass Through Transport over HTTP NIO Transport?
1.What is happen
when we use HTTP NIO Transport ?
In HTTP NIO
Transport the transport listener is HTTPCoreNIO.When request message
comes, It write the message content to a input buffer. Then the
message builder which is in axis2Engine read the content from the
input buffer and build a object model which is XML based. This model
is used in entire flow through the synapse mediation engine. Once the
message reach to message formatter in axis2Engine it write that XML
based object model as stream of byte in to a output buffer. Then the
transport Sender in HTTP NIO Transport HttpCoreNIOSender read the
content from the output buffer and send to backend server. Since
there are two buffers engaged in this is called as duel buffer
architecture.
2.What is the
Drawback when we use HTTP NIO Transport ?
Since In
HttpNIOTransport each and every client message request is writing to
buffer in message building and formatting it affect to the
performance of the ESB.
3.What
is the solution?
Solution is
HTTPPassThrough Transport since it based on single buffer and
obviously it has been improve the performance of the ESB.The output
buffer has been removed from the architecture and single shared
buffer is using there.
4.What
is happen when we use HTTP Pass Through Transport ?
PassThroughHttpListener
create SourceHandler to receive client requests.Then
it read only the request headers not the body. Then
by looking at the headers of the request Simply
route the message.That is only the overview of HttpPassThrough
Transport in deep there are several components involve to route the
message to the correct destination.
When message comes to the HttpPassThroughTransport It hits the
PassThroughHttpListener it check whether the artifact is content
aware or not if it is content aware then the message writes to the
buffer and send to message builder in axis2Engine to create XML
based object model and pass the request through the mediation engine
and next to message formatter and then on demand it create output
buffer dynamically and message formatter write the message to the
buffer. Then Transport Sender read the message from the buffer and
send it to the back-end server.
If the artifact is not contain any mediators which support content
awareness then client request message should not be build and
formatted then it skip the message builder and formatter then message
directly go through the mediation engine and send to the back-end
server.
5.How to switch
from HTTP NIO Transport to HTTP Pass Through Transport?
We have to edit axis2.xml file configuration in order to switch
Comments
Post a Comment