You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Jørgen Nordmoen <no...@gmail.com> on 2012/02/09 13:25:48 UTC

Support for DiffServ with Http transport

Hello.

Long explenation: We are a group of students tasked with creating a
system which is able to prioritize messages in a network, our customer
has asked us to use WSO2 ESB which is, as you most likely know, just
Apache Synapse. We have one strict demand from the customer and that is
that our system must be able to set the DiffServ field in the IP
header. The system must be able to accept SOAP messages and forward
them to a GlassFish server with the final endpoints. And here is our
problem, since Synapse does not directly support DiffServ or TOS we
need to implement it, but after much research we are still not quite
sure how to do this and that is why this emails is sent. We have some
leads on where we could alter,
org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor could be
extended in order to obtain the DiffServ value from the MessageContext
and then alter the Socket connection, but we are not quite sure as we
don't have the overview needed.

Question: 
Is there a way we could alter Synapse, Axis 2 and/or
HTTPCommons in order for us to support setting different DiffServ
values to different clients? Hopefully we could alter something which
we could either reach or interact with from a mediator which we have to
write a cuple of anyway.

Best regards.
Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>


Re: Support for DiffServ with Http transport

Posted by indika kumara <in...@gmail.com>.
Thanks for the offer.... It is always better to create JIRA issues and
provide patches. Developers @ correspond projects will review
your solutions / patches and make suggestions / improvements if needed
(hopefully constructive). BTW, I am not an active developer now and will
not be in near future.. So, I will not be able to give any concrete
feedback about your patches, etc.

Thanks,

Indika

On Wed, Feb 15, 2012 at 12:51 AM, Jørgen Nordmoen <no...@gmail.com>wrote:

> **
> Thanks for the patience Indika.
>
> This solution seems to be just what we were looking for!
>
> Since we are currently in the planning stages of this project we won't
> implement anything yet, but here is what we are thinking so far:
>
>    - org.apache.http.nio.reactor.IOSession
>       - setTrafficClass(int diffserv);
>          - channel.getsocket().setTrafficClass(int tos)
>       - int getTrafficClass();
>    - org.apache.http.impl.nio.NHttpConnectionBase
>       - setTrafficClass(int diffserv);
>          - session.setTrafficClass(int diffserv)
>       - int getTrafficClass();
>    - org.apache.synapse.transports.nhttp.HttpCoreNIOSender
>       - edit sendAsyncResponse()
>       - Here we have access to both MessageContect(Axis2MessageContext)
>       and NHttpServerConnection(extends NHttpConnectionBase) (worker.getConn())
>    - Hopefully we can add properties in the Synapse MessageContext which
>    effects the Axis2 MessageContext
>       - Add our own DiffServ property which can be retrieved in
>       HttpCoreNIOSender
>
> An additional thought now is whether or not we should push this
> upstream. So the question for you guys is if you want this additions
> upstream or if you feel they are too niche. If you want we could open
> an Issue both in Synapse and in HTTPComponents and add our patch when
> it is done.
>
>   --
> Best regards.
> Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
>
>   On on., 2012-02-15 at 00:07 +1100, indika kumara wrote:
>
> For your case, i.e., client <-> server, 'Server Handler' is the correct
> one. Look for 'sendAsyncResponse' in 'HttpCoreNIOSender'(synapse) which has
> access to 'NHttpServerConnection' (httpcore) and current Message Context.
>
>
>
>  ~ Indika
>
>  On Tue, Feb 14, 2012 at 11:17 PM, Jørgen Nordmoen <no...@gmail.com>
> wrote:
>
>  Thanks for all the feedback so far.
>
> What you have described is exactly what we want.
>
> Here is a image of how our setup will be:
>
> https://docs.google.com/drawings/pub?id=1VfzUCzqzVwIGF8qv8xlGY0hBqO9D822l1wVy6adn-bw&w=863&h=237
> The ESB will act as a proxy for services published on GlassFish, what
> we need to do is mediate messages from the GlassFish services to the
> clients and determin their priority in the network, then we have to
> alter the traffic class of the "Client server connection" to correspond
> with the right priority. Thanks to Indika we found these classes which
> we can modify:
>
>    - org.apache.http.nio.reactor.IOSession
>       - setTrafficClass(int diffserv);
>          - channel.getsocket()
>       - int getTrafficClass();
>    - org.apache.http.impl.nio.NHttpConnectionBase
>       - setTrafficClass(int diffserv);
>          - session.setTrafficClass(int diffserv)
>       - int getTrafficClass();
>
> But we are a bit confused as to the class "ClientHandler" which seems
> to send request from clients to endpoints, which in our illustration
> would be from Synapse to GlassFish. If anyone could clarify if this is
> right or wrong would be much appreciated. If this is right then I guess
> we have to alter "ServerHandler", but that doesn't seem to get any
> parameters which we could alter to include the needed QoS information.
>
>

Re: Support for DiffServ with Http transport

Posted by Jørgen Nordmoen <no...@gmail.com>.
Thanks for the patience Indika.

This solution seems to be just what we were looking for!

Since we are currently in the planning stages of this project we won't
implement anything yet, but here is what we are thinking so far:

      * org.apache.http.nio.reactor.IOSession
              * setTrafficClass(int diffserv);
                      * channel.getsocket().setTrafficClass(int tos)
              * int getTrafficClass();
      * org.apache.http.impl.nio.NHttpConnectionBase
              * setTrafficClass(int diffserv);
                      * session.setTrafficClass(int diffserv)
              * int getTrafficClass();
      * org.apache.synapse.transports.nhttp.HttpCoreNIOSender
              * edit sendAsyncResponse()
              * Here we have access to both
                MessageContect(Axis2MessageContext) and
                NHttpServerConnection(extends NHttpConnectionBase)
                (worker.getConn())
      * Hopefully we can add properties in the Synapse MessageContext
        which effects the Axis2 MessageContext
              * Add our own DiffServ property which can be retrieved in
                HttpCoreNIOSender

An additional thought now is whether or not we should push this
upstream. So the question for you guys is if you want this additions
upstream or if you feel they are too niche. If you want we could open
an Issue both in Synapse and in HTTPComponents and add our patch when
it is done.
-- 
Best regards.
Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com> 

On on., 2012-02-15 at 00:07 +1100, indika kumara wrote:

> For your case, i.e., client <-> server, 'Server Handler' is the
> correct one. Look for 'sendAsyncResponse' in
> 'HttpCoreNIOSender'(synapse) which has access to
> 'NHttpServerConnection' (httpcore) and current Message Context. 
> 
> 
> 
> ~ Indika
> 
> 
> On Tue, Feb 14, 2012 at 11:17 PM, Jørgen Nordmoen
> <no...@gmail.com> wrote:
> 
>         Thanks for all the feedback so far.
>         
>         What you have described is exactly what we want.
>         
>         Here is a image of how our setup will be:
>         https://docs.google.com/drawings/pub?id=1VfzUCzqzVwIGF8qv8xlGY0hBqO9D822l1wVy6adn-bw&w=863&h=237
>         The ESB will act as a proxy for services published on
>         GlassFish, what
>         we need to do is mediate messages from the GlassFish services
>         to the
>         clients and determin their priority in the network, then we
>         have to
>         alter the traffic class of the "Client server connection" to
>         correspond
>         with the right priority. Thanks to Indika we found these
>         classes which
>         we can modify: 
>               * org.apache.http.nio.reactor.IOSession 
>                       * setTrafficClass(int diffserv); 
>                               * channel.getsocket() 
>                       * int getTrafficClass(); 
>               * org.apache.http.impl.nio.NHttpConnectionBase 
>                       * setTrafficClass(int diffserv); 
>                               * session.setTrafficClass(int diffserv) 
>                       * int getTrafficClass(); 
>         But we are a bit confused as to the class "ClientHandler"
>         which seems
>         to send request from clients to endpoints, which in our
>         illustration
>         would be from Synapse to GlassFish. If anyone could clarify if
>         this is
>         right or wrong would be much appreciated. If this is right
>         then I guess
>         we have to alter "ServerHandler", but that doesn't seem to get
>         any
>         parameters which we could alter to include the needed QoS
>         information.
>         

Re: Support for DiffServ with Http transport

Posted by indika kumara <in...@gmail.com>.
For your case, i.e., client <-> server, 'Server Handler' is the correct
one. Look for 'sendAsyncResponse' in 'HttpCoreNIOSender'(synapse) which has
access to 'NHttpServerConnection' (httpcore) and current Message Context.

~ Indika

On Tue, Feb 14, 2012 at 11:17 PM, Jørgen Nordmoen <no...@gmail.com>wrote:

> **
> Thanks for all the feedback so far.
>
> What you have described is exactly what we want.
>
> Here is a image of how our setup will be:
>
> https://docs.google.com/drawings/pub?id=1VfzUCzqzVwIGF8qv8xlGY0hBqO9D822l1wVy6adn-bw&w=863&h=237
> The ESB will act as a proxy for services published on GlassFish, what
> we need to do is mediate messages from the GlassFish services to the
> clients and determin their priority in the network, then we have to
> alter the traffic class of the "Client server connection" to correspond
> with the right priority. Thanks to Indika we found these classes which
> we can modify:
>
>    - org.apache.http.nio.reactor.IOSession
>       - setTrafficClass(int diffserv);
>          - channel.getsocket()
>       - int getTrafficClass();
>    - org.apache.http.impl.nio.NHttpConnectionBase
>       - setTrafficClass(int diffserv);
>          - session.setTrafficClass(int diffserv)
>       - int getTrafficClass();
>
> But we are a bit confused as to the class "ClientHandler" which seems
> to send request from clients to endpoints, which in our illustration
> would be from Synapse to GlassFish. If anyone could clarify if this is
> right or wrong would be much appreciated. If this is right then I guess
> we have to alter "ServerHandler", but that doesn't seem to get any
> parameters which we could alter to include the needed QoS information.
>   --
> Best regards.
> Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
>
> On ti., 2012-02-14 at 16:52 +1100, indika
>
> kumara wrote:
>
>
> ~ Indika
>
>
>  On Tue, Feb 14, 2012 at 3:53 PM, Hiranya Jayathilaka <
> hiranya911@gmail.com> wrote:
>
> I think this needs to be implemented almost entirely at the NHTTP
> transport level. You can load a set of hostname-to-traffic class mappings
> from a transport receiver parameter. Then as Oleg pointed out you can set
> the appropriate class requirements on the socket in the prepareSocket
> method of an extended DefaultConnectingIOReactor impl.
>
>
>
>   Thanks,
>
>   Hiranya
>
>
>
>   On Mon, Feb 13, 2012 at 6:03 PM, Jørgen Nordmoen <no...@gmail.com>
> wrote:
>
>   Thanks for the clarification Oleg and appologies for the duplicate
> message in the HC mailing list.
>
> Currently the bind method seems like our best bet since we need to
> change the traffic class on each client connection, but we are having a
> bit of a problem finding a way to interact between a mediator and the
> ClientConnection. We have traced where a message is sent from the send
> mediator:
> org.apache.synapse.mediators.builtin.SendMediator.mediate()
> org.apache.synapse.endpoints.Endpoint.send()
> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send()
> org.apache.synapse.core.axis2.Axis2Sender.sendBack()
> org.apache.axis2.engine.AxisEngine.send()
> org.apache.synapse.transport.nhttp.HttpCoreNIOSender.invoke()
>
> The problem is that we can't find  a connection between the actual
> connection and the message. The message context is sent quite far down,
> and is then replaced by an Axis2MessageContext, but they don't seem to
> have any effect on the connecton. So is this route right when it comes to
> where messages are sent?
>
>
> Best regards.
> Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
>
>
>    On fr., 2012-02-10 at 11:42 +0100, Oleg Kalnichevski wrote:
>
> On Fri, 2012-02-10 at 11:24 +0100, Jørgen Nordmoen wrote:
> > Thank you for your reply.
> >
> > Setting the traffic class is exactly what we need. We have to do that
> > to every client connection, but also need to have control over what is
> > set for each connection as the clients will get different priority
> > based on our parameters.
> >
> > We have looked into the classes you suggested, but we can't find any
> > 'bind' method or anything related to the sending socket.
> >
> > Best regards.
>
> Jørgen
>
> The #bind method Indika is referring to is available in the 4.2 (DEV)
> branch of HttpCore. So, you need to make sure you are using the latest
> HttpCore release (4.2-beta1)
>
> Alternatively, you could use the #prepareSocket method of the I/O
> reactor class to modify properties of newly created sockets.
>
> Hope this helps
>
> Oleg
>
> > Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
> > On fr., 2012-02-10 at 14:22 +1100, indika kumara wrote:
> > > Hi,
> > >
> > >
> > > Would setTrafficClass(int tc) of java Socket API work for you?
> > >
> > >
> > > You can access the connecting Socket by overrideing 'bind' of
> > > DefaultNHttpClientConnection (httpcore) in
> > > LoggingNHttpClientConnection (synapse) and set tranffic class
> > >
> > >
> > > Also, you can modify 'bind' method of DefaultNHttpClientConnection
> > > (httpcore) to set traficclass using provided http parameters of
> > > 'bind' method.
> > >
> > >
> > > Note: I do not have a good knowledge abut httpcore. So, I may wrong.
> > > Please check with them.
> > >
> > >
> > > Thanks,
> > >
> > >
> > > Indika
> > >
> > > 2012/2/9 Jørgen Nordmoen <no...@gmail.com>
> > >         Hello.
> > >
> > >         Long explenation: We are a group of students tasked with
> > >         creating a
> > >         system which is able to prioritize messages in a network,
> > >         our customer
> > >         has asked us to use WSO2 ESB which is, as you most likely
> > >         know, just
> > >         Apache Synapse. We have one strict demand from the customer
> > >         and that is
> > >         that our system must be able to set the DiffServ field in
> > >         the IP
> > >         header. The system must be able to accept SOAP messages and
> > >         forward
> > >         them to a GlassFish server with the final endpoints. And
> > >         here is our
> > >         problem, since Synapse does not directly support DiffServ or
> > >         TOS we
> > >         need to implement it, but after much research we are still
> > >         not quite
> > >         sure how to do this and that is why this emails is sent. We
> > >         have some
> > >         leads on where we could alter,
> > >         org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor
> > >         could be
> > >         extended in order to obtain the DiffServ value from the
> > >         MessageContext
> > >         and then alter the Socket connection, but we are not quite
> > >         sure as we
> > >         don't have the overview needed.
> > >
> > >         Question:
> > >         Is there a way we could alter Synapse, Axis 2 and/or
> > >         HTTPCommons in order for us to support setting different
> > >         DiffServ
> > >         values to different clients? Hopefully we could alter
> > >         something which
> > >         we could either reach or interact with from a mediator which
> > >         we have to
> > >         write a cuple of anyway.
> > >
> > >         Best regards.
> > >         Jørgen Nordmoen <jo...@stud.ntnu.no>,
> > >         <no...@gmail.com>
> > >
> > >
> > >
> > >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
>
>
>
>
>
>
>   --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.;  http://wso2.org
> E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
>
>
>

Re: Support for DiffServ with Http transport

Posted by Jørgen Nordmoen <no...@gmail.com>.
Thanks for all the feedback so far.

What you have described is exactly what we want.

Here is a image of how our setup will be:
https://docs.google.com/drawings/pub?id=1VfzUCzqzVwIGF8qv8xlGY0hBqO9D822l1wVy6adn-bw&w=863&h=237
The ESB will act as a proxy for services published on GlassFish, what
we need to do is mediate messages from the GlassFish services to the
clients and determin their priority in the network, then we have to
alter the traffic class of the "Client server connection" to correspond
with the right priority. Thanks to Indika we found these classes which
we can modify:

      * org.apache.http.nio.reactor.IOSession
              * setTrafficClass(int diffserv);
                      * channel.getsocket()
              * int getTrafficClass();
      * org.apache.http.impl.nio.NHttpConnectionBase
              * setTrafficClass(int diffserv);
                      * session.setTrafficClass(int diffserv)
              * int getTrafficClass();

But we are a bit confused as to the class "ClientHandler" which seems
to send request from clients to endpoints, which in our illustration
would be from Synapse to GlassFish. If anyone could clarify if this is
right or wrong would be much appreciated. If this is right then I guess
we have to alter "ServerHandler", but that doesn't seem to get any
parameters which we could alter to include the needed QoS information.
-- 
Best regards.
Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com> 

On ti., 2012-02-14 at 16:52 +1100, indika
kumara wrote:

> 
> ~ Indika
> 
> 
> 
> On Tue, Feb 14, 2012 at 3:53 PM, Hiranya Jayathilaka
> <hi...@gmail.com> wrote:
> 
>         I think this needs to be implemented almost entirely at the
>         NHTTP transport level. You can load a set of
>         hostname-to-traffic class mappings from a transport receiver
>         parameter. Then as Oleg pointed out you can set the
>         appropriate class requirements on the socket in the
>         prepareSocket method of an extended DefaultConnectingIOReactor
>         impl.
>         
>         
>         
>         Thanks,
>         Hiranya
>         
>         
>         
>         
>         On Mon, Feb 13, 2012 at 6:03 PM, Jørgen Nordmoen
>         <no...@gmail.com> wrote:
>         
>                 Thanks for the clarification Oleg and appologies for
>                 the duplicate
>                 message in the HC mailing list.
>                 
>                 Currently the bind method seems like our best bet
>                 since we need to
>                 change the traffic class on each client connection,
>                 but we are having a
>                 bit of a problem finding a way to interact between a
>                 mediator and the
>                 ClientConnection. We have traced where a message is
>                 sent from the send
>                 mediator:
>                 org.apache.synapse.mediators.builtin.SendMediator.mediate()
>                 org.apache.synapse.endpoints.Endpoint.send()
>                 org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send()
>                 org.apache.synapse.core.axis2.Axis2Sender.sendBack()
>                 org.apache.axis2.engine.AxisEngine.send()
>                 org.apache.synapse.transport.nhttp.HttpCoreNIOSender.invoke()
>                 
>                 The problem is that we can't find  a connection
>                 between the actual
>                 connection and the message. The message context is
>                 sent quite far down,
>                 and is then replaced by an Axis2MessageContext, but
>                 they don't seem to
>                 have any effect on the connecton. So is this route
>                 right when it comes to
>                 where messages are sent? 
>                 
>                 
>                 Best regards.
>                 Jørgen Nordmoen <jo...@stud.ntnu.no>,
>                 <no...@gmail.com>
>                 
>                 
>                 On fr., 2012-02-10 at 11:42 +0100, Oleg Kalnichevski
>                 wrote: 
>                 
>                 > On Fri, 2012-02-10 at 11:24 +0100, Jørgen Nordmoen wrote:
>                 > > Thank you for your reply.
>                 > > 
>                 > > Setting the traffic class is exactly what we need. We have to do that
>                 > > to every client connection, but also need to have control over what is
>                 > > set for each connection as the clients will get different priority
>                 > > based on our parameters. 
>                 > > 
>                 > > We have looked into the classes you suggested, but we can't find any
>                 > > 'bind' method or anything related to the sending socket.
>                 > > 
>                 > > Best regards.
>                 > 
>                 > Jørgen
>                 > 
>                 > The #bind method Indika is referring to is available in the 4.2 (DEV)
>                 > branch of HttpCore. So, you need to make sure you are using the latest
>                 > HttpCore release (4.2-beta1)
>                 > 
>                 > Alternatively, you could use the #prepareSocket method of the I/O
>                 > reactor class to modify properties of newly created sockets.
>                 > 
>                 > Hope this helps
>                 > 
>                 > Oleg
>                 > 
>                 > > Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
>                 > > On fr., 2012-02-10 at 14:22 +1100, indika kumara wrote:
>                 > > > Hi,
>                 > > > 
>                 > > > 
>                 > > > Would setTrafficClass(int tc) of java Socket API work for you?
>                 > > > 
>                 > > > 
>                 > > > You can access the connecting Socket by overrideing 'bind' of
>                 > > > DefaultNHttpClientConnection (httpcore) in
>                 > > > LoggingNHttpClientConnection (synapse) and set tranffic class
>                 > > > 
>                 > > > 
>                 > > > Also, you can modify 'bind' method of DefaultNHttpClientConnection
>                 > > > (httpcore) to set traficclass using provided http parameters of
>                 > > > 'bind' method.
>                 > > > 
>                 > > > 
>                 > > > Note: I do not have a good knowledge abut httpcore. So, I may wrong.
>                 > > > Please check with them.
>                 > > > 
>                 > > > 
>                 > > > Thanks,
>                 > > > 
>                 > > > 
>                 > > > Indika
>                 > > > 
>                 > > > 2012/2/9 Jørgen Nordmoen <no...@gmail.com>
>                 > > >         Hello.
>                 > > >         
>                 > > >         Long explenation: We are a group of students tasked with
>                 > > >         creating a
>                 > > >         system which is able to prioritize messages in a network,
>                 > > >         our customer
>                 > > >         has asked us to use WSO2 ESB which is, as you most likely
>                 > > >         know, just
>                 > > >         Apache Synapse. We have one strict demand from the customer
>                 > > >         and that is
>                 > > >         that our system must be able to set the DiffServ field in
>                 > > >         the IP
>                 > > >         header. The system must be able to accept SOAP messages and
>                 > > >         forward
>                 > > >         them to a GlassFish server with the final endpoints. And
>                 > > >         here is our
>                 > > >         problem, since Synapse does not directly support DiffServ or
>                 > > >         TOS we
>                 > > >         need to implement it, but after much research we are still
>                 > > >         not quite
>                 > > >         sure how to do this and that is why this emails is sent. We
>                 > > >         have some
>                 > > >         leads on where we could alter,
>                 > > >         org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor
>                 > > >         could be
>                 > > >         extended in order to obtain the DiffServ value from the
>                 > > >         MessageContext
>                 > > >         and then alter the Socket connection, but we are not quite
>                 > > >         sure as we
>                 > > >         don't have the overview needed.
>                 > > >         
>                 > > >         Question: 
>                 > > >         Is there a way we could alter Synapse, Axis 2 and/or
>                 > > >         HTTPCommons in order for us to support setting different
>                 > > >         DiffServ
>                 > > >         values to different clients? Hopefully we could alter
>                 > > >         something which
>                 > > >         we could either reach or interact with from a mediator which
>                 > > >         we have to
>                 > > >         write a cuple of anyway.
>                 > > >         
>                 > > >         Best regards.
>                 > > >         Jørgen Nordmoen <jo...@stud.ntnu.no>,
>                 > > >         <no...@gmail.com>
>                 > > >         
>                 > > >         
>                 > > > 
>                 > > > 
>                 > > 
>                 > 
>                 > 
>                 > 
>                 > ---------------------------------------------------------------------
>                 > To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>                 > For additional commands, e-mail: dev-help@synapse.apache.org
>                 
>                 
>                 
>                 
>         
>         
>         
>         
>         
>         
>         
>         -- 
>         Hiranya Jayathilaka
>         Associate Technical Lead;
>         WSO2 Inc.;  http://wso2.org
>         E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
>         Blog: http://techfeast-hiranya.blogspot.com
>         
> 
> 
> 

Re: Support for DiffServ with Http transport

Posted by indika kumara <in...@gmail.com>.
I think usually the traffic class is determined based on the
client/user/tenant class. Usually it is needed to classify the incoming
requests from users into classes(e.g., gold, silver, etc) and use that
information to set the traffic class in the network channel. In that case,
the traffic class needs to be determined per request. BTW,
it depends on the use case.

~ Indika

On Tue, Feb 14, 2012 at 3:53 PM, Hiranya Jayathilaka
<hi...@gmail.com>wrote:

> I think this needs to be implemented almost entirely at the NHTTP
> transport level. You can load a set of hostname-to-traffic class mappings
> from a transport receiver parameter. Then as Oleg pointed out you can set
> the appropriate class requirements on the socket in the prepareSocket
> method of an extended DefaultConnectingIOReactor impl.
>
> Thanks,
> Hiranya
>
>
> On Mon, Feb 13, 2012 at 6:03 PM, Jørgen Nordmoen <no...@gmail.com>wrote:
>
>> **
>> Thanks for the clarification Oleg and appologies for the duplicate
>> message in the HC mailing list.
>>
>> Currently the bind method seems like our best bet since we need to
>> change the traffic class on each client connection, but we are having a
>> bit of a problem finding a way to interact between a mediator and the
>> ClientConnection. We have traced where a message is sent from the send
>> mediator:
>> org.apache.synapse.mediators.builtin.SendMediator.mediate()
>> org.apache.synapse.endpoints.Endpoint.send()
>> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send()
>> org.apache.synapse.core.axis2.Axis2Sender.sendBack()
>> org.apache.axis2.engine.AxisEngine.send()
>> org.apache.synapse.transport.nhttp.HttpCoreNIOSender.invoke()
>>
>> The problem is that we can't find  a connection between the actual
>> connection and the message. The message context is sent quite far down,
>> and is then replaced by an Axis2MessageContext, but they don't seem to
>> have any effect on the connecton. So is this route right when it comes to
>> where messages are sent?
>>
>> Best regards.
>> Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
>>
>> On fr., 2012-02-10 at 11:42 +0100, Oleg Kalnichevski wrote:
>>
>> On Fri, 2012-02-10 at 11:24 +0100, Jørgen Nordmoen wrote:
>> > Thank you for your reply.
>> >
>> > Setting the traffic class is exactly what we need. We have to do that
>> > to every client connection, but also need to have control over what is
>> > set for each connection as the clients will get different priority
>> > based on our parameters.
>> >
>> > We have looked into the classes you suggested, but we can't find any
>> > 'bind' method or anything related to the sending socket.
>> >
>> > Best regards.
>>
>> Jørgen
>>
>> The #bind method Indika is referring to is available in the 4.2 (DEV)
>> branch of HttpCore. So, you need to make sure you are using the latest
>> HttpCore release (4.2-beta1)
>>
>> Alternatively, you could use the #prepareSocket method of the I/O
>> reactor class to modify properties of newly created sockets.
>>
>> Hope this helps
>>
>> Oleg
>>
>> > Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
>> > On fr., 2012-02-10 at 14:22 +1100, indika kumara wrote:
>> > > Hi,
>> > >
>> > >
>> > > Would setTrafficClass(int tc) of java Socket API work for you?
>> > >
>> > >
>> > > You can access the connecting Socket by overrideing 'bind' of
>> > > DefaultNHttpClientConnection (httpcore) in
>> > > LoggingNHttpClientConnection (synapse) and set tranffic class
>> > >
>> > >
>> > > Also, you can modify 'bind' method of DefaultNHttpClientConnection
>> > > (httpcore) to set traficclass using provided http parameters of
>> > > 'bind' method.
>> > >
>> > >
>> > > Note: I do not have a good knowledge abut httpcore. So, I may wrong.
>> > > Please check with them.
>> > >
>> > >
>> > > Thanks,
>> > >
>> > >
>> > > Indika
>> > >
>> > > 2012/2/9 Jørgen Nordmoen <no...@gmail.com>
>> > >         Hello.
>> > >
>> > >         Long explenation: We are a group of students tasked with
>> > >         creating a
>> > >         system which is able to prioritize messages in a network,
>> > >         our customer
>> > >         has asked us to use WSO2 ESB which is, as you most likely
>> > >         know, just
>> > >         Apache Synapse. We have one strict demand from the customer
>> > >         and that is
>> > >         that our system must be able to set the DiffServ field in
>> > >         the IP
>> > >         header. The system must be able to accept SOAP messages and
>> > >         forward
>> > >         them to a GlassFish server with the final endpoints. And
>> > >         here is our
>> > >         problem, since Synapse does not directly support DiffServ or
>> > >         TOS we
>> > >         need to implement it, but after much research we are still
>> > >         not quite
>> > >         sure how to do this and that is why this emails is sent. We
>> > >         have some
>> > >         leads on where we could alter,
>> > >         org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor
>> > >         could be
>> > >         extended in order to obtain the DiffServ value from the
>> > >         MessageContext
>> > >         and then alter the Socket connection, but we are not quite
>> > >         sure as we
>> > >         don't have the overview needed.
>> > >
>> > >         Question:
>> > >         Is there a way we could alter Synapse, Axis 2 and/or
>> > >         HTTPCommons in order for us to support setting different
>> > >         DiffServ
>> > >         values to different clients? Hopefully we could alter
>> > >         something which
>> > >         we could either reach or interact with from a mediator which
>> > >         we have to
>> > >         write a cuple of anyway.
>> > >
>> > >         Best regards.
>> > >         Jørgen Nordmoen <jo...@stud.ntnu.no>,
>> > >         <no...@gmail.com>
>> > >
>> > >
>> > >
>> > >
>> >
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>>
>>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.;  http://wso2.org
> E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>

Re: Support for DiffServ with Http transport

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
I think this needs to be implemented almost entirely at the NHTTP transport
level. You can load a set of hostname-to-traffic class mappings from a
transport receiver parameter. Then as Oleg pointed out you can set the
appropriate class requirements on the socket in the prepareSocket method of
an extended DefaultConnectingIOReactor impl.

Thanks,
Hiranya

On Mon, Feb 13, 2012 at 6:03 PM, Jørgen Nordmoen <no...@gmail.com>wrote:

> **
> Thanks for the clarification Oleg and appologies for the duplicate
> message in the HC mailing list.
>
> Currently the bind method seems like our best bet since we need to
> change the traffic class on each client connection, but we are having a
> bit of a problem finding a way to interact between a mediator and the
> ClientConnection. We have traced where a message is sent from the send
> mediator:
> org.apache.synapse.mediators.builtin.SendMediator.mediate()
> org.apache.synapse.endpoints.Endpoint.send()
> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send()
> org.apache.synapse.core.axis2.Axis2Sender.sendBack()
> org.apache.axis2.engine.AxisEngine.send()
> org.apache.synapse.transport.nhttp.HttpCoreNIOSender.invoke()
>
> The problem is that we can't find  a connection between the actual
> connection and the message. The message context is sent quite far down,
> and is then replaced by an Axis2MessageContext, but they don't seem to
> have any effect on the connecton. So is this route right when it comes to
> where messages are sent?
>
> Best regards.
> Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
>
> On fr., 2012-02-10 at 11:42 +0100, Oleg Kalnichevski wrote:
>
> On Fri, 2012-02-10 at 11:24 +0100, Jørgen Nordmoen wrote:
> > Thank you for your reply.
> >
> > Setting the traffic class is exactly what we need. We have to do that
> > to every client connection, but also need to have control over what is
> > set for each connection as the clients will get different priority
> > based on our parameters.
> >
> > We have looked into the classes you suggested, but we can't find any
> > 'bind' method or anything related to the sending socket.
> >
> > Best regards.
>
> Jørgen
>
> The #bind method Indika is referring to is available in the 4.2 (DEV)
> branch of HttpCore. So, you need to make sure you are using the latest
> HttpCore release (4.2-beta1)
>
> Alternatively, you could use the #prepareSocket method of the I/O
> reactor class to modify properties of newly created sockets.
>
> Hope this helps
>
> Oleg
>
> > Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
> > On fr., 2012-02-10 at 14:22 +1100, indika kumara wrote:
> > > Hi,
> > >
> > >
> > > Would setTrafficClass(int tc) of java Socket API work for you?
> > >
> > >
> > > You can access the connecting Socket by overrideing 'bind' of
> > > DefaultNHttpClientConnection (httpcore) in
> > > LoggingNHttpClientConnection (synapse) and set tranffic class
> > >
> > >
> > > Also, you can modify 'bind' method of DefaultNHttpClientConnection
> > > (httpcore) to set traficclass using provided http parameters of
> > > 'bind' method.
> > >
> > >
> > > Note: I do not have a good knowledge abut httpcore. So, I may wrong.
> > > Please check with them.
> > >
> > >
> > > Thanks,
> > >
> > >
> > > Indika
> > >
> > > 2012/2/9 Jørgen Nordmoen <no...@gmail.com>
> > >         Hello.
> > >
> > >         Long explenation: We are a group of students tasked with
> > >         creating a
> > >         system which is able to prioritize messages in a network,
> > >         our customer
> > >         has asked us to use WSO2 ESB which is, as you most likely
> > >         know, just
> > >         Apache Synapse. We have one strict demand from the customer
> > >         and that is
> > >         that our system must be able to set the DiffServ field in
> > >         the IP
> > >         header. The system must be able to accept SOAP messages and
> > >         forward
> > >         them to a GlassFish server with the final endpoints. And
> > >         here is our
> > >         problem, since Synapse does not directly support DiffServ or
> > >         TOS we
> > >         need to implement it, but after much research we are still
> > >         not quite
> > >         sure how to do this and that is why this emails is sent. We
> > >         have some
> > >         leads on where we could alter,
> > >         org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor
> > >         could be
> > >         extended in order to obtain the DiffServ value from the
> > >         MessageContext
> > >         and then alter the Socket connection, but we are not quite
> > >         sure as we
> > >         don't have the overview needed.
> > >
> > >         Question:
> > >         Is there a way we could alter Synapse, Axis 2 and/or
> > >         HTTPCommons in order for us to support setting different
> > >         DiffServ
> > >         values to different clients? Hopefully we could alter
> > >         something which
> > >         we could either reach or interact with from a mediator which
> > >         we have to
> > >         write a cuple of anyway.
> > >
> > >         Best regards.
> > >         Jørgen Nordmoen <jo...@stud.ntnu.no>,
> > >         <no...@gmail.com>
> > >
> > >
> > >
> > >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
>
>


-- 
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Re: Support for DiffServ with Http transport

Posted by indika kumara <in...@gmail.com>.
Have a look at how we set socket timeout per request.

Look for the follwing code fragemnt in the method 'processConnection'  in
'ClientHandler' (synapse)

 if (axis2Req.getTimeout() > 0) {
                conn.setSocketTimeout(axis2Req.getTimeout());
   }

Then look at how the implementaion at 'NHttpClientConnection' for
'setSocketTimeout' work. The same way you may be able to enforce
traffic-class per request.

~ Indika

On Mon, Feb 13, 2012 at 11:33 PM, Jørgen Nordmoen <no...@gmail.com>wrote:

> **
> Thanks for the clarification Oleg and appologies for the duplicate
> message in the HC mailing list.
>
> Currently the bind method seems like our best bet since we need to
> change the traffic class on each client connection, but we are having a
> bit of a problem finding a way to interact between a mediator and the
> ClientConnection. We have traced where a message is sent from the send
> mediator:
> org.apache.synapse.mediators.builtin.SendMediator.mediate()
> org.apache.synapse.endpoints.Endpoint.send()
> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send()
> org.apache.synapse.core.axis2.Axis2Sender.sendBack()
> org.apache.axis2.engine.AxisEngine.send()
> org.apache.synapse.transport.nhttp.HttpCoreNIOSender.invoke()
>
> The problem is that we can't find  a connection between the actual
> connection and the message. The message context is sent quite far down,
> and is then replaced by an Axis2MessageContext, but they don't seem to
> have any effect on the connecton. So is this route right when it comes to
> where messages are sent?
>
> Best regards.
> Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
>
> On fr., 2012-02-10 at 11:42 +0100, Oleg Kalnichevski wrote:
>
> On Fri, 2012-02-10 at 11:24 +0100, Jørgen Nordmoen wrote:
> > Thank you for your reply.
> >
> > Setting the traffic class is exactly what we need. We have to do that
> > to every client connection, but also need to have control over what is
> > set for each connection as the clients will get different priority
> > based on our parameters.
> >
> > We have looked into the classes you suggested, but we can't find any
> > 'bind' method or anything related to the sending socket.
> >
> > Best regards.
>
> Jørgen
>
> The #bind method Indika is referring to is available in the 4.2 (DEV)
> branch of HttpCore. So, you need to make sure you are using the latest
> HttpCore release (4.2-beta1)
>
> Alternatively, you could use the #prepareSocket method of the I/O
> reactor class to modify properties of newly created sockets.
>
> Hope this helps
>
> Oleg
>
> > Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
> > On fr., 2012-02-10 at 14:22 +1100, indika kumara wrote:
> > > Hi,
> > >
> > >
> > > Would setTrafficClass(int tc) of java Socket API work for you?
> > >
> > >
> > > You can access the connecting Socket by overrideing 'bind' of
> > > DefaultNHttpClientConnection (httpcore) in
> > > LoggingNHttpClientConnection (synapse) and set tranffic class
> > >
> > >
> > > Also, you can modify 'bind' method of DefaultNHttpClientConnection
> > > (httpcore) to set traficclass using provided http parameters of
> > > 'bind' method.
> > >
> > >
> > > Note: I do not have a good knowledge abut httpcore. So, I may wrong.
> > > Please check with them.
> > >
> > >
> > > Thanks,
> > >
> > >
> > > Indika
> > >
> > > 2012/2/9 Jørgen Nordmoen <no...@gmail.com>
> > >         Hello.
> > >
> > >         Long explenation: We are a group of students tasked with
> > >         creating a
> > >         system which is able to prioritize messages in a network,
> > >         our customer
> > >         has asked us to use WSO2 ESB which is, as you most likely
> > >         know, just
> > >         Apache Synapse. We have one strict demand from the customer
> > >         and that is
> > >         that our system must be able to set the DiffServ field in
> > >         the IP
> > >         header. The system must be able to accept SOAP messages and
> > >         forward
> > >         them to a GlassFish server with the final endpoints. And
> > >         here is our
> > >         problem, since Synapse does not directly support DiffServ or
> > >         TOS we
> > >         need to implement it, but after much research we are still
> > >         not quite
> > >         sure how to do this and that is why this emails is sent. We
> > >         have some
> > >         leads on where we could alter,
> > >         org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor
> > >         could be
> > >         extended in order to obtain the DiffServ value from the
> > >         MessageContext
> > >         and then alter the Socket connection, but we are not quite
> > >         sure as we
> > >         don't have the overview needed.
> > >
> > >         Question:
> > >         Is there a way we could alter Synapse, Axis 2 and/or
> > >         HTTPCommons in order for us to support setting different
> > >         DiffServ
> > >         values to different clients? Hopefully we could alter
> > >         something which
> > >         we could either reach or interact with from a mediator which
> > >         we have to
> > >         write a cuple of anyway.
> > >
> > >         Best regards.
> > >         Jørgen Nordmoen <jo...@stud.ntnu.no>,
> > >         <no...@gmail.com>
> > >
> > >
> > >
> > >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
>
>

Re: Support for DiffServ with Http transport

Posted by Jørgen Nordmoen <no...@gmail.com>.
Thanks for the clarification Oleg and appologies for the duplicate
message in the HC mailing list.

Currently the bind method seems like our best bet since we need to
change the traffic class on each client connection, but we are having a
bit of a problem finding a way to interact between a mediator and the
ClientConnection. We have traced where a message is sent from the send
mediator:
org.apache.synapse.mediators.builtin.SendMediator.mediate()
org.apache.synapse.endpoints.Endpoint.send()
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send()
org.apache.synapse.core.axis2.Axis2Sender.sendBack()
org.apache.axis2.engine.AxisEngine.send()
org.apache.synapse.transport.nhttp.HttpCoreNIOSender.invoke()

The problem is that we can't find  a connection between the actual
connection and the message. The message context is sent quite far down,
and is then replaced by an Axis2MessageContext, but they don't seem to
have any effect on the connecton. So is this route right when it comes
to
where messages are sent? 

Best regards.
Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>

On fr., 2012-02-10 at 11:42 +0100, Oleg Kalnichevski wrote: 

> On Fri, 2012-02-10 at 11:24 +0100, Jørgen Nordmoen wrote:
> > Thank you for your reply.
> > 
> > Setting the traffic class is exactly what we need. We have to do that
> > to every client connection, but also need to have control over what is
> > set for each connection as the clients will get different priority
> > based on our parameters. 
> > 
> > We have looked into the classes you suggested, but we can't find any
> > 'bind' method or anything related to the sending socket.
> > 
> > Best regards.
> 
> Jørgen
> 
> The #bind method Indika is referring to is available in the 4.2 (DEV)
> branch of HttpCore. So, you need to make sure you are using the latest
> HttpCore release (4.2-beta1)
> 
> Alternatively, you could use the #prepareSocket method of the I/O
> reactor class to modify properties of newly created sockets.
> 
> Hope this helps
> 
> Oleg
> 
> > Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
> > On fr., 2012-02-10 at 14:22 +1100, indika kumara wrote:
> > > Hi,
> > > 
> > > 
> > > Would setTrafficClass(int tc) of java Socket API work for you?
> > > 
> > > 
> > > You can access the connecting Socket by overrideing 'bind' of
> > > DefaultNHttpClientConnection (httpcore) in
> > > LoggingNHttpClientConnection (synapse) and set tranffic class
> > > 
> > > 
> > > Also, you can modify 'bind' method of DefaultNHttpClientConnection
> > > (httpcore) to set traficclass using provided http parameters of
> > > 'bind' method.
> > > 
> > > 
> > > Note: I do not have a good knowledge abut httpcore. So, I may wrong.
> > > Please check with them.
> > > 
> > > 
> > > Thanks,
> > > 
> > > 
> > > Indika
> > > 
> > > 2012/2/9 Jørgen Nordmoen <no...@gmail.com>
> > >         Hello.
> > >         
> > >         Long explenation: We are a group of students tasked with
> > >         creating a
> > >         system which is able to prioritize messages in a network,
> > >         our customer
> > >         has asked us to use WSO2 ESB which is, as you most likely
> > >         know, just
> > >         Apache Synapse. We have one strict demand from the customer
> > >         and that is
> > >         that our system must be able to set the DiffServ field in
> > >         the IP
> > >         header. The system must be able to accept SOAP messages and
> > >         forward
> > >         them to a GlassFish server with the final endpoints. And
> > >         here is our
> > >         problem, since Synapse does not directly support DiffServ or
> > >         TOS we
> > >         need to implement it, but after much research we are still
> > >         not quite
> > >         sure how to do this and that is why this emails is sent. We
> > >         have some
> > >         leads on where we could alter,
> > >         org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor
> > >         could be
> > >         extended in order to obtain the DiffServ value from the
> > >         MessageContext
> > >         and then alter the Socket connection, but we are not quite
> > >         sure as we
> > >         don't have the overview needed.
> > >         
> > >         Question: 
> > >         Is there a way we could alter Synapse, Axis 2 and/or
> > >         HTTPCommons in order for us to support setting different
> > >         DiffServ
> > >         values to different clients? Hopefully we could alter
> > >         something which
> > >         we could either reach or interact with from a mediator which
> > >         we have to
> > >         write a cuple of anyway.
> > >         
> > >         Best regards.
> > >         Jørgen Nordmoen <jo...@stud.ntnu.no>,
> > >         <no...@gmail.com>
> > >         
> > >         
> > > 
> > > 
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org




Re: Support for DiffServ with Http transport

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2012-02-10 at 11:24 +0100, Jørgen Nordmoen wrote:
> Thank you for your reply.
> 
> Setting the traffic class is exactly what we need. We have to do that
> to every client connection, but also need to have control over what is
> set for each connection as the clients will get different priority
> based on our parameters. 
> 
> We have looked into the classes you suggested, but we can't find any
> 'bind' method or anything related to the sending socket.
> 
> Best regards.

Jørgen

The #bind method Indika is referring to is available in the 4.2 (DEV)
branch of HttpCore. So, you need to make sure you are using the latest
HttpCore release (4.2-beta1)

Alternatively, you could use the #prepareSocket method of the I/O
reactor class to modify properties of newly created sockets.

Hope this helps

Oleg

> Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
> On fr., 2012-02-10 at 14:22 +1100, indika kumara wrote:
> > Hi,
> > 
> > 
> > Would setTrafficClass(int tc) of java Socket API work for you?
> > 
> > 
> > You can access the connecting Socket by overrideing 'bind' of
> > DefaultNHttpClientConnection (httpcore) in
> > LoggingNHttpClientConnection (synapse) and set tranffic class
> > 
> > 
> > Also, you can modify 'bind' method of DefaultNHttpClientConnection
> > (httpcore) to set traficclass using provided http parameters of
> > 'bind' method.
> > 
> > 
> > Note: I do not have a good knowledge abut httpcore. So, I may wrong.
> > Please check with them.
> > 
> > 
> > Thanks,
> > 
> > 
> > Indika
> > 
> > 2012/2/9 Jørgen Nordmoen <no...@gmail.com>
> >         Hello.
> >         
> >         Long explenation: We are a group of students tasked with
> >         creating a
> >         system which is able to prioritize messages in a network,
> >         our customer
> >         has asked us to use WSO2 ESB which is, as you most likely
> >         know, just
> >         Apache Synapse. We have one strict demand from the customer
> >         and that is
> >         that our system must be able to set the DiffServ field in
> >         the IP
> >         header. The system must be able to accept SOAP messages and
> >         forward
> >         them to a GlassFish server with the final endpoints. And
> >         here is our
> >         problem, since Synapse does not directly support DiffServ or
> >         TOS we
> >         need to implement it, but after much research we are still
> >         not quite
> >         sure how to do this and that is why this emails is sent. We
> >         have some
> >         leads on where we could alter,
> >         org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor
> >         could be
> >         extended in order to obtain the DiffServ value from the
> >         MessageContext
> >         and then alter the Socket connection, but we are not quite
> >         sure as we
> >         don't have the overview needed.
> >         
> >         Question: 
> >         Is there a way we could alter Synapse, Axis 2 and/or
> >         HTTPCommons in order for us to support setting different
> >         DiffServ
> >         values to different clients? Hopefully we could alter
> >         something which
> >         we could either reach or interact with from a mediator which
> >         we have to
> >         write a cuple of anyway.
> >         
> >         Best regards.
> >         Jørgen Nordmoen <jo...@stud.ntnu.no>,
> >         <no...@gmail.com>
> >         
> >         
> > 
> > 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Re: Support for DiffServ with Http transport

Posted by Jørgen Nordmoen <no...@gmail.com>.
Thank you for your reply.

Setting the traffic class is exactly what we need. We have to do that
to every client connection, but also need to have control over what is
set for each connection as the clients will get different priority
based on our parameters. 

We have looked into the classes you suggested, but we can't find any
'bind' method or anything related to the sending socket.

Best regards.
Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
On fr., 2012-02-10 at 14:22 +1100, indika kumara wrote:

> Hi,
> 
> 
> 
> Would setTrafficClass(int tc) of java Socket API work for you?
> 
> 
> You can access the connecting Socket by overrideing 'bind' of
> DefaultNHttpClientConnection (httpcore) in
> LoggingNHttpClientConnection (synapse) and set tranffic class
> 
> 
> Also, you can modify 'bind' method of DefaultNHttpClientConnection
> (httpcore) to set traficclass using provided http parameters of 'bind'
> method.
> 
> 
> Note: I do not have a good knowledge abut httpcore. So, I may wrong.
> Please check with them.
> 
> 
> Thanks,
> 
> 
> Indika
> 
> 
> 
> 2012/2/9 Jørgen Nordmoen <no...@gmail.com>
> 
>         Hello.
>         
>         Long explenation: We are a group of students tasked with
>         creating a
>         system which is able to prioritize messages in a network, our
>         customer
>         has asked us to use WSO2 ESB which is, as you most likely
>         know, just
>         Apache Synapse. We have one strict demand from the customer
>         and that is
>         that our system must be able to set the DiffServ field in the
>         IP
>         header. The system must be able to accept SOAP messages and
>         forward
>         them to a GlassFish server with the final endpoints. And here
>         is our
>         problem, since Synapse does not directly support DiffServ or
>         TOS we
>         need to implement it, but after much research we are still not
>         quite
>         sure how to do this and that is why this emails is sent. We
>         have some
>         leads on where we could alter,
>         org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor
>         could be
>         extended in order to obtain the DiffServ value from the
>         MessageContext
>         and then alter the Socket connection, but we are not quite
>         sure as we
>         don't have the overview needed.
>         
>         Question: 
>         Is there a way we could alter Synapse, Axis 2 and/or
>         HTTPCommons in order for us to support setting different
>         DiffServ
>         values to different clients? Hopefully we could alter
>         something which
>         we could either reach or interact with from a mediator which
>         we have to
>         write a cuple of anyway.
>         
>         Best regards.
>         Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
>         
>         
> 
> 
> 


Re: Support for DiffServ with Http transport

Posted by indika kumara <in...@gmail.com>.
Hi,

Would *setTrafficClass(int tc)* of java Socket API work for you?

You can access the connecting Socket by overrideing 'bind' of
DefaultNHttpClientConnection (httpcore) in LoggingNHttpClientConnection
(synapse) and set tranffic class

Also, you can modify 'bind' method of DefaultNHttpClientConnection
(httpcore) to set traficclass using provided http parameters of 'bind'
method.

Note: I do not have a good knowledge abut httpcore. So, I may wrong. Please
check with them.

Thanks,

Indika

2012/2/9 Jørgen Nordmoen <no...@gmail.com>

> **
> Hello.
>
> Long explenation: We are a group of students tasked with creating a
> system which is able to prioritize messages in a network, our customer
> has asked us to use WSO2 ESB which is, as you most likely know, just
> Apache Synapse. We have one strict demand from the customer and that is
> that our system must be able to set the DiffServ field in the IP
> header. The system must be able to accept SOAP messages and forward
> them to a GlassFish server with the final endpoints. And here is our
> problem, since Synapse does not directly support DiffServ or TOS we
> need to implement it, but after much research we are still not quite
> sure how to do this and that is why this emails is sent. We have some
> leads on where we could alter,
> org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor could be
> extended in order to obtain the DiffServ value from the MessageContext
> and then alter the Socket connection, but we are not quite sure as we
> don't have the overview needed.
>
> Question:
> Is there a way we could alter Synapse, Axis 2 and/or
> HTTPCommons in order for us to support setting different DiffServ
> values to different clients? Hopefully we could alter something which
> we could either reach or interact with from a mediator which we have to
> write a cuple of anyway.
>
> Best regards.
> Jørgen Nordmoen <jo...@stud.ntnu.no>, <no...@gmail.com>
>
>