On Fri, May 17, 2013 at 12:11 PM, Sanjeewa Malalgoda <[email protected]>wrote:
> > > On Fri, May 17, 2013 at 12:09 PM, Afkham Azeez <[email protected]> wrote: > >> >> >> On Fri, May 17, 2013 at 11:59 AM, Afkham Azeez <[email protected]> wrote: >> >>> >>> >>> On Fri, May 17, 2013 at 11:54 AM, Dushan Abeyruwan <[email protected]>wrote: >>> >>>> Hay >>>> May be due to these chagners latest ESB pack build after 16th May >>>> is broken... simply we can not invoke proxy services.. it return something >>>> as below.. >>>> >>>> 013-05-17 11:44:41,413] WARN - ActivationHandler Failed attempt to >>>> access WSO2 Enterprise Service Bus by tenant -1 >>>> [2013-05-17 11:44:41,960] WARN - ActivationHandler Failed attempt to >>>> access WSO2 Enterprise Service Bus by tenant -1 >>>> [2013-05-17 11:44:42,460] WARN - ActivationHandler Failed attempt to >>>> access WSO2 Enterprise Service Bus by tenant -1 >>>> [2013-05-17 11:44:49,316] WARN - ActivationHandler Failed attempt to >>>> access WSO2 Enterprise Service Bus by tenant -1 >>>> ^C[2013-05-17 11:45:18,573] INFO - CarbonServerManager Shutdown hook >>>> triggered.... >>>> >>> >>> Yeah, the proper fix for all these issues would be to properly set the >>> correct CC in the upstream code. There should be an upstream handler that >>> can do this. >>> >> >> Can you please do a quick test. Send a request to a proxy service hosted >> on ST or a tenant, and in the dispatcher, debug & find the value of >> CarbonContext.getThreadLocalContext().getId(), and see whether the proper >> value is shown. >> > Yes i did test that. It will return -1 and that's the root cause for the > issue dushan mentioned. > So ThreadLocal CC has never worked for PTT/NHTTP so we need to fix it. We can have a handler called CarbonContextCreatorHandler & deploy it in the transport phase, and in that handler you have to create the CC and set it as a ThreadLocal variable. The other option is to remove the ActivationHandler in the API gateway as a temporary fix. > >> >>> >>> >>>> >>>> >>>> >>>> >>>> >>>> On Fri, May 17, 2013 at 11:47 AM, Sanjeewa Malalgoda <[email protected] >>>> > wrote: >>>> >>>>> Hi All, >>>>> If i send request to API deployed in synapse(in tenants space) and try >>>>> to get carbon context inside invoke method of handler i'm getting >>>>> unexpected result. See following code. Ideally this should returns tenant >>>>> id of service deployed tenant. API url is >>>>> http://10.200.3.87:8280/t/vvv.vvv/aaa/1.0.0 (tenant vvv.vvv's tenant >>>>> id is 1). WDYT? Where should we fix it? >>>>> >>>>> public class MyHandler extends AbstractHandler implements Handler { >>>>> >>>>> public InvocationResponse invoke(MessageContext messageContext) >>>>> throws AxisFault { >>>>> >>>>> PrivilegedCarbonContext carbonContext = >>>>> >>>>> PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); / >>>>> */returns -1 as tenant ID while actual tenant id is 1* >>>>> >>>>> PrivilegedCarbonContext carbonContext = >>>>> >>>>> PrivilegedCarbonContext.getCurrentContext(messageContext).getTenantId(); / >>>>> */returns -1234 as tenant ID **while actual tenant id is 1* >>>>> } >>>>> >>>>> >>>>> Thanks, >>>>> Sanjeewa, >>>>> -- >>>>> *Sanjeewa Malalgoda* >>>>> WSO2 Inc. >>>>> Mobile : +14084122175 | +94713068779 >>>>> >>>>> <http://sanjeewamalalgoda.blogspot.com/>blog >>>>> :http://sanjeewamalalgoda.blogspot.com/<http://sanjeewamalalgoda.blogspot.com/> >>>>> >>>> >>>> >>>> >>>> -- >>>> Dushan Abeyruwan >>>> *Senior Software Engineer* >>>> *Integration Technologies Team* >>>> *Member of Integration MC* >>>> *WSO2 Inc. http://wso2.com/* >>>> *Mobile:(+94)714408632* >>>> >>> >>> >>> >>> -- >>> *Afkham Azeez* >>> Director of Architecture; WSO2, Inc.; http://wso2.com >>> Member; Apache Software Foundation; http://www.apache.org/ >>> * <http://www.apache.org/>** >>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919 >>> blog: **http://blog.afkham.org* <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/ >> * <http://www.apache.org/>** >> email: **[email protected]* <[email protected]>* cell: +94 77 3320919 >> blog: **http://blog.afkham.org* <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* >> > > > > -- > *Sanjeewa Malalgoda* > WSO2 Inc. > Mobile : +14084122175 | +94713068779 > > <http://sanjeewamalalgoda.blogspot.com/>blog > :http://sanjeewamalalgoda.blogspot.com/<http://sanjeewamalalgoda.blogspot.com/> > -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * <http://www.apache.org/>** email: **[email protected]* <[email protected]>* cell: +94 77 3320919 blog: **http://blog.afkham.org* <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*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
