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 <nordmoe...@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 <jor...@stud.ntnu.no>, <nordmoe...@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 <jor...@stud.ntnu.no>, <nordmoe...@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 <nordmoe...@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 <jor...@stud.ntnu.no>, > > > <nordmoe...@gmail.com> > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org > For additional commands, e-mail: dev-h...@synapse.apache.org > > > >