Re: [Carbon-dev] ESB does not use Ports.Offset property for NHTTP ports

2011-06-25 Thread Supun Kamburugamuva
I'm working on this. We've realized this at the last minute and didn't want
to introduce this.

Thanks,
Supun..

On Sat, Jun 25, 2011 at 11:02 AM, Afkham Azeez  wrote:

> $subject. Why?
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * **
> email: **az...@wso2.com* * cell: +94 77 3320919
> blog: **http://blog.afkham.org* *
> twitter: **http://twitter.com/afkham_azeez*
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>
>
> ___
> Carbon-dev mailing list
> Carbon-dev@wso2.org
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>
___
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev


Re: [Carbon-dev] Error while starting up AS 4.1.1

2011-06-25 Thread Amila Suriarachchi
this file is supposed to copy with the feature to p2-profile and product
need to copy from that to product.

thanks,
Amila.

On Sat, Jun 25, 2011 at 2:01 AM, Afkham Azeez  wrote:

> [2011-06-25 02:01:44,847] ERROR
> {org.wso2.carbon.qpid.internal.QpidServiceComponent} -  Failed to start Qpid
> broker : File
> /Users/azeez/projects/wso2/org/branches/carbon/3.2.0/products/as/4.1.1/modules/distribution/product/target/wso2as-4.1.1/repository/conf/advanced/qpid-config.xml
> could not be found. Check the file exists and is readable.
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * **
> email: **az...@wso2.com* * cell: +94 77 3320919
> blog: **http://blog.afkham.org* *
> twitter: **http://twitter.com/afkham_azeez*
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>
>
> ___
> Carbon-dev mailing list
> Carbon-dev@wso2.org
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>
___
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev


[Carbon-dev] [Important] WSO2 Technical Reviews doc

2011-06-25 Thread Afkham Azeez
Folks,
We need to revamp our technical reviews, so we have created a spreadsheet
[1] where we first want to capture the items that need to be reviewed under
architecture, usability & code. The items will include new features,
existing features that need to be reviewed, fixes for L1/L2 & supports
issues etc.

 Each person in each product team, please review the sheets relevant to your
teams, and add items that need to be taken up for reviews. Please make sure
that you update this by EoD Monday.

1.
https://spreadsheets0.google.com/a/wso2.com/spreadsheet/ccc?hl=en_US&key=tvkgWvcfrYRG-p8L23dSOeQ&hl=en_US#gid=13

Thanks
Azeez

-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* **
email: **az...@wso2.com* * cell: +94 77 3320919
blog: **http://blog.afkham.org* *
twitter: **http://twitter.com/afkham_azeez*
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
___
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev


Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Hiranya Jayathilaka
This means you rely on the client to always send the Host header. Might not 
always work.

Sent from my iPhone

On Jun 24, 2011, at 9:18 PM, Afkham Azeez  wrote:

> The following code works.
> 
> Map headers = (Map)((Axis2MessageContext) 
> synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
> 
> String address = headers.get("Host");
> 
> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez  wrote:
> 
> 
> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka  wrote:
> I found following on simple HTTP server code:
> 
> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
>conn.getLocalAddress().getHostAddress());
> 
> This returns null for the NHTTP transport 
> 
> But other transports doesn't seem to be setting this. I didn't find anything 
> relevant in servlet transport code :(
> 
> Thanks,
> Hiranya
> 
> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka  wrote:
> 
> 
> On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez  wrote:
> Sorry, this does not work. I had hardcoded the host for testing it, so for 
> subsequent requests that prop was there.
> 
> It doesn't look like we are keeping track of the full request URI while 
> mediation. The NHTTP transport sets a property named "TransportInURL" (which 
> I think other transports are setting too) on Axis2 message context upon 
> receiving a request. But I'm not sure even that will give the full URL. 
> Here's the implementation from NHTTP transport:
> 
> msgContext.setProperty(
> Constants.Configuration.TRANSPORT_IN_URL, 
> request.getRequestLine().getUri());
> 
> Very often the URI extracted from the request line is a relative URI and so 
> will not contain the hostname part. Worth trying out though. 
> 
> BTW can't we just infer the hostname part since we know the hostname of the 
> server where the code is running?
> 
> Thanks,
> Hiranya
>  
> 
> 
> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez  wrote:
> I found a way to get this. Hope it is the proper way of handling this.
> 
> ((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")
>  
> 
> 
> On Sat, Jun 25, 2011 at 2:39 AM, Afkham Azeez  wrote:
> Folks,
> To implement the Service-aware LB, I need to get the requested host name. The 
> MessageContext.getTo() method does not return the hostname part. Is there any 
> other way to get this, perhaps from the transport headers?
> 
> Thanks
> Azeez
> 
> -- 
> Afkham Azeez
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> 
> email: az...@wso2.com cell: +94 77 3320919
> blog: http://blog.afkham.org
> twitter: http://twitter.com/afkham_azeez
> linked-in: http://lk.linkedin.com/in/afkhamazeez
> 
> Lean . Enterprise . Middleware
> 
> 
> 
> 
> -- 
> Afkham Azeez
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> 
> email: az...@wso2.com cell: +94 77 3320919
> blog: http://blog.afkham.org
> twitter: http://twitter.com/afkham_azeez
> linked-in: http://lk.linkedin.com/in/afkhamazeez
> 
> Lean . Enterprise . Middleware
> 
> 
> 
> 
> -- 
> Afkham Azeez
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> 
> email: az...@wso2.com cell: +94 77 3320919
> blog: http://blog.afkham.org
> twitter: http://twitter.com/afkham_azeez
> linked-in: http://lk.linkedin.com/in/afkhamazeez
> 
> Lean . Enterprise . Middleware
> 
> 
> ___
> Carbon-dev mailing list
> Carbon-dev@wso2.org
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> 
> 
> 
> 
> -- 
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.;  http://wso2.org
> E-mail: hira...@wso2.com;  Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
> 
> 
> 
> -- 
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.;  http://wso2.org
> E-mail: hira...@wso2.com;  Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
> 
> ___
> Carbon-dev mailing list
> Carbon-dev@wso2.org
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> 
> 
> 
> 
> -- 
> Afkham Azeez
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> 
> email: az...@wso2.com cell: +94 77 3320919
> blog: http://blog.afkham.org
> twitter: http://twitter.com/afkham_azeez
> linked-in: http://lk.linkedin.com/in/afkhamazeez
> 
> Lean . Enterprise . Middleware
> 
> 
> 
> 
> -- 
> Afkham Azeez
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> 
> email: az...@wso2.com cell: +94 77 3320919
> blog: http://blog.afkham.org
> twitter: http://twitter.com/afkham_azeez
> linked-in: http://lk.linkedin.com/in/afkhamazeez
> 
> Le

Re: [Carbon-dev] [Stratos-dev] Stratos AppServer start failure

2011-06-25 Thread Supun Malinga
Hi,

On Fri, Jun 24, 2011 at 5:49 PM, Afkham Azeez  wrote:

> Excellent! There was a setNativeName is a Mac OS X specific method. Can
> somebody please test the attached fix on Windows and confirm that it works?
>
>
> On Fri, Jun 24, 2011 at 5:36 PM, Amila Maha Arachchi wrote:
>
>> Hi,
>>
>> On Fri, Jun 24, 2011 at 5:04 PM, Afkham Azeez  wrote:
>>
>>> Supun,
>>> Can you try replacing
>>> CARBON_HOME/lib/endorsed/org.wso2.carbon.thread-3.2.1.jar with the attached
>>> jar?
>>>
>>
Sorry, just saw this, somehow it has been marked read, though I didn't see
it. Should be some mishap with a keyboard shortcut.


>> I tried this and AS started successfully with the provided jar.
>>
> great!

thanks,

>
>> Thanks,
>> AmilaM.
>>
>>>
>>>
>>> On Fri, Jun 24, 2011 at 3:34 PM, Supun Malinga  wrote:
>>>
 Hi devs,

 Stratos appserver doesn't start due to the error [1], Anyone got any
 idea for the cause of this error?.
 Issue reported @ [2].

 [1] Stacktrace
 Exception in thread "[ThreadPool Manager] - Idle Thread"
 java.lang.UnsatisfiedLinkError:
 java.lang.Thread.setNativeName(Ljava/lang/String;)V
 at java.lang.Thread.setNativeName(Native Method)
  at java.lang.Thread.setName(Thread.java:1123)
 at
 org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:90)
 Exception in thread "NioSocketAcceptor-1"
 java.lang.UnsatisfiedLinkError:
 java.lang.Thread.setNativeName(Ljava/lang/String;)V
 at java.lang.Thread.setNativeName(Native Method)
  at java.lang.Thread.setName(Thread.java:1123)
 at
 org.apache.mina.util.NamePreservingRunnable.setName(NamePreservingRunnable.java:76)
  at
 org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:60)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:686)
 Exception in thread "[Timer] - Main Queue Handler"
 java.lang.UnsatisfiedLinkError:
 java.lang.Thread.setNativeName(Ljava/lang/String;)V
 at java.lang.Thread.setNativeName(Native Method)
  at java.lang.Thread.setName(Thread.java:1123)
 at
 org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.setRunnable(Executor.java:49)
  at
 org.eclipse.equinox.internal.util.impl.tpt.threadpool.ThreadPoolManagerImpl.execute(ThreadPoolManagerImpl.java:213)
 at
 org.eclipse.equinox.internal.util.impl.tpt.threadpool.ThreadPoolFactoryImpl.execute0(ThreadPoolFactoryImpl.java:112)
  at
 org.eclipse.equinox.internal.util.impl.tpt.timer.TimerImpl.run(TimerImpl.java:110)
 at java.lang.Thread.run(Thread.java:686)
 Exception in thread "[ThreadPool Manager] - Idle Thread"
 java.lang.UnsatisfiedLinkError:
 java.lang.Thread.setNativeName(Ljava/lang/String;)V
 at java.lang.Thread.setNativeName(Native Method)
  at java.lang.Thread.setName(Thread.java:1123)
 at
 org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:90)

 [2] https://wso2.org/jira/browse/STRATOS-1216

 regards,
 --
 Supun Malinga,

 Software Engineer,
 WSO2 Inc.
 http://wso2.com
 http://wso2.org
 email - sup...@wso2.com 
 mobile - 071 56 91 321


 ___
 Carbon-dev mailing list
 Carbon-dev@wso2.org
 http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev


>>>
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>> * **
>>> email: **az...@wso2.com* * cell: +94 77 3320919
>>> blog: **http://blog.afkham.org* *
>>> twitter: **http://twitter.com/afkham_azeez*
>>> *
>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>> *
>>> *
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>> ___
>>> Stratos-dev mailing list
>>> stratos-...@wso2.org
>>> https://wso2.org/cgi-bin/mailman/listinfo/stratos-dev
>>>
>>>
>>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * **
> email: **az...@wso2.com* * cell: +94 77 3320919
> blog: **http://blog.afkham.org* *
> twitter: **http://twitter.com/afkham_azeez*
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>
>
> ___
> Carbon-dev mailing list
> Carbon-dev@wso2.org
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>


-- 
Supun Malinga,

Software Engineer,
WSO2 Inc.
http://wso2.com
http://wso2.org
email - sup...@wso2.com 
mobil

Re: [Carbon-dev] test failure in dependencies/ode/1.3.5-wso2v3/bpel-test

2011-06-25 Thread Supun Malinga
Hi Denis,

I'm not getting this anymore in the local builder. Not sure what happened
though. I double checked before sending the initial mail.

thanks,

On Fri, Jun 24, 2011 at 2:18 PM, Supun Malinga  wrote:

> Hi Denis,
>
> Will try again and let you know.
>

>
> On Fri, Jun 24, 2011 at 2:12 PM, Denis Weerasiri  wrote:
>
>> Hi Supun,
>> Still do you get this error?, I tried the 3.2.1 branch with tests (ODE)
>> but couldn't reproduce.
>>
>> On Thu, Jun 23, 2011 at 2:14 AM, Supun Malinga  wrote:
>>
>>> Hi,
>>>
>>> Full report,
>>> Test set: org.apache.ode.test.MessageRouting20Test
>>>
>>> ---
>>> Tests run: 21, Failures: 2, Errors: 0, Skipped: 3, Time elapsed: 229.32
>>> sec <<< FAILURE!
>>> testConcurrentSyncMex(org.apache.ode.test.MessageRouting20Test)  Time
>>> elapsed: 60.528 sec  <<< FAILURE!
>>> java.lang.AssertionError: Failure report:
>>> Invocation#/home/release1/branches/3.2.1/dependencies/ode/1.3.5-wso2v3/bpel-test/target/test-classes/bpel/2.0/TestConcurrentSyncMex/test.properties#1:
>>> Exception on future object.; got exception msg: Message exchange
>>> org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl$ResponseFuture@28ee1649timed
>>>  out(6 ms) when waiting for a response!
>>>
>>> at org.junit.Assert.fail(Assert.java:74)
>>> at
>>> org.apache.ode.test.BPELTestAbstract.checkFailure(BPELTestAbstract.java:383)
>>> at
>>> org.apache.ode.test.BPELTestAbstract.go(BPELTestAbstract.java:371)
>>> at
>>> org.apache.ode.test.BPELTestAbstract.go(BPELTestAbstract.java:300)
>>> at
>>> org.apache.ode.test.BPELTestAbstract.go(BPELTestAbstract.java:285)
>>> at
>>> org.apache.ode.test.MessageRouting20Test.testConcurrentSyncMex(MessageRouting20Test.java:128)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at
>>> org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
>>> at
>>> org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
>>> at
>>> org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
>>> at
>>> org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
>>> at
>>> org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
>>> at
>>> org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
>>> at
>>> org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
>>> at
>>> org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
>>> at
>>> org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
>>> at
>>> org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
>>> at
>>> org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
>>> at
>>> org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
>>> at
>>> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>>> at
>>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>>> at
>>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>>> at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at
>>> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
>>> at
>>> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
>>>
>>> testIMA(org.apache.ode.test.MessageRouting20Test)  Time elapsed: 72.819
>>> sec  <<< FAILURE!
>>> java.lang.AssertionError: Failure report:
>>> Invocation#/home/release1/branches/3.2.1/dependencies/ode/1.3.5-wso2v3/bpel-test/target/test-classes/bpel/2.0/TestIMA/test1.properties#1:
>>> Exception on future object.; got exception msg: Message exchange
>>> org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl$ResponseFuture@22a790e7timed
>>>  out(6 ms) when waiting for a response!
>>> Invocation#/home/release1/branches/3.2.1/dependencies/ode/1.3.5-wso2v3/bpel-test/target/test-classes/bpel/2.0/TestIMA/test3.properties#1:
>>> Exception on future object.; got exception msg: Message exchange
>>> org.apache.ode.bpel.engine.

Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Supun Kamburugamuva
Most of the time URI contains only the path part of the URL. If we want the
host name we have to get it by other means.

Thanks,
Supun..

On Sat, Jun 25, 2011 at 8:24 PM, Hiranya Jayathilaka wrote:

> This means you rely on the client to always send the Host header. Might not
> always work.
>
> Sent from my iPhone
>
> On Jun 24, 2011, at 9:18 PM, Afkham Azeez  wrote:
>
> The following code works.
>
> Map headers = (Map)((Axis2MessageContext)
> synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
>
> String address = headers.get("Host");
>
> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez < 
> az...@wso2.com> wrote:
>
>>
>>
>> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka < 
>> hira...@wso2.com> wrote:
>>
>>> I found following on simple HTTP server code:
>>>
>>> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
>>>
>>> conn.getLocalAddress().getHostAddress());
>>>
>>
>> This returns null for the NHTTP transport
>>
>>>
>>> But other transports doesn't seem to be setting this. I didn't find
>>> anything relevant in servlet transport code :(
>>>
>>> Thanks,
>>> Hiranya
>>>
>>> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka <
>>> hira...@wso2.com> wrote:
>>>


 On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez < 
 az...@wso2.com> wrote:

> Sorry, this does not work. I had hardcoded the host for testing it, so
> for subsequent requests that prop was there.


 It doesn't look like we are keeping track of the full request URI while
 mediation. The NHTTP transport sets a property named "TransportInURL" 
 (which
 I think other transports are setting too) on Axis2 message context upon
 receiving a request. But I'm not sure even that will give the full URL.
 Here's the implementation from NHTTP transport:

 msgContext.setProperty(
 Constants.Configuration.TRANSPORT_IN_URL,
 request.getRequestLine().getUri());

 Very often the URI extracted from the request line is a relative URI and
 so will not contain the hostname part. Worth trying out though.

 BTW can't we just infer the hostname part since we know the hostname of
 the server where the code is running?

 Thanks,
 Hiranya


>
>
> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez < 
> az...@wso2.com> wrote:
>
>> I found a way to get this. Hope it is the proper way of handling this.
>>
>>
>> ((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")
>>
>>
>> On Sat, Jun 25, 2011 at 2:39 AM, Afkham Azeez < 
>> az...@wso2.com> wrote:
>>
>>> Folks,
>>> To implement the Service-aware LB, I need to get the requested host
>>> name. The MessageContext.getTo() method does not return the hostname 
>>> part.
>>> Is there any other way to get this, perhaps from the transport headers?
>>>
>>> Thanks
>>> Azeez
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; 
>>> http://www.apache.org/
>>> * **
>>> email: **az...@wso2.com* * cell: +94 77 3320919
>>> blog: **http://blog.afkham.org* *
>>> twitter: 
>>> **http://twitter.com/afkham_azeez*
>>> *
>>> linked-in: ** 
>>> http://lk.linkedin.com/in/afkhamazeez*
>>> *
>>> *
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; 
>> http://www.apache.org/
>> * **
>> email: **az...@wso2.com* * cell: +94 77 3320919
>> blog: **http://blog.afkham.org* *
>> twitter: 
>> **http://twitter.com/afkham_azeez*
>> *
>> linked-in: ** 
>> http://lk.linkedin.com/in/afkhamazeez*
>> *
>> *
>> *Lean . Enterprise . Middleware*
>>
>>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; 
> http://www.apache.org/
> * **
> email: **az...@wso2.com* * cell: +94 77 3320919
> blog: **http://blog.afkham.org* *
> twitter: 
> **http://twitter.com/afkham_azeez*
> *
> linked-in: ** 
> http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>
>
> _

Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Afkham Azeez
On Sat, Jun 25, 2011 at 8:24 PM, Hiranya Jayathilaka wrote:

> This means you rely on the client to always send the Host header. Might not
> always work.
>

Is there a way to get the originally requested URL?

>
> Sent from my iPhone
>
> On Jun 24, 2011, at 9:18 PM, Afkham Azeez  wrote:
>
> The following code works.
>
> Map headers = (Map)((Axis2MessageContext)
> synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
>
> String address = headers.get("Host");
>
> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez < 
> az...@wso2.com> wrote:
>
>>
>>
>> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka < 
>> hira...@wso2.com> wrote:
>>
>>> I found following on simple HTTP server code:
>>>
>>> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
>>>
>>> conn.getLocalAddress().getHostAddress());
>>>
>>
>> This returns null for the NHTTP transport
>>
>>>
>>> But other transports doesn't seem to be setting this. I didn't find
>>> anything relevant in servlet transport code :(
>>>
>>> Thanks,
>>> Hiranya
>>>
>>> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka <
>>> hira...@wso2.com> wrote:
>>>


 On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez < 
 az...@wso2.com> wrote:

> Sorry, this does not work. I had hardcoded the host for testing it, so
> for subsequent requests that prop was there.


 It doesn't look like we are keeping track of the full request URI while
 mediation. The NHTTP transport sets a property named "TransportInURL" 
 (which
 I think other transports are setting too) on Axis2 message context upon
 receiving a request. But I'm not sure even that will give the full URL.
 Here's the implementation from NHTTP transport:

 msgContext.setProperty(
 Constants.Configuration.TRANSPORT_IN_URL,
 request.getRequestLine().getUri());

 Very often the URI extracted from the request line is a relative URI and
 so will not contain the hostname part. Worth trying out though.

 BTW can't we just infer the hostname part since we know the hostname of
 the server where the code is running?

 Thanks,
 Hiranya


>
>
> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez < 
> az...@wso2.com> wrote:
>
>> I found a way to get this. Hope it is the proper way of handling this.
>>
>>
>> ((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")
>>
>>
>> On Sat, Jun 25, 2011 at 2:39 AM, Afkham Azeez < 
>> az...@wso2.com> wrote:
>>
>>> Folks,
>>> To implement the Service-aware LB, I need to get the requested host
>>> name. The MessageContext.getTo() method does not return the hostname 
>>> part.
>>> Is there any other way to get this, perhaps from the transport headers?
>>>
>>> Thanks
>>> Azeez
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; 
>>> http://www.apache.org/
>>> * **
>>> email: **az...@wso2.com* * cell: +94 77 3320919
>>> blog: **http://blog.afkham.org* *
>>> twitter: 
>>> **http://twitter.com/afkham_azeez*
>>> *
>>> linked-in: ** 
>>> http://lk.linkedin.com/in/afkhamazeez*
>>> *
>>> *
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; 
>> http://www.apache.org/
>> * **
>> email: **az...@wso2.com* * cell: +94 77 3320919
>> blog: **http://blog.afkham.org* *
>> twitter: 
>> **http://twitter.com/afkham_azeez*
>> *
>> linked-in: ** 
>> http://lk.linkedin.com/in/afkhamazeez*
>> *
>> *
>> *Lean . Enterprise . Middleware*
>>
>>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; 
> http://www.apache.org/
> * **
> email: **az...@wso2.com* * cell: +94 77 3320919
> blog: **http://blog.afkham.org* *
> twitter: 
> **http://twitter.com/afkham_azeez*
> *
> linked-in: ** 
> http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>
>
> ___
> Carbon-dev mailing list
>  Carbon-dev@wso2.org
> 

Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Hiranya Jayathilaka
The original request uri is not part of the message. So we cannot obtain it 
from the http message. But at the transport level we can infer it by looking at 
the socket. Currently nhttp transport doesn't do that. We can add that bit of 
logic to the transport if needed.

Sent from my iPhone

On Jun 25, 2011, at 8:45 AM, Afkham Azeez  wrote:

> 
> 
> On Sat, Jun 25, 2011 at 8:24 PM, Hiranya Jayathilaka  wrote:
> This means you rely on the client to always send the Host header. Might not 
> always work.
> 
> Is there a way to get the originally requested URL?  
> 
> Sent from my iPhone
> 
> On Jun 24, 2011, at 9:18 PM, Afkham Azeez  wrote:
> 
>> The following code works.
>> 
>> Map headers = (Map)((Axis2MessageContext) 
>> synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
>> 
>> String address = headers.get("Host");
>> 
>> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez  wrote:
>> 
>> 
>> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka  
>> wrote:
>> I found following on simple HTTP server code:
>> 
>> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
>>conn.getLocalAddress().getHostAddress());
>> 
>> This returns null for the NHTTP transport 
>> 
>> But other transports doesn't seem to be setting this. I didn't find anything 
>> relevant in servlet transport code :(
>> 
>> Thanks,
>> Hiranya
>> 
>> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka  
>> wrote:
>> 
>> 
>> On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez  wrote:
>> Sorry, this does not work. I had hardcoded the host for testing it, so for 
>> subsequent requests that prop was there.
>> 
>> It doesn't look like we are keeping track of the full request URI while 
>> mediation. The NHTTP transport sets a property named "TransportInURL" (which 
>> I think other transports are setting too) on Axis2 message context upon 
>> receiving a request. But I'm not sure even that will give the full URL. 
>> Here's the implementation from NHTTP transport:
>> 
>> msgContext.setProperty(
>> Constants.Configuration.TRANSPORT_IN_URL, 
>> request.getRequestLine().getUri());
>> 
>> Very often the URI extracted from the request line is a relative URI and so 
>> will not contain the hostname part. Worth trying out though. 
>> 
>> BTW can't we just infer the hostname part since we know the hostname of the 
>> server where the code is running?
>> 
>> Thanks,
>> Hiranya
>>  
>> 
>> 
>> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez  wrote:
>> I found a way to get this. Hope it is the proper way of handling this.
>> 
>> ((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")
>>  
>> 
>> 
>> On Sat, Jun 25, 2011 at 2:39 AM, Afkham Azeez  wrote:
>> Folks,
>> To implement the Service-aware LB, I need to get the requested host name. 
>> The MessageContext.getTo() method does not return the hostname part. Is 
>> there any other way to get this, perhaps from the transport headers?
>> 
>> Thanks
>> Azeez
>> 
>> -- 
>> Afkham Azeez
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> 
>> email: az...@wso2.com cell: +94 77 3320919
>> blog: http://blog.afkham.org
>> twitter: http://twitter.com/afkham_azeez
>> linked-in: http://lk.linkedin.com/in/afkhamazeez
>> 
>> Lean . Enterprise . Middleware
>> 
>> 
>> 
>> 
>> -- 
>> Afkham Azeez
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> 
>> email: az...@wso2.com cell: +94 77 3320919
>> blog: http://blog.afkham.org
>> twitter: http://twitter.com/afkham_azeez
>> linked-in: http://lk.linkedin.com/in/afkhamazeez
>> 
>> Lean . Enterprise . Middleware
>> 
>> 
>> 
>> 
>> -- 
>> Afkham Azeez
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> 
>> email: az...@wso2.com cell: +94 77 3320919
>> blog: http://blog.afkham.org
>> twitter: http://twitter.com/afkham_azeez
>> linked-in: http://lk.linkedin.com/in/afkhamazeez
>> 
>> Lean . Enterprise . Middleware
>> 
>> 
>> ___
>> Carbon-dev mailing list
>> Carbon-dev@wso2.org
>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>> 
>> 
>> 
>> 
>> -- 
>> Hiranya Jayathilaka
>> Associate Technical Lead;
>> WSO2 Inc.;  http://wso2.org
>> E-mail: hira...@wso2.com;  Mobile: +94 77 633 3491
>> Blog: http://techfeast-hiranya.blogspot.com
>> 
>> 
>> 
>> -- 
>> Hiranya Jayathilaka
>> Associate Technical Lead;
>> WSO2 Inc.;  http://wso2.org
>> E-mail: hira...@wso2.com;  Mobile: +94 77 633 3491
>> Blog: http://techfeast-hiranya.blogspot.com
>> 
>> ___
>> Carbon-dev mailing list
>> Carbon-dev@wso2.org
>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>> 
>> 
>> 
>> 
>> -- 
>> Afkham Azeez
>> Director of Ar

Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Afkham Azeez
Folks,
This is the LB we are going to use for stratoslive, so it has to work
correctly. We need to implement the correct solution for this issue.

Thanks
Azeez
On Jun 25, 2011 9:48 AM, "Afkham Azeez"  wrote:
> The following code works.
>
> Map headers = (Map)((Axis2MessageContext)
>
synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
>
> String address = headers.get("Host");
>
> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez  wrote:
>
>>
>>
>> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka wrote:
>>
>>> I found following on simple HTTP server code:
>>>
>>> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
>>>
>>> conn.getLocalAddress().getHostAddress());
>>>
>>
>> This returns null for the NHTTP transport
>>
>>>
>>> But other transports doesn't seem to be setting this. I didn't find
>>> anything relevant in servlet transport code :(
>>>
>>> Thanks,
>>> Hiranya
>>>
>>> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka wrote:
>>>


 On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez  wrote:

> Sorry, this does not work. I had hardcoded the host for testing it, so
> for subsequent requests that prop was there.


 It doesn't look like we are keeping track of the full request URI while
 mediation. The NHTTP transport sets a property named "TransportInURL"
(which
 I think other transports are setting too) on Axis2 message context upon
 receiving a request. But I'm not sure even that will give the full URL.
 Here's the implementation from NHTTP transport:

 msgContext.setProperty(
 Constants.Configuration.TRANSPORT_IN_URL,
 request.getRequestLine().getUri());

 Very often the URI extracted from the request line is a relative URI
and
 so will not contain the hostname part. Worth trying out though.

 BTW can't we just infer the hostname part since we know the hostname of
 the server where the code is running?

 Thanks,
 Hiranya


>
>
> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez  wrote:
>
>> I found a way to get this. Hope it is the proper way of handling
this.
>>
>>
>>
((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")
>>
>>
>> On Sat, Jun 25, 2011 at 2:39 AM, Afkham Azeez  wrote:
>>
>>> Folks,
>>> To implement the Service-aware LB, I need to get the requested host
>>> name. The MessageContext.getTo() method does not return the hostname
part.
>>> Is there any other way to get this, perhaps from the transport
headers?
>>>
>>> Thanks
>>> Azeez
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>> * **
>>> email: **az...@wso2.com* * cell: +94 77 3320919
>>> blog: **http://blog.afkham.org* *
>>> twitter: **http://twitter.com/afkham_azeez*<
http://twitter.com/afkham_azeez>
>>> *
>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>> *
>>> *
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * **
>> email: **az...@wso2.com* * cell: +94 77 3320919
>> blog: **http://blog.afkham.org* *
>> twitter: **http://twitter.com/afkham_azeez*<
http://twitter.com/afkham_azeez>
>> *
>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>> *
>> *
>> *Lean . Enterprise . Middleware*
>>
>>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * **
> email: **az...@wso2.com* * cell: +94 77 3320919
> blog: **http://blog.afkham.org* *
> twitter: **http://twitter.com/afkham_azeez*<
http://twitter.com/afkham_azeez>
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>
>
> ___
> Carbon-dev mailing list
> Carbon-dev@wso2.org
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>


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

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

Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Afkham Azeez
Hiranya,
Can you please coders that. The servlet API provides such information so
this is a shortcoming of the nhttp transport.
On Jun 25, 2011 9:33 PM, "Hiranya Jayathilaka"  wrote:
> The original request uri is not part of the message. So we cannot obtain
it from the http message. But at the transport level we can infer it by
looking at the socket. Currently nhttp transport doesn't do that. We can add
that bit of logic to the transport if needed.
>
> Sent from my iPhone
>
> On Jun 25, 2011, at 8:45 AM, Afkham Azeez  wrote:
>
>>
>>
>> On Sat, Jun 25, 2011 at 8:24 PM, Hiranya Jayathilaka 
wrote:
>> This means you rely on the client to always send the Host header. Might
not always work.
>>
>> Is there a way to get the originally requested URL?
>>
>> Sent from my iPhone
>>
>> On Jun 24, 2011, at 9:18 PM, Afkham Azeez  wrote:
>>
>>> The following code works.
>>>
>>> Map headers = (Map)((Axis2MessageContext)
synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
>>>
>>> String address = headers.get("Host");
>>>
>>> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez  wrote:
>>>
>>>
>>> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka 
wrote:
>>> I found following on simple HTTP server code:
>>>
>>> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
>>> conn.getLocalAddress().getHostAddress());
>>>
>>> This returns null for the NHTTP transport
>>>
>>> But other transports doesn't seem to be setting this. I didn't find
anything relevant in servlet transport code :(
>>>
>>> Thanks,
>>> Hiranya
>>>
>>> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka 
wrote:
>>>
>>>
>>> On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez  wrote:
>>> Sorry, this does not work. I had hardcoded the host for testing it, so
for subsequent requests that prop was there.
>>>
>>> It doesn't look like we are keeping track of the full request URI while
mediation. The NHTTP transport sets a property named "TransportInURL" (which
I think other transports are setting too) on Axis2 message context upon
receiving a request. But I'm not sure even that will give the full URL.
Here's the implementation from NHTTP transport:
>>>
>>> msgContext.setProperty(
>>> Constants.Configuration.TRANSPORT_IN_URL,
request.getRequestLine().getUri());
>>>
>>> Very often the URI extracted from the request line is a relative URI and
so will not contain the hostname part. Worth trying out though.
>>>
>>> BTW can't we just infer the hostname part since we know the hostname of
the server where the code is running?
>>>
>>> Thanks,
>>> Hiranya
>>>
>>>
>>>
>>> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez  wrote:
>>> I found a way to get this. Hope it is the proper way of handling this.
>>>
>>>
((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")

>>>
>>>
>>> On Sat, Jun 25, 2011 at 2:39 AM, Afkham Azeez  wrote:
>>> Folks,
>>> To implement the Service-aware LB, I need to get the requested host
name. The MessageContext.getTo() method does not return the hostname part.
Is there any other way to get this, perhaps from the transport headers?
>>>
>>> Thanks
>>> Azeez
>>>
>>> --
>>> Afkham Azeez
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>>
>>> email: az...@wso2.com cell: +94 77 3320919
>>> blog: http://blog.afkham.org
>>> twitter: http://twitter.com/afkham_azeez
>>> linked-in: http://lk.linkedin.com/in/afkhamazeez
>>>
>>> Lean . Enterprise . Middleware
>>>
>>>
>>>
>>>
>>> --
>>> Afkham Azeez
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>>
>>> email: az...@wso2.com cell: +94 77 3320919
>>> blog: http://blog.afkham.org
>>> twitter: http://twitter.com/afkham_azeez
>>> linked-in: http://lk.linkedin.com/in/afkhamazeez
>>>
>>> Lean . Enterprise . Middleware
>>>
>>>
>>>
>>>
>>> --
>>> Afkham Azeez
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>>
>>> email: az...@wso2.com cell: +94 77 3320919
>>> blog: http://blog.afkham.org
>>> twitter: http://twitter.com/afkham_azeez
>>> linked-in: http://lk.linkedin.com/in/afkhamazeez
>>>
>>> Lean . Enterprise . Middleware
>>>
>>>
>>> ___
>>> Carbon-dev mailing list
>>> Carbon-dev@wso2.org
>>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>>
>>>
>>>
>>>
>>> --
>>> Hiranya Jayathilaka
>>> Associate Technical Lead;
>>> WSO2 Inc.; http://wso2.org
>>> E-mail: hira...@wso2.com; Mobile: +94 77 633 3491
>>> Blog: http://techfeast-hiranya.blogspot.com
>>>
>>>
>>>
>>> --
>>> Hiranya Jayathilaka
>>> Associate Technical Lead;
>>> WSO2 Inc.; http://wso2.org
>>> E-mail: hira...@wso2.com; Mobile: +94 77 633 3491
>>> Blog: http://techfeast-hiranya.blogspot.com
>>>
>>> ___
>>> Carbon-dev mailing list
>>

Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Afkham Azeez
On Sat, Jun 25, 2011 at 9:47 PM, Afkham Azeez  wrote:

> Hiranya,
> Can you please coders that. The servlet API provides such information so
> this is a shortcoming of the nhttp transport.
>

Oops... this is what happens when you use the phone keyboard :) I meant, can
you please fix this so that we can use it in the LB?



> On Jun 25, 2011 9:33 PM, "Hiranya Jayathilaka"  wrote:
> > The original request uri is not part of the message. So we cannot obtain
> it from the http message. But at the transport level we can infer it by
> looking at the socket. Currently nhttp transport doesn't do that. We can add
> that bit of logic to the transport if needed.
> >
> > Sent from my iPhone
> >
> > On Jun 25, 2011, at 8:45 AM, Afkham Azeez  wrote:
> >
> >>
> >>
> >> On Sat, Jun 25, 2011 at 8:24 PM, Hiranya Jayathilaka 
> wrote:
> >> This means you rely on the client to always send the Host header. Might
> not always work.
> >>
> >> Is there a way to get the originally requested URL?
> >>
> >> Sent from my iPhone
> >>
> >> On Jun 24, 2011, at 9:18 PM, Afkham Azeez  wrote:
> >>
> >>> The following code works.
> >>>
> >>> Map headers = (Map String>)((Axis2MessageContext)
> synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
> >>>
> >>> String address = headers.get("Host");
> >>>
> >>> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez  wrote:
> >>>
> >>>
> >>> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka 
> wrote:
> >>> I found following on simple HTTP server code:
> >>>
> >>> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
> >>> conn.getLocalAddress().getHostAddress());
> >>>
> >>> This returns null for the NHTTP transport
> >>>
> >>> But other transports doesn't seem to be setting this. I didn't find
> anything relevant in servlet transport code :(
> >>>
> >>> Thanks,
> >>> Hiranya
> >>>
> >>> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka 
> wrote:
> >>>
> >>>
> >>> On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez  wrote:
> >>> Sorry, this does not work. I had hardcoded the host for testing it, so
> for subsequent requests that prop was there.
> >>>
> >>> It doesn't look like we are keeping track of the full request URI while
> mediation. The NHTTP transport sets a property named "TransportInURL" (which
> I think other transports are setting too) on Axis2 message context upon
> receiving a request. But I'm not sure even that will give the full URL.
> Here's the implementation from NHTTP transport:
> >>>
> >>> msgContext.setProperty(
> >>> Constants.Configuration.TRANSPORT_IN_URL,
> request.getRequestLine().getUri());
> >>>
> >>> Very often the URI extracted from the request line is a relative URI
> and so will not contain the hostname part. Worth trying out though.
> >>>
> >>> BTW can't we just infer the hostname part since we know the hostname of
> the server where the code is running?
> >>>
> >>> Thanks,
> >>> Hiranya
> >>>
> >>>
> >>>
> >>> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez  wrote:
> >>> I found a way to get this. Hope it is the proper way of handling this.
> >>>
> >>>
> ((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")
>
> >>>
> >>>
> >>> On Sat, Jun 25, 2011 at 2:39 AM, Afkham Azeez  wrote:
> >>> Folks,
> >>> To implement the Service-aware LB, I need to get the requested host
> name. The MessageContext.getTo() method does not return the hostname part.
> Is there any other way to get this, perhaps from the transport headers?
> >>>
> >>> Thanks
> >>> Azeez
> >>>
> >>> --
> >>> Afkham Azeez
> >>> Director of Architecture; WSO2, Inc.; http://wso2.com
> >>> Member; Apache Software Foundation; http://www.apache.org/
> >>>
> >>> email: az...@wso2.com cell: +94 77 3320919
> >>> blog: http://blog.afkham.org
> >>> twitter: http://twitter.com/afkham_azeez
> >>> linked-in: http://lk.linkedin.com/in/afkhamazeez
> >>>
> >>> Lean . Enterprise . Middleware
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> Afkham Azeez
> >>> Director of Architecture; WSO2, Inc.; http://wso2.com
> >>> Member; Apache Software Foundation; http://www.apache.org/
> >>>
> >>> email: az...@wso2.com cell: +94 77 3320919
> >>> blog: http://blog.afkham.org
> >>> twitter: http://twitter.com/afkham_azeez
> >>> linked-in: http://lk.linkedin.com/in/afkhamazeez
> >>>
> >>> Lean . Enterprise . Middleware
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> Afkham Azeez
> >>> Director of Architecture; WSO2, Inc.; http://wso2.com
> >>> Member; Apache Software Foundation; http://www.apache.org/
> >>>
> >>> email: az...@wso2.com cell: +94 77 3320919
> >>> blog: http://blog.afkham.org
> >>> twitter: http://twitter.com/afkham_azeez
> >>> linked-in: http://lk.linkedin.com/in/afkhamazeez
> >>>
> >>> Lean . Enterprise . Middleware
> >>>
> >>>
> >>> ___
> >>> Carbon-dev mailing list
> >>> Carbon-dev@wso2.org
> >>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> >>>
> >>>
> >>

[Carbon-dev] Issues with UDDI WSDLs

2011-06-25 Thread Jorge Infante Osorio
Hi folks.
I´m trying to use the UDDI capabilities in GReg but I have problems with the
generated WSDLs. It doesn't pass the WS-I and in Eclipse IDE I cannot
generate a client for them.

The errors by wsdl:

https://localhost:9446/services/UDDIReplicationService?wsdl
attribute 'element' in message part 'parameters' (message
'get_changeRecordsResponse') refers to element 'ns1:changeRecords' which is
not defined within the WSDL file!
Error location: definitions / message / part / @element


https://localhost:9446/services/UDDIInquiryService?wsdl
attribute 'element' in message part 'body' (message 'find_tModel') refers to
element 'ns1:find_tModel' which is not defined within the WSDL file!
Error location: definitions / message / part / @element


https://localhost:9446/services/UDDISubscriptionService?wsdl
Unable to generate WSDL 1.1 for this
serviceIf you wish Axis2 to automatically generate the
WSDL 1.1, then please set useOriginalwsdl as false in your
services.xmljavax.xml.ws.WebServiceException: Error occurred
generating WSDL file for Web service implementation class
{org.apache.juddi.api.impl.UDDISubscriptionImpl}
at
org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateWsdl
(JAXWSRIWSDLGenerator.java:198)
at
org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initialize(J
AXWSRIWSDLGenerator.java:390)
at
org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(JAXW
SRIWSDLGenerator.java:383)
at
org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1402)
at
org.wso2.carbon.core.transports.util.Wsdl11Processor$1.printWSDL(Wsdl11Proce
ssor.java:43)
at
org.wso2.carbon.core.transports.util.AbstractWsdlProcessor.printWSDL(Abstrac
tWsdlProcessor.java:79)
at
org.wso2.carbon.core.transports.util.Wsdl11Processor.process(Wsdl11Processor
.java:57)
at
org.wso2.carbon.core.transports.CarbonServlet.processWithGetProcessor(Carbon
Servlet.java:161)
at
org.wso2.carbon.core.transports.CarbonServlet.doGet(CarbonServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(
ServletRegistration.java:90)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxySer
vlet.java:111)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.
java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:155)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:304)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:240)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:164)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:462)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100
)
at
org.wso2.carbon.server.TomcatServer$1.invoke(TomcatServer.java:241)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
at
org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:
396)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(H
ttp11NioProtocol.java:356)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:
1534)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
08)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.Exception: A WSDL Definition could not be generated for
the implementation class: org.apache.juddi.api.impl.UDDISubscriptionImpl
at
org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateWsdl
(JAXWSRIWSDLGenerator.java:188)
... 33 more


https://localhost:9446/services/JUDDIApiService?wsdl
attribute 'element' in message part 'body' (message
'get_allPublisherDetail') refers to element 'ns1:get_allPublisherDetail'
which is not defined within the WSDL file!
Error location: definitions / message / part / @element

https://localhost:9446/services/UDDIValueSetValidationService?wsdl
attribute 

Re: [Carbon-dev] [Stratos-dev] build triggered for 3.2.1 build in ec2 instance

2011-06-25 Thread Supun Malinga
Hi,

On Fri, Jun 24, 2011 at 2:02 PM, Supun Malinga  wrote:

>
>
> On Fri, Jun 24, 2011 at 1:33 PM, Amila Maha Arachchi wrote:
>
>>
>>
>> On Fri, Jun 24, 2011 at 12:28 PM, Supun Malinga  wrote:
>>
>>> Hi,
>>>
>>> On Fri, Jun 24, 2011 at 11:53 AM, Ranga Siriwardena wrote:
>>>
 Hi Supun,

 On Fri, Jun 24, 2011 at 11:39 AM, Supun Malinga wrote:

> Hi,
>
> On Fri, Jun 24, 2011 at 11:06 AM, Yumani Ranaweera wrote:
>
>>
>> On Thu, Jun 23, 2011 at 11:11 AM, Supun Malinga wrote:
>>
>>> Hi All,
>>>
>>> Some products are having integration test failures. I'll host the
>>> packs anyway as this the the first build and we need packs quickly. 
>>> Will do
>>> another build asap.
>>> Packs are being hosted @ [1].
>>>
>>> [1] http://10.100.1.43/~carbon/releases/carbon/3.2.1/latest/
>>>
>>
>>
>>  GS packs are missing in [1]. Could you please include them too.
>>
>
> both GS and DSS have not been added to patch-releases/3.2.1/pom.xml
>

 GS is added to patch-releases/3.2.1/pom.xml. It would be better if you
 can trigger a GS build too.

>>>
>>> Lets wait for the next build cycle. Will do in next Monday.
>>>
>>
>> Its better if you can only build the GS and copy the pack. Because you
>> have built the patch release pom, necessary components must have been built
>> already.
>>
> Hi,
>
> Pradeep is currently working on the builder to deploy some source
> artifacts. It should be finished by today. Will build and host GS and DSS
> tonight.
>

Added DSS.
Got an error building GS, notified the product team.

thanks


>
> thanks,
>
>>
>>> thanks,
>>>
>>>

> thanks,
>
>> Thanks,
>> Yumani
>>
>>
>>
>>>
>>> thanks,
>>>
>>>
>>> On Thu, Jun 23, 2011 at 8:53 AM, Sanjeewa Malalgoda <
>>> sanje...@wso2.com> wrote:
>>>
 +1


 On Thu, Jun 23, 2011 at 8:38 AM, Supun Malinga wrote:

> Hi all,
> Building products now.
> as- is successful
> products build has failed @bam (sent a seperate mail to
> carbon-dev).
> Resumed the build from bps.
>
> thanks,
>
> On Wed, Jun 22, 2011 at 10:39 PM, Supun Malinga 
> wrote:
>
>>
>>
>> On Wed, Jun 22, 2011 at 10:36 PM, Supun Malinga 
>> wrote:
>>
>>> Hi All,
>>>
>>> Do to a mistake the .m2 repo used for building in ec2 has been
>>> deleted in the process of releasing carbon-studio release. :(
>>> Since artifact deployment is finished i'll use the same .m2 repo
>>> and build the 3.2.1 in local builder. Hopefully if there are no 
>>> critical
>>> build failures we can finish the build by mid-day tomorrow.
>>>
>>> Please *DO NOT* use the local builder(10.100.1.43).
>>>
>> account : release1@10.100.1.43
>>
>>
>>> regards,
>>>
>>> On Wed, Jun 22, 2011 at 5:21 PM, Supun Malinga 
>>> wrote:
>>>
 Hi,

 We are @the products stage.


 On Wed, Jun 22, 2011 at 4:58 PM, Dimuthu Leelarathne <
 dimut...@wso2.com> wrote:

> Hi,
>
> Do we have a build now?
>
> tx,
> dimuthu
>
>  On Wed, Jun 22, 2011 at 9:11 AM, Supun Malinga <
> sup...@wso2.com> wrote:
>
>> Hi,
>>
>> building from the core level and up.
>>
>> thanks,
>>
>>
>> On Wed, Jun 22, 2011 at 7:49 AM, Supun Malinga <
>> sup...@wso2.com> wrote:
>>
>>> Build has hanged at a latter stage of the orbit.
>>> Now building orbit and service stubs.
>>>
>>> thanks,
>>>
>>> On Tue, Jun 21, 2011 at 10:09 PM, Supun Malinga <
>>> sup...@wso2.com> wrote:
>>>


 On Tue, Jun 21, 2011 at 10:08 PM, Supun Malinga <
 sup...@wso2.com> wrote:

> Hi All,
>
> currently building 3.2.0 in a clean repo.
> Build still in the dependencies level. Will post here if
> there are any issues and the progress.
>
 revision 108054


>
> thanks,
> --
> Supun Malinga,
>
> Software Engineer,
> WSO2 Inc.
> http://wso2.com
> http://wso2.org
> email - sup...@wso2.com 
> mobile - 071 56 91 3

Re: [Carbon-dev] [Stratos-dev] build triggered for 3.2.1 build in ec2 instance

2011-06-25 Thread Ranga Siriwardena
Hi,

On Sun, Jun 26, 2011 at 12:27 AM, Supun Malinga  wrote:

> Hi,
>
> On Fri, Jun 24, 2011 at 2:02 PM, Supun Malinga  wrote:
>
>>
>>
>> On Fri, Jun 24, 2011 at 1:33 PM, Amila Maha Arachchi wrote:
>>
>>>
>>>
>>> On Fri, Jun 24, 2011 at 12:28 PM, Supun Malinga  wrote:
>>>
 Hi,

 On Fri, Jun 24, 2011 at 11:53 AM, Ranga Siriwardena wrote:

> Hi Supun,
>
> On Fri, Jun 24, 2011 at 11:39 AM, Supun Malinga wrote:
>
>> Hi,
>>
>> On Fri, Jun 24, 2011 at 11:06 AM, Yumani Ranaweera 
>> wrote:
>>
>>>
>>> On Thu, Jun 23, 2011 at 11:11 AM, Supun Malinga wrote:
>>>
 Hi All,

 Some products are having integration test failures. I'll host the
 packs anyway as this the the first build and we need packs quickly. 
 Will do
 another build asap.
 Packs are being hosted @ [1].

 [1] http://10.100.1.43/~carbon/releases/carbon/3.2.1/latest/

>>>
>>>
>>>  GS packs are missing in [1]. Could you please include them too.
>>>
>>
>> both GS and DSS have not been added to patch-releases/3.2.1/pom.xml
>>
>
> GS is added to patch-releases/3.2.1/pom.xml. It would be better if you
> can trigger a GS build too.
>

 Lets wait for the next build cycle. Will do in next Monday.

>>>
>>> Its better if you can only build the GS and copy the pack. Because you
>>> have built the patch release pom, necessary components must have been built
>>> already.
>>>
>> Hi,
>>
>> Pradeep is currently working on the builder to deploy some source
>> artifacts. It should be finished by today. Will build and host GS and DSS
>> tonight.
>>
>
> Added DSS.
> Got an error building GS, notified the product team.
>

Will look in to this..


>
> thanks
>
>
>>
>> thanks,
>>
>>>
 thanks,


>
>> thanks,
>>
>>> Thanks,
>>> Yumani
>>>
>>>
>>>

 thanks,


 On Thu, Jun 23, 2011 at 8:53 AM, Sanjeewa Malalgoda <
 sanje...@wso2.com> wrote:

> +1
>
>
> On Thu, Jun 23, 2011 at 8:38 AM, Supun Malinga wrote:
>
>> Hi all,
>> Building products now.
>> as- is successful
>> products build has failed @bam (sent a seperate mail to
>> carbon-dev).
>> Resumed the build from bps.
>>
>> thanks,
>>
>> On Wed, Jun 22, 2011 at 10:39 PM, Supun Malinga 
>> wrote:
>>
>>>
>>>
>>> On Wed, Jun 22, 2011 at 10:36 PM, Supun Malinga >> > wrote:
>>>
 Hi All,

 Do to a mistake the .m2 repo used for building in ec2 has been
 deleted in the process of releasing carbon-studio release. :(
 Since artifact deployment is finished i'll use the same .m2 repo
 and build the 3.2.1 in local builder. Hopefully if there are no 
 critical
 build failures we can finish the build by mid-day tomorrow.

 Please *DO NOT* use the local builder(10.100.1.43).

>>> account : release1@10.100.1.43
>>>
>>>
 regards,

 On Wed, Jun 22, 2011 at 5:21 PM, Supun Malinga >>> > wrote:

> Hi,
>
> We are @the products stage.
>
>
> On Wed, Jun 22, 2011 at 4:58 PM, Dimuthu Leelarathne <
> dimut...@wso2.com> wrote:
>
>> Hi,
>>
>> Do we have a build now?
>>
>> tx,
>> dimuthu
>>
>>  On Wed, Jun 22, 2011 at 9:11 AM, Supun Malinga <
>> sup...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> building from the core level and up.
>>>
>>> thanks,
>>>
>>>
>>> On Wed, Jun 22, 2011 at 7:49 AM, Supun Malinga <
>>> sup...@wso2.com> wrote:
>>>
 Build has hanged at a latter stage of the orbit.
 Now building orbit and service stubs.

 thanks,

 On Tue, Jun 21, 2011 at 10:09 PM, Supun Malinga <
 sup...@wso2.com> wrote:

>
>
> On Tue, Jun 21, 2011 at 10:08 PM, Supun Malinga <
> sup...@wso2.com> wrote:
>
>> Hi All,
>>
>> currently building 3.2.0 in a clean repo.
>> Build still in the dependencies level. Will post here if
>> there are any issues and the progress.
>>
> revision 108054
>
>
>>
>> thanks,

Re: [Carbon-dev] LB sometimes send malformed XML messages to the backends

2011-06-25 Thread Afkham Azeez
The root cause of this issue is as follows.

As soon as a new worker node joins, and its HTTP/S ports become available,
the LB tries to send messages to that node. However, that node need a few
more seconds to "warm up", hence a few initial requests fail. The failover
mechanism kicks in and tries to resends the message to another instance.
However, an error occurs when it tries to retrieve the original request
envelope, and ends up sending an empty message to the worker node, which
shows up as a malformed XML error when the StAX parser tries to parse the
message.

One measure I have implemented is allowing some warm up time for newly added
worker nodes which solved this problem for the moment. However, the failover
logic is still broken and needs to be fixed.


On Sun, Jun 12, 2011 at 9:21 PM, Sanjiva Weerawarana wrote:

> Not very likely dude :) .. its been in HEAVY use in eBay for a long time
> now. There has to be some other combination of events that triggers this.
>
> Sanjiva.
>
> On Sun, Jun 12, 2011 at 4:25 PM, Sameera Jayasoma wrote:
>
>> Binary relay impl might be failing to handle messages in high concurrency.
>>
>> Thanks,
>> Sameera
>>
>>
>> On Fri, Jun 10, 2011 at 3:34 PM, Afkham Azeez  wrote:
>>
>>> Folks,
>>> Please note $subject. This happens rarely. We are using binary relay in
>>> the LB.
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>> * **
>>> email: **az...@wso2.com* * cell: +94 77 3320919
>>> blog: **http://blog.afkham.org* *
>>> twitter: **http://twitter.com/afkham_azeez*
>>> *
>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>> *
>>> *
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>
>>
>> --
>> Sameera Jayasoma
>> Technical Lead and Product Manager, WSO2 Carbon
>>
>> WSO2, Inc. (http://wso2.com)
>> email: same...@wso2.com
>> blog: http://tech.jayasoma.org
>>
>> Lean . Enterprise . Middleware
>>
>> ___
>> Carbon-dev mailing list
>> Carbon-dev@wso2.org
>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>
>>
>
>
> --
> Sanjiva Weerawarana, Ph.D.
> Founder, Chairman & CEO; WSO2, Inc.;  http://wso2.com/
> email: sanj...@wso2.com; phone: +94 11 763 9614; cell: +94 77 787 6880 | +1
> 650 265 8311
> blog: http://sanjiva.weerawarana.org/
>
> Lean . Enterprise . Middleware
>



-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* **
email: **az...@wso2.com* * cell: +94 77 3320919
blog: **http://blog.afkham.org* *
twitter: **http://twitter.com/afkham_azeez*
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
___
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev


Re: [Carbon-dev] Stratos service aware dynamic LB

2011-06-25 Thread Sanjiva Weerawarana
Very good news Azeez :). Can we run a heavy load test - like what we used to
run for eBay loads?

It also will be important to see how many worker nodes a single LB can
provide sufficient thruput for .. in eBay of course they have a hardware LB
at the highest level. I guess in the new model we can simply add more LBs
and once we do tenant partitioning we can do what Salesforce does and
essentially run multiple Stratos systems for the different partitions.

Sanjiva.

On Sat, Jun 25, 2011 at 10:21 PM, Afkham Azeez  wrote:

> Oops wrong attachment. The correct one is attached to this mail.
>
>
> On Sat, Jun 25, 2011 at 10:19 PM, Afkham Azeez  wrote:
>
>> A load test is underway. The heap graph of the new LB after sending 2+
>> million messages load balanced across two AS instance is attached.
>>
>>
>> On Sat, Jun 25, 2011 at 11:16 AM, Afkham Azeez  wrote:
>>
>>> This is working. I was able to load balance to the AS & G-Reg using a
>>> single LB. Now we can save a few thousand $ from the Amazon bill :)
>>>
>>>
>>> On Sat, Jun 25, 2011 at 2:46 AM, Afkham Azeez  wrote:
>>>
 This has been implemented in the 3.2.0 branch and is almost complete.
 I'm facing a minor issue in trying to getting the requested domain or
 complete URL from the Synapse MessageContext. Once that is fixed, this will
 be complete.


 On Thu, Jun 23, 2011 at 3:39 PM, Afkham Azeez  wrote:

> Oops, I have made a mistake; the http protocol should not be part of
> this configuration; modified configuration shown below;
>
> 
> 
> algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
> 
> class="org.apache.synapse.core.axis2.ServiceAwareLoadBalanceMembershipHandler">
> 
> 
> as.cloud.wso2.com
> wso2as.domain
> 
> 
> esb.cloud.wso2.com
> wso2esb.domain
> 
> 
> governance.cloud.wso2.com
> 
> wso2governance.domain
> 
> 
> gs.cloud.wso2.com
> wso2gs.domain
> 
> 
> 
> 
> 
>
> On Thu, Jun 23, 2011 at 3:36 PM, Afkham Azeez  wrote:
>
>> This is how the endpoint configuration in the synapse.xml will look
>> like;
>>
>> 
>> > failover="true"
>>
>> algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
>> >
>> class="org.apache.synapse.core.axis2.ServiceAwareLoadBalanceMembershipHandler">
>> 
>> 
>> http://as.cloud.wso2.com
>> wso2as.domain
>> 
>> 
>> http://esb.cloud.wso2.com
>> wso2esb.domain
>> 
>> 
>> http://governance.cloud.wso2.com
>> 
>> wso2governance.domain
>> 
>> 
>> http://gs.cloud.wso2.com
>> wso2gs.domain
>> 
>> 
>> 
>> 
>> 
>>
>> On Thu, Jun 23, 2011 at 2:20 PM, Afkham Azeez  wrote:
>>
>>> Folks,
>>> I'm thinking of getting $subject implemented since otherwise we will
>>> have to have a large number of LBs for our services. The plan is to 
>>> write a
>>> new ServiceAwareDynamicLoadBalanceEndpoint, which will do LB based on 
>>> the
>>> service.
>>>
>>> Axis2 already has support for handling multiple cluster domains, so
>>> we will have to write a new Axis2LoadBalanceMembershipHandler which is
>>> service aware.
>>>
>>> The autoscaling would also need to be modified, but autoscaling is
>>> actually a separate aspect, and we can even run the autoscaler 
>>> separately if
>>> we are going for the CPU load average based one.
>>>
>>> Thoughts please.
>>>
>>> Thanks
>>> Azeez
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>>

Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Hiranya Jayathilaka
Hi,

Please try applying the attached patch on Synapse
(modules/transports/core/nhttp). It uses the Host header to construct the
full URI. If the header is not present it uses the information available in
the connection object. HTTP spec mandates that all requests contain the Host
header. So most of the time URI will be constructed using the header.

The full URI will be stored in Constants.Configuration.TRANSPORT_IN_URL.

Thanks,
Hiranya

On Sat, Jun 25, 2011 at 10:15 PM, Afkham Azeez  wrote:

>
>
> On Sat, Jun 25, 2011 at 9:47 PM, Afkham Azeez  wrote:
>
>> Hiranya,
>> Can you please coders that. The servlet API provides such information so
>> this is a shortcoming of the nhttp transport.
>>
>
> Oops... this is what happens when you use the phone keyboard :) I meant,
> can you please fix this so that we can use it in the LB?
>
>
>
>> On Jun 25, 2011 9:33 PM, "Hiranya Jayathilaka"  wrote:
>> > The original request uri is not part of the message. So we cannot obtain
>> it from the http message. But at the transport level we can infer it by
>> looking at the socket. Currently nhttp transport doesn't do that. We can add
>> that bit of logic to the transport if needed.
>> >
>> > Sent from my iPhone
>> >
>> > On Jun 25, 2011, at 8:45 AM, Afkham Azeez  wrote:
>> >
>> >>
>> >>
>> >> On Sat, Jun 25, 2011 at 8:24 PM, Hiranya Jayathilaka 
>> wrote:
>> >> This means you rely on the client to always send the Host header. Might
>> not always work.
>> >>
>> >> Is there a way to get the originally requested URL?
>> >>
>> >> Sent from my iPhone
>> >>
>> >> On Jun 24, 2011, at 9:18 PM, Afkham Azeez  wrote:
>> >>
>> >>> The following code works.
>> >>>
>> >>> Map headers = (Map> String>)((Axis2MessageContext)
>> synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
>> >>>
>> >>> String address = headers.get("Host");
>> >>>
>> >>> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez  wrote:
>> >>>
>> >>>
>> >>> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka <
>> hira...@wso2.com> wrote:
>> >>> I found following on simple HTTP server code:
>> >>>
>> >>> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
>> >>> conn.getLocalAddress().getHostAddress());
>> >>>
>> >>> This returns null for the NHTTP transport
>> >>>
>> >>> But other transports doesn't seem to be setting this. I didn't find
>> anything relevant in servlet transport code :(
>> >>>
>> >>> Thanks,
>> >>> Hiranya
>> >>>
>> >>> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka <
>> hira...@wso2.com> wrote:
>> >>>
>> >>>
>> >>> On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez  wrote:
>> >>> Sorry, this does not work. I had hardcoded the host for testing it, so
>> for subsequent requests that prop was there.
>> >>>
>> >>> It doesn't look like we are keeping track of the full request URI
>> while mediation. The NHTTP transport sets a property named "TransportInURL"
>> (which I think other transports are setting too) on Axis2 message context
>> upon receiving a request. But I'm not sure even that will give the full URL.
>> Here's the implementation from NHTTP transport:
>> >>>
>> >>> msgContext.setProperty(
>> >>> Constants.Configuration.TRANSPORT_IN_URL,
>> request.getRequestLine().getUri());
>> >>>
>> >>> Very often the URI extracted from the request line is a relative URI
>> and so will not contain the hostname part. Worth trying out though.
>> >>>
>> >>> BTW can't we just infer the hostname part since we know the hostname
>> of the server where the code is running?
>> >>>
>> >>> Thanks,
>> >>> Hiranya
>> >>>
>> >>>
>> >>>
>> >>> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez  wrote:
>> >>> I found a way to get this. Hope it is the proper way of handling this.
>> >>>
>> >>>
>> ((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")
>>
>> >>>
>> >>>
>> >>> On Sat, Jun 25, 2011 at 2:39 AM, Afkham Azeez  wrote:
>> >>> Folks,
>> >>> To implement the Service-aware LB, I need to get the requested host
>> name. The MessageContext.getTo() method does not return the hostname part.
>> Is there any other way to get this, perhaps from the transport headers?
>> >>>
>> >>> Thanks
>> >>> Azeez
>> >>>
>> >>> --
>> >>> Afkham Azeez
>> >>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> >>> Member; Apache Software Foundation; http://www.apache.org/
>> >>>
>> >>> email: az...@wso2.com cell: +94 77 3320919
>> >>> blog: http://blog.afkham.org
>> >>> twitter: http://twitter.com/afkham_azeez
>> >>> linked-in: http://lk.linkedin.com/in/afkhamazeez
>> >>>
>> >>> Lean . Enterprise . Middleware
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Afkham Azeez
>> >>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> >>> Member; Apache Software Foundation; http://www.apache.org/
>> >>>
>> >>> email: az...@wso2.com cell: +94 77 3320919
>> >>> blog: http://blog.afkham.org
>> >>> twitter: http://twitter.com/afkham_azeez
>> >>> linked-in: http://lk.linkedin

Re: [Carbon-dev] Stratos service aware dynamic LB

2011-06-25 Thread Afkham Azeez
On Sun, Jun 26, 2011 at 10:25 AM, Sanjiva Weerawarana wrote:

> Very good news Azeez :). Can we run a heavy load test - like what we used
> to run for eBay loads?


ESB team, can you guys help me set up this test?


>
> It also will be important to see how many worker nodes a single LB can
> provide sufficient thruput for .. in eBay of course they have a hardware LB
> at the highest level. I guess in the new model we can simply add more LBs
> and once we do tenant partitioning we can do what Salesforce does and
> essentially run multiple Stratos systems for the different partitions.
>

Yes, we can have a hierarchy of LBs with the new model. The average memory
footprint is even smaller when we run the LB without failover.


>
> Sanjiva.
>
>
> On Sat, Jun 25, 2011 at 10:21 PM, Afkham Azeez  wrote:
>
>> Oops wrong attachment. The correct one is attached to this mail.
>>
>>
>> On Sat, Jun 25, 2011 at 10:19 PM, Afkham Azeez  wrote:
>>
>>> A load test is underway. The heap graph of the new LB after sending 2+
>>> million messages load balanced across two AS instance is attached.
>>>
>>>
>>> On Sat, Jun 25, 2011 at 11:16 AM, Afkham Azeez  wrote:
>>>
 This is working. I was able to load balance to the AS & G-Reg using a
 single LB. Now we can save a few thousand $ from the Amazon bill :)


 On Sat, Jun 25, 2011 at 2:46 AM, Afkham Azeez  wrote:

> This has been implemented in the 3.2.0 branch and is almost complete.
> I'm facing a minor issue in trying to getting the requested domain or
> complete URL from the Synapse MessageContext. Once that is fixed, this 
> will
> be complete.
>
>
> On Thu, Jun 23, 2011 at 3:39 PM, Afkham Azeez  wrote:
>
>> Oops, I have made a mistake; the http protocol should not be part of
>> this configuration; modified configuration shown below;
>>
>> 
>> > failover="true"
>>
>> algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
>> >
>> class="org.apache.synapse.core.axis2.ServiceAwareLoadBalanceMembershipHandler">
>> 
>> 
>> as.cloud.wso2.com
>> wso2as.domain
>> 
>> 
>> esb.cloud.wso2.com
>> wso2esb.domain
>> 
>> 
>> governance.cloud.wso2.com
>> 
>> wso2governance.domain
>> 
>> 
>> gs.cloud.wso2.com
>> wso2gs.domain
>> 
>> 
>> 
>> 
>> 
>>
>> On Thu, Jun 23, 2011 at 3:36 PM, Afkham Azeez  wrote:
>>
>>> This is how the endpoint configuration in the synapse.xml will look
>>> like;
>>>
>>> 
>>> >> failover="true"
>>>
>>> algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
>>> >>
>>> class="org.apache.synapse.core.axis2.ServiceAwareLoadBalanceMembershipHandler">
>>> 
>>> 
>>> http://as.cloud.wso2.com
>>> wso2as.domain
>>> 
>>> 
>>> http://esb.cloud.wso2.com
>>> wso2esb.domain
>>> 
>>> 
>>> 
>>> http://governance.cloud.wso2.com
>>>
>>> wso2governance.domain
>>> 
>>> 
>>> http://gs.cloud.wso2.com
>>> wso2gs.domain
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>> On Thu, Jun 23, 2011 at 2:20 PM, Afkham Azeez wrote:
>>>
 Folks,
 I'm thinking of getting $subject implemented since otherwise we will
 have to have a large number of LBs for our services. The plan is to 
 write a
 new ServiceAwareDynamicLoadBalanceEndpoint, which will do LB based on 
 the
 service.

 Axis2 already has support for handling multiple cluster domains, so
 we will have to write a new Axis2LoadBalanceMembershipHandler which is
 service aware.

 The autoscaling would also need to be modified, but autoscaling is
>>>

Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Afkham Azeez
On Sun, Jun 26, 2011 at 11:34 AM, Hiranya Jayathilaka wrote:

> Hi,
>
> Please try applying the attached patch on Synapse
> (modules/transports/core/nhttp). It uses the Host header to construct the
> full URI. If the header is not present it uses the information available in
> the connection object. HTTP spec mandates that all requests contain the Host
> header. So most of the time URI will be constructed using the header.
>

Well, you said earlier that clients may not send the Host header. If the
HTTP spec mandates the Host header, then such clients are violating the spec
right? So, from our end, it is not unreasonable to assume that the client
always send the Host header, right?


>
> The full URI will be stored in Constants.Configuration.TRANSPORT_IN_URL.
>
> Thanks,
> Hiranya
>
>
> On Sat, Jun 25, 2011 at 10:15 PM, Afkham Azeez  wrote:
>
>>
>>
>> On Sat, Jun 25, 2011 at 9:47 PM, Afkham Azeez  wrote:
>>
>>> Hiranya,
>>> Can you please coders that. The servlet API provides such information so
>>> this is a shortcoming of the nhttp transport.
>>>
>>
>> Oops... this is what happens when you use the phone keyboard :) I meant,
>> can you please fix this so that we can use it in the LB?
>>
>>
>>
>>> On Jun 25, 2011 9:33 PM, "Hiranya Jayathilaka"  wrote:
>>> > The original request uri is not part of the message. So we cannot
>>> obtain it from the http message. But at the transport level we can infer it
>>> by looking at the socket. Currently nhttp transport doesn't do that. We can
>>> add that bit of logic to the transport if needed.
>>> >
>>> > Sent from my iPhone
>>> >
>>> > On Jun 25, 2011, at 8:45 AM, Afkham Azeez  wrote:
>>> >
>>> >>
>>> >>
>>> >> On Sat, Jun 25, 2011 at 8:24 PM, Hiranya Jayathilaka <
>>> hira...@wso2.com> wrote:
>>> >> This means you rely on the client to always send the Host header.
>>> Might not always work.
>>> >>
>>> >> Is there a way to get the originally requested URL?
>>> >>
>>> >> Sent from my iPhone
>>> >>
>>> >> On Jun 24, 2011, at 9:18 PM, Afkham Azeez  wrote:
>>> >>
>>> >>> The following code works.
>>> >>>
>>> >>> Map headers = (Map>> String>)((Axis2MessageContext)
>>> synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
>>> >>>
>>> >>> String address = headers.get("Host");
>>> >>>
>>> >>> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez 
>>> wrote:
>>> >>>
>>> >>>
>>> >>> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka <
>>> hira...@wso2.com> wrote:
>>> >>> I found following on simple HTTP server code:
>>> >>>
>>> >>> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
>>> >>> conn.getLocalAddress().getHostAddress());
>>> >>>
>>> >>> This returns null for the NHTTP transport
>>> >>>
>>> >>> But other transports doesn't seem to be setting this. I didn't find
>>> anything relevant in servlet transport code :(
>>> >>>
>>> >>> Thanks,
>>> >>> Hiranya
>>> >>>
>>> >>> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka <
>>> hira...@wso2.com> wrote:
>>> >>>
>>> >>>
>>> >>> On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez 
>>> wrote:
>>> >>> Sorry, this does not work. I had hardcoded the host for testing it,
>>> so for subsequent requests that prop was there.
>>> >>>
>>> >>> It doesn't look like we are keeping track of the full request URI
>>> while mediation. The NHTTP transport sets a property named "TransportInURL"
>>> (which I think other transports are setting too) on Axis2 message context
>>> upon receiving a request. But I'm not sure even that will give the full URL.
>>> Here's the implementation from NHTTP transport:
>>> >>>
>>> >>> msgContext.setProperty(
>>> >>> Constants.Configuration.TRANSPORT_IN_URL,
>>> request.getRequestLine().getUri());
>>> >>>
>>> >>> Very often the URI extracted from the request line is a relative URI
>>> and so will not contain the hostname part. Worth trying out though.
>>> >>>
>>> >>> BTW can't we just infer the hostname part since we know the hostname
>>> of the server where the code is running?
>>> >>>
>>> >>> Thanks,
>>> >>> Hiranya
>>> >>>
>>> >>>
>>> >>>
>>> >>> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez 
>>> wrote:
>>> >>> I found a way to get this. Hope it is the proper way of handling
>>> this.
>>> >>>
>>> >>>
>>> ((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")
>>>
>>> >>>
>>> >>>
>>> >>> On Sat, Jun 25, 2011 at 2:39 AM, Afkham Azeez 
>>> wrote:
>>> >>> Folks,
>>> >>> To implement the Service-aware LB, I need to get the requested host
>>> name. The MessageContext.getTo() method does not return the hostname part.
>>> Is there any other way to get this, perhaps from the transport headers?
>>> >>>
>>> >>> Thanks
>>> >>> Azeez
>>> >>>
>>> >>> --
>>> >>> Afkham Azeez
>>> >>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> >>> Member; Apache Software Foundation; http://www.apache.org/
>>> >>>
>>> >>> email: az...@wso2.com cell: +94 77 3320919
>>> >>> blog: http://blog.afkham.org
>>

Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Afkham Azeez
Also Hiranya,
Do you think the following method you have used in your patch will work when
there are multiple hostnames mapped to a single machine;

NhttpUtil.getHostName(httpConn.getLocalAddress())

My requirement is to simply get the Host from the request. For example, on
my machine, I have appserver.cloud-test.wso2.com,
esb.cloud-test.wso2.cometc. all mapped to 127.0.0.1


On Sun, Jun 26, 2011 at 11:48 AM, Afkham Azeez  wrote:

>
>
> On Sun, Jun 26, 2011 at 11:34 AM, Hiranya Jayathilaka wrote:
>
>> Hi,
>>
>> Please try applying the attached patch on Synapse
>> (modules/transports/core/nhttp). It uses the Host header to construct the
>> full URI. If the header is not present it uses the information available in
>> the connection object. HTTP spec mandates that all requests contain the Host
>> header. So most of the time URI will be constructed using the header.
>>
>
> Well, you said earlier that clients may not send the Host header. If the
> HTTP spec mandates the Host header, then such clients are violating the spec
> right? So, from our end, it is not unreasonable to assume that the client
> always send the Host header, right?
>
>
>>
>> The full URI will be stored in Constants.Configuration.TRANSPORT_IN_URL.
>>
>> Thanks,
>> Hiranya
>>
>>
>> On Sat, Jun 25, 2011 at 10:15 PM, Afkham Azeez  wrote:
>>
>>>
>>>
>>> On Sat, Jun 25, 2011 at 9:47 PM, Afkham Azeez  wrote:
>>>
 Hiranya,
 Can you please coders that. The servlet API provides such information so
 this is a shortcoming of the nhttp transport.

>>>
>>> Oops... this is what happens when you use the phone keyboard :) I meant,
>>> can you please fix this so that we can use it in the LB?
>>>
>>>
>>>
 On Jun 25, 2011 9:33 PM, "Hiranya Jayathilaka" 
 wrote:
 > The original request uri is not part of the message. So we cannot
 obtain it from the http message. But at the transport level we can infer it
 by looking at the socket. Currently nhttp transport doesn't do that. We can
 add that bit of logic to the transport if needed.
 >
 > Sent from my iPhone
 >
 > On Jun 25, 2011, at 8:45 AM, Afkham Azeez  wrote:
 >
 >>
 >>
 >> On Sat, Jun 25, 2011 at 8:24 PM, Hiranya Jayathilaka <
 hira...@wso2.com> wrote:
 >> This means you rely on the client to always send the Host header.
 Might not always work.
 >>
 >> Is there a way to get the originally requested URL?
 >>
 >> Sent from my iPhone
 >>
 >> On Jun 24, 2011, at 9:18 PM, Afkham Azeez  wrote:
 >>
 >>> The following code works.
 >>>
 >>> Map headers = (Map>>> String>)((Axis2MessageContext)
 synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
 >>>
 >>> String address = headers.get("Host");
 >>>
 >>> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez 
 wrote:
 >>>
 >>>
 >>> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka <
 hira...@wso2.com> wrote:
 >>> I found following on simple HTTP server code:
 >>>
 >>> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
 >>> conn.getLocalAddress().getHostAddress());
 >>>
 >>> This returns null for the NHTTP transport
 >>>
 >>> But other transports doesn't seem to be setting this. I didn't find
 anything relevant in servlet transport code :(
 >>>
 >>> Thanks,
 >>> Hiranya
 >>>
 >>> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka <
 hira...@wso2.com> wrote:
 >>>
 >>>
 >>> On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez 
 wrote:
 >>> Sorry, this does not work. I had hardcoded the host for testing it,
 so for subsequent requests that prop was there.
 >>>
 >>> It doesn't look like we are keeping track of the full request URI
 while mediation. The NHTTP transport sets a property named "TransportInURL"
 (which I think other transports are setting too) on Axis2 message context
 upon receiving a request. But I'm not sure even that will give the full 
 URL.
 Here's the implementation from NHTTP transport:
 >>>
 >>> msgContext.setProperty(
 >>> Constants.Configuration.TRANSPORT_IN_URL,
 request.getRequestLine().getUri());
 >>>
 >>> Very often the URI extracted from the request line is a relative URI
 and so will not contain the hostname part. Worth trying out though.
 >>>
 >>> BTW can't we just infer the hostname part since we know the hostname
 of the server where the code is running?
 >>>
 >>> Thanks,
 >>> Hiranya
 >>>
 >>>
 >>>
 >>> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez 
 wrote:
 >>> I found a way to get this. Hope it is the proper way of handling
 this.
 >>>
 >>>
 ((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")

 >>>
 >>>
 >>> On Sat, Jun 25, 2011 a

Re: [Carbon-dev] How to get the requested hostname from the Synapse MessageContext?

2011-06-25 Thread Afkham Azeez
It is the HTTP 1.1 spec that mandates the Host header. So, our LB as it
stands now, will not work with HTTP 1.0.

On Sun, Jun 26, 2011 at 11:48 AM, Afkham Azeez  wrote:

>
>
> On Sun, Jun 26, 2011 at 11:34 AM, Hiranya Jayathilaka wrote:
>
>> Hi,
>>
>> Please try applying the attached patch on Synapse
>> (modules/transports/core/nhttp). It uses the Host header to construct the
>> full URI. If the header is not present it uses the information available in
>> the connection object. HTTP spec mandates that all requests contain the Host
>> header. So most of the time URI will be constructed using the header.
>>
>
> Well, you said earlier that clients may not send the Host header. If the
> HTTP spec mandates the Host header, then such clients are violating the spec
> right? So, from our end, it is not unreasonable to assume that the client
> always send the Host header, right?
>
>
>>
>> The full URI will be stored in Constants.Configuration.TRANSPORT_IN_URL.
>>
>> Thanks,
>> Hiranya
>>
>>
>> On Sat, Jun 25, 2011 at 10:15 PM, Afkham Azeez  wrote:
>>
>>>
>>>
>>> On Sat, Jun 25, 2011 at 9:47 PM, Afkham Azeez  wrote:
>>>
 Hiranya,
 Can you please coders that. The servlet API provides such information so
 this is a shortcoming of the nhttp transport.

>>>
>>> Oops... this is what happens when you use the phone keyboard :) I meant,
>>> can you please fix this so that we can use it in the LB?
>>>
>>>
>>>
 On Jun 25, 2011 9:33 PM, "Hiranya Jayathilaka" 
 wrote:
 > The original request uri is not part of the message. So we cannot
 obtain it from the http message. But at the transport level we can infer it
 by looking at the socket. Currently nhttp transport doesn't do that. We can
 add that bit of logic to the transport if needed.
 >
 > Sent from my iPhone
 >
 > On Jun 25, 2011, at 8:45 AM, Afkham Azeez  wrote:
 >
 >>
 >>
 >> On Sat, Jun 25, 2011 at 8:24 PM, Hiranya Jayathilaka <
 hira...@wso2.com> wrote:
 >> This means you rely on the client to always send the Host header.
 Might not always work.
 >>
 >> Is there a way to get the originally requested URL?
 >>
 >> Sent from my iPhone
 >>
 >> On Jun 24, 2011, at 9:18 PM, Afkham Azeez  wrote:
 >>
 >>> The following code works.
 >>>
 >>> Map headers = (Map>>> String>)((Axis2MessageContext)
 synCtx).getAxis2MessageContext().getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
 >>>
 >>> String address = headers.get("Host");
 >>>
 >>> On Sat, Jun 25, 2011 at 9:36 AM, Afkham Azeez 
 wrote:
 >>>
 >>>
 >>> On Sat, Jun 25, 2011 at 4:47 AM, Hiranya Jayathilaka <
 hira...@wso2.com> wrote:
 >>> I found following on simple HTTP server code:
 >>>
 >>> msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
 >>> conn.getLocalAddress().getHostAddress());
 >>>
 >>> This returns null for the NHTTP transport
 >>>
 >>> But other transports doesn't seem to be setting this. I didn't find
 anything relevant in servlet transport code :(
 >>>
 >>> Thanks,
 >>> Hiranya
 >>>
 >>> On Sat, Jun 25, 2011 at 3:48 AM, Hiranya Jayathilaka <
 hira...@wso2.com> wrote:
 >>>
 >>>
 >>> On Sat, Jun 25, 2011 at 3:07 AM, Afkham Azeez 
 wrote:
 >>> Sorry, this does not work. I had hardcoded the host for testing it,
 so for subsequent requests that prop was there.
 >>>
 >>> It doesn't look like we are keeping track of the full request URI
 while mediation. The NHTTP transport sets a property named "TransportInURL"
 (which I think other transports are setting too) on Axis2 message context
 upon receiving a request. But I'm not sure even that will give the full 
 URL.
 Here's the implementation from NHTTP transport:
 >>>
 >>> msgContext.setProperty(
 >>> Constants.Configuration.TRANSPORT_IN_URL,
 request.getRequestLine().getUri());
 >>>
 >>> Very often the URI extracted from the request line is a relative URI
 and so will not contain the hostname part. Worth trying out though.
 >>>
 >>> BTW can't we just infer the hostname part since we know the hostname
 of the server where the code is running?
 >>>
 >>> Thanks,
 >>> Hiranya
 >>>
 >>>
 >>>
 >>> On Sat, Jun 25, 2011 at 2:57 AM, Afkham Azeez 
 wrote:
 >>> I found a way to get this. Hope it is the proper way of handling
 this.
 >>>
 >>>
 ((Axis2MessageContext)synCtx).getAxis2MessageContext().getConfigurationContext().getProperty("synapse.endpoint.lb.algorithm.sdlbEndpointhost")

 >>>
 >>>
 >>> On Sat, Jun 25, 2011 at 2:39 AM, Afkham Azeez 
 wrote:
 >>> Folks,
 >>> To implement the Service-aware LB, I need to get the requested host
 name. The MessageContext.getTo() method does not return the hostname part.
 Is there any other way to get this, perhaps from t