Hi all,
HTTP Inbound Implementation using HTTP Core has been almost
completed and Integration Tests and Documentation has to be done.High Level
Implementation details as follows.
- DefaultListeningIOReactor is started when ESB starts with
InboundConfigurations.Same IOReactor is shared among all the inbound
Endpoints.
- IOReactor is listen for ports specified in inbound endpoints.
- Diffrent InboundSourceHandlers are registered with
MulitlisternIODispatcher with their ports.
- MultilistnerIODispatcher is capable of dispatching HTTP Requests to
relevant Handlers.
- InboundSourceHandlers create InboundHttpSourceRequest which is
representation of HTTP Request received and Pass it to the
InboundRequestWorker
- InboundRequestWorker is executed through thread pool which is
converting request to Syanapse Message Context and inject it to sequence
specified by user and creates source pipe and set it as a property to
consume by outbound PTT.
- Response is received through Axis2Sender before sending to the
Axis2Engine and Response Synapse Message Context is send to
InboundHttpResponseWorker.
- InboundHttpResponseWorker is capable of extract the Target Pipe and
create InboundHttpSourceResponse and correlate Request with response.
- InboundHttpSourceResponse write the buffer content to the client
side.
On Fri, Jul 25, 2014 at 11:50 AM, Kasun Indrasiri <[email protected]> wrote:
>
>
>
> On Fri, Jul 25, 2014 at 11:43 AM, Isuru Ranawaka <[email protected]> wrote:
>
>> hi all,
>> Implementation of the HTTP Inbound using Netty has been externalized as a
>> separate component in carbon mediation and now working on developing HTTP
>> Default Inbound Implementation using HTTP Core .We can register request
>> handlers for different inbound endpoints using single IO Reactor.SO same
>> reactor is capable of listening different ports and dispatch requests to
>> relevant handlers.
>>
>> +1
> It is really good to have all these inbound EPs externalized from synapse.
> In addition, when we are implementing this with HTTPCore, we should be
> able to cater to PTT architecture, where we create the source pipe from the
> inbound EP and later consumed by axis2 based PT sender.
>
>> thanks
>> isurur
>>
>>
>> On Mon, Jul 21, 2014 at 1:41 PM, Sanjiva Weerawarana <[email protected]>
>> wrote:
>>
>>> Oleg's reply below (forwarding with permission).
>>>
>>> So we should not just configuring HttpCore to listen on the new ports -
>>> I presume it has a way of registering different callbacks for different
>>> ports (which is what we need in order to handle them outside of the normal
>>> Synapse path).
>>>
>>> Sanjiva.
>>>
>>> On Mon, Jul 21, 2014 at 1:24 PM, Oleg Kalnichevski <
>>> [email protected]> wrote:
>>>
>>>> On Mon, 2014-07-21 at 13:00 +0530, Sanjiva Weerawarana wrote:
>>>> > Good point about the need to have different IO threads .. but that's
>>>> > then because of a limitation in HTTPCore .. at a C level you can
>>>> > listen for IO on multiple sockets at once. So ideally HTTPCore can be
>>>> > improved to support that .. or maybe it does already? Oleg?
>>>> >
>>>>
>>>> HttpCore was capable of listening on multiple ports while utilizing the
>>>> same I/O reactor and the same number of I/O dispatch threads since very
>>>> beginning (~ 2006).
>>>>
>>>> Oleg
>>>>
>>>>
>>>> >
>>>> > +1 for dropping Netty :-).
>>>> >
>>>> >
>>>> > Sanjiva.
>>>> >
>>>> >
>>>> > On Mon, Jul 21, 2014 at 8:31 AM, Kasun Indrasiri <[email protected]>
>>>> > wrote:
>>>> > Hi Sanjiva,
>>>> >
>>>> >
>>>> > I think the problem we have with inbound HTTP and existing
>>>> > HTTP transport is that, they are completely isolated. So, even
>>>> > if we implement the new InboundEP implementation with
>>>> > HTTPCore, we cannot share the same listening IO reactor as
>>>> > with axis2 based PTT. So, each HTTP inbound EP have its own
>>>> > reactor running with its own config.
>>>> >
>>>> >
>>>> > The reason for start the initial implementation with Netty is
>>>> > to verify the Inbound synchronous behavior with an external
>>>> > HTTP library (for instance we may do something similar when
>>>> > implementing WS-RM Inbound EP with CXF). However, we better
>>>> > switch back to HTTPCore as the default HTTP Inbound endpoint
>>>> > as it is the default non-blocking HTTP library used across the
>>>> > board.
>>>> >
>>>> >
>>>> > Thanks,
>>>> > Kasun
>>>> >
>>>> >
>>>> > On Sat, Jul 19, 2014 at 3:55 PM, Sanjiva Weerawarana
>>>> > <[email protected]> wrote:
>>>> > Isuru I assume you looked at using HttpCore itself to
>>>> > add this - can you point me to the discussion please?
>>>> > Having multiple NIO listeners affects the scaling
>>>> > config right - because normally you have n IO handling
>>>> > threads if you have n cores .. now you need to watch
>>>> > that across multiple libraries.
>>>> >
>>>> >
>>>> > Sanjiva.
>>>> >
>>>> >
>>>> > On Wed, Jul 16, 2014 at 10:37 AM, Isuru Ranawaka
>>>> > <[email protected]> wrote:
>>>> > Hi Ravi,
>>>> >
>>>> >
>>>> > In Netty-IO, Server Bootstrap uses two
>>>> > EventLoopGroups one for accept connections and
>>>> > other for handle accepted connections.
>>>> > Accepted connections has one to one mapping
>>>> > with EventLoop. EventLoop is like a single
>>>> > Thread which performs all the IO Operations in
>>>> > that connection. So when creating EventLoop it
>>>> > initializes new channel pipeline. Channel
>>>> > pipeline consists of Channel Handlers which
>>>> > has actuall business logic implemented. If
>>>> > Channel Handlers are not state full we can
>>>> > share those handlers with different pipelines.
>>>> > But each connection should have new pipeline
>>>> > and that pipeline handles all the events
>>>> > received from that connection. So sharing
>>>> > pipeline is not possible and it is handle
>>>> > through Netty framework. How ever if we share
>>>> > the pipeline with different connections then
>>>> > if some channel get blocked all the other
>>>> > connections also get blocked.
>>>> >
>>>> >
>>>> > thanks
>>>> >
>>>> > isurur
>>>> >
>>>> >
>>>> >
>>>> > On Tue, Jul 15, 2014 at 6:23 PM, Ravi
>>>> > Undupitiya <[email protected]> wrote:
>>>> > Is it possible to bootstrap multiple
>>>> > ports onto the same pipeline - then do
>>>> > a port to service based dispatching?
>>>> > Would that save more resources instead
>>>> > of bootstrapping a netty server per
>>>> > inbound EP instance? Just my two
>>>> > cents. :)
>>>> >
>>>> >
>>>> > On Tue, Jul 15, 2014 at 10:12 PM,
>>>> > Sandamal Weerasinghe
>>>> > <[email protected]> wrote:
>>>> >
>>>> > Hi all,
>>>> >
>>>> > In order to configure the
>>>> > inbound endpoint, a
>>>> > configuration similar to the
>>>> > following should be put in a
>>>> > synapse.xml file inside the
>>>> >
>>>> {ESB_HOME}/repository/deployment/server/synapse-configs/default/inbound-endpoints
>>>> folder
>>>> >
>>>> >
>>>> > <inboundEndpoint
>>>> > name="HttpListenerEP"
>>>> > protocol="http"
>>>> > interval="1000"
>>>> > suspend="false"
>>>> > sequence="main"
>>>> > onError="fault"
>>>> > outsequence="TestOut">
>>>> > <p:parameters
>>>> > xmlns:p="
>>>> http://ws.apache.org/ns/synapse">
>>>> > <p:parameter
>>>> >
>>>> name="inbound.http.port">8081</p:parameter>
>>>> > </p:parameters>
>>>> > </inboundEndpoint>
>>>> >
>>>> >
>>>> > Thanks.
>>>> >
>>>> > Sandamal
>>>> > Weerasinghe | Software
>>>> > Engineer | WSO2 Lanka (Pvt)
>>>> > Ltd
>>>> >
>>>> >
>>>> >
>>>> > On Tue, Jul 15, 2014 at 5:26
>>>> > PM, Isuru Ranawaka
>>>> > <[email protected]> wrote:
>>>> > hi all,
>>>> >
>>>> >
>>>> > Following is the
>>>> > architecture and
>>>> > operation of the Http
>>>> > Inbound Endpoint
>>>> > implementing using
>>>> > Netty in ESB.
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > Operation
>>>> >
>>>> > * Configure the
>>>> > inbound
>>>> > endpoint in
>>>> > synapse.xml
>>>> > * Start ESB and
>>>>
>>>> > it will listen
>>>> > for http port
>>>> > configured in
>>>> > inbound
>>>> > configuration.
>>>> > Request Path
>>>> > * HttpRequests
>>>> > are received
>>>> > to
>>>> >
>>>> InboundTransportSourceHandler and InboundSourceRequest Objects are created
>>>> for each and every message received.
>>>> > * Send
>>>> >
>>>> InboundSourceRequest Objects to InboundServerWorker for create Synapse
>>>> Message Context out of HttpRequests and inject Message Context in to
>>>> insequence specified by user.
>>>> > Response Path
>>>> > * Inject
>>>>
>>>> > response to
>>>> > the out
>>>> > sequence
>>>> > specified by
>>>> > the user.
>>>> > * Received
>>>> > mediated
>>>> > response
>>>> > Message
>>>> > Context before
>>>> > send to the
>>>> > PTT Source
>>>> > Handler and
>>>> > directly send
>>>> > to the Client
>>>> > by creating
>>>> > HttpResponse
>>>> > out of
>>>> > response
>>>> >
>>>> SynapseMessageContext.
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > thanks
>>>> >
>>>> > isurur
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> _______________________________________________
>>>> > Architecture mailing list
>>>> > [email protected]
>>>> >
>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Ravi Undupitiya
>>>> > Senior Software
>>>> > Engineer; WSO2 http://wso2.com
>>>> >
>>>> >
>>>> > E-mail: [email protected]
>>>> > M: +94 772 930 712
>>>> >
>>>> > Lean . Enterprise . Middleware
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Regards
>>>> >
>>>> > Isuru Ranawaka
>>>> >
>>>> > phone :- +94714629880
>>>> >
>>>> >
>>>> >
>>>> _______________________________________________
>>>> > Architecture mailing list
>>>> > [email protected]
>>>> >
>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> >
>>>> > Sanjiva Weerawarana, Ph.D.
>>>> > Founder, Chairman & CEO; WSO2, Inc.;
>>>> http://wso2.com/
>>>> > email: [email protected]; office: (+1 650 745 4499 |
>>>> > +94 11 214 5345) x5700; cell: +94 77 787 6880 | +1
>>>> > 408 466 5099; voip: +1 650 265 8311
>>>> > blog: http://sanjiva.weerawarana.org/; twitter:
>>>> > @sanjiva
>>>> >
>>>> > Lean . Enterprise . Middleware
>>>> >
>>>> > _______________________________________________
>>>> > Architecture mailing list
>>>> > [email protected]
>>>> >
>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> >
>>>> > Kasun Indrasiri
>>>> > Software Architect
>>>> > WSO2, Inc.; http://wso2.com
>>>> > lean.enterprise.middleware
>>>> >
>>>> > cell: +94 77 556 5206
>>>> > Blog : http://kasunpanorama.blogspot.com/
>>>> >
>>>> > _______________________________________________
>>>> > Architecture mailing list
>>>> > [email protected]
>>>> > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Sanjiva Weerawarana, Ph.D.
>>>> > Founder, Chairman & CEO; WSO2, Inc.; http://wso2.com/
>>>> > email: [email protected]; office: (+1 650 745 4499 | +94 11 214 5345)
>>>> > x5700; cell: +94 77 787 6880 | +1 408 466 5099; voip: +1 650 265 8311
>>>> > blog: http://sanjiva.weerawarana.org/; twitter: @sanjiva
>>>> > Lean . Enterprise . Middleware
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Sanjiva Weerawarana, Ph.D.
>>> Founder, Chairman & CEO; WSO2, Inc.; http://wso2.com/
>>> email: [email protected]; office: (+1 650 745 4499 | +94 11 214 5345)
>>> x5700; cell: +94 77 787 6880 | +1 408 466 5099; voip: +1 650 265 8311
>>> blog: http://sanjiva.weerawarana.org/; twitter: @sanjiva
>>> Lean . Enterprise . Middleware
>>>
>>> _______________________________________________
>>> Architecture mailing list
>>> [email protected]
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> Regards
>> Isuru Ranawaka
>> phone :- +94714629880
>>
>> _______________________________________________
>> Architecture mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> Kasun Indrasiri
> Software Architect
> WSO2, Inc.; http://wso2.com
> lean.enterprise.middleware
>
> cell: +94 77 556 5206
> Blog : http://kasunpanorama.blogspot.com/
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>
--
Regards
Isuru Ranawaka
phone :- +94714629880
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture