Hi All,

org.apache.axis2.context.MessageContext.java does not return all the
properties with getProperties().

I guess that is the reason why each property is added separately
in TenantTransportSender.

Here I have attached two patches.

MT-axis.patch - This will give the fix properly

MT-Jira.patch - This will just add the property for the given scenario.

I think we can patch kernel and do the MT-axis.patch for esb 4.9.0

Best Regards,
Malaka


On Wed, Jun 25, 2014 at 8:44 AM, Malaka Silva <[email protected]> wrote:

> Hi,
>
> We can't think any reason to not doing that.
>
> I guess we can try this now? If something goes wrong we will see this in
> ESB 4.9.0 testing?
>
> Best Regards,
> Malaka
>
>
> On Sun, Jun 22, 2014 at 9:36 AM, Malaka Silva <[email protected]> wrote:
>
>> As advised by Miyuru added the property to [1] and it seems to be working.
>>
>> However can we loop all properties and add all at once instead of one by
>> one?
>>
>> Any reason for not doing this?
>>
>> [1]
>> http://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.2.0/patches/patch0006/core/org.wso2.carbon.core/4.2.0/src/main/java/org/wso2/carbon/core/multitenancy/transports/TenantTransportSender.java
>>
>>
>> On Sun, Jun 22, 2014 at 8:45 AM, Miyuru Wanninayaka <[email protected]>
>> wrote:
>>
>>> Probably this property is not getting copied from Tenant MC to ST MC in
>>> tenant transport sender.
>>>
>>>
>>> On Sun, Jun 22, 2014 at 5:44 PM, Malaka Silva <[email protected]> wrote:
>>>
>>>> Hi Guys,
>>>>
>>>> When I debugged the code it goes in this flow.
>>>>
>>>> Server Worker (m1) --> MultitenantMessageReceiver(m1 --> m2) -->
>>>> PropertyMediator(m1) --> Axis2FlexibleMEPClient(m1) --> TargetRequest(m2)
>>>>
>>>> POST_TO_URL comes upto Axis2FlexibleMEPClient. However it's lost at 
>>>> TargetRequest
>>>> level. Due to this property is now working.
>>>>
>>>> This is working fine with super tenant. Can't figure out the case.
>>>>
>>>> Related jira can be found at [1]
>>>>
>>>> [1] https://wso2.org/jira/browse/ESBJAVA-3171
>>>>
>>>> Any ideas?
>>>>
>>>> Best Regards,
>>>>
>>>> Malaka Silva
>>>> Senior Tech Lead
>>>> M: +94 777 219 791
>>>> Tel : 94 11 214 5345
>>>> Fax :94 11 2145300
>>>> Skype : malaka.sampath.silva
>>>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>>>> Blog : http://mrmalakasilva.blogspot.com/
>>>>
>>>> WSO2, Inc.
>>>> lean . enterprise . middleware
>>>> http://www.wso2.com/
>>>> http://www.wso2.com/about/team/malaka-silva/
>>>> <http://wso2.com/about/team/malaka-silva/>
>>>>
>>>> Save a tree -Conserve nature & Save the world for your future. Print
>>>> this email only if it is absolutely necessary.
>>>>
>>>
>>>
>>>
>>> --
>>> Miyuru Wanninayaka
>>> Senior Technical Lead
>>> WSO2 Inc. : http://wso2.com
>>>
>>> Mobile : +94 77 209 9788
>>>
>>
>>
>>
>> --
>>
>> Best Regards,
>>
>> Malaka Silva
>> Senior Tech Lead
>> M: +94 777 219 791
>> Tel : 94 11 214 5345
>> Fax :94 11 2145300
>> Skype : malaka.sampath.silva
>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>> Blog : http://mrmalakasilva.blogspot.com/
>>
>> WSO2, Inc.
>> lean . enterprise . middleware
>> http://www.wso2.com/
>> http://www.wso2.com/about/team/malaka-silva/
>> <http://wso2.com/about/team/malaka-silva/>
>>
>> Save a tree -Conserve nature & Save the world for your future. Print this
>> email only if it is absolutely necessary.
>>
>
>
>
> --
>
> Best Regards,
>
> Malaka Silva
> Senior Tech Lead
> M: +94 777 219 791
> Tel : 94 11 214 5345
> Fax :94 11 2145300
> Skype : malaka.sampath.silva
> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
> Blog : http://mrmalakasilva.blogspot.com/
>
> WSO2, Inc.
> lean . enterprise . middleware
> http://www.wso2.com/
> http://www.wso2.com/about/team/malaka-silva/
> <http://wso2.com/about/team/malaka-silva/>
>
> Save a tree -Conserve nature & Save the world for your future. Print this
> email only if it is absolutely necessary.
>



-- 

Best Regards,

Malaka Silva
Senior Tech Lead
M: +94 777 219 791
Tel : 94 11 214 5345
Fax :94 11 2145300
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/

WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
http://www.wso2.com/about/team/malaka-silva/
<http://wso2.com/about/team/malaka-silva/>

Save a tree -Conserve nature & Save the world for your future. Print this
email only if it is absolutely necessary.
Index: src/main/java/org/wso2/carbon/core/multitenancy/transports/TenantTransportSender.java
===================================================================
--- src/main/java/org/wso2/carbon/core/multitenancy/transports/TenantTransportSender.java	(revision 201572)
+++ src/main/java/org/wso2/carbon/core/multitenancy/transports/TenantTransportSender.java	(working copy)
@@ -50,10 +50,13 @@
     public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
         MessageContext superTenantOutMessageContext =
                 this.superTenantConfigurationContext.createMessageContext();
-        superTenantOutMessageContext.setProperty(MessageContext.TRANSPORT_OUT,
-                msgContext.getProperty(MessageContext.TRANSPORT_OUT));
-        superTenantOutMessageContext.setProperty(Constants.OUT_TRANSPORT_INFO,
-                msgContext.getProperty(Constants.OUT_TRANSPORT_INFO));
+        
+        //Copy all the properties
+        Map<String, Object> mOriginalProperties = msgContext.getProperties();        
+        for(String strKey:mOriginalProperties.keySet()){
+        	superTenantOutMessageContext.setProperty(strKey, mOriginalProperties.get(strKey));
+        }
+        
 
         AxisConfiguration supperTenantAxisConfiguration =
                 this.superTenantConfigurationContext.getAxisConfiguration();
@@ -84,16 +87,7 @@
 
         superTenantOutMessageContext.setEnvelope(msgContext.getEnvelope());
 
-        superTenantOutMessageContext.setTo(msgContext.getTo());
-        superTenantOutMessageContext.setSoapAction(msgContext.getSoapAction());
-        superTenantOutMessageContext.setDoingREST(msgContext.isDoingREST());
-        superTenantOutMessageContext.setDoingMTOM(msgContext.isDoingMTOM());
-        superTenantOutMessageContext.setProperty(MessageContext.TRANSPORT_HEADERS,
-                msgContext.getProperty(MessageContext.TRANSPORT_HEADERS));
-        
-        superTenantOutMessageContext.setProperty(MultitenantConstants.HTTP_SC,msgContext.getProperty(MultitenantConstants.HTTP_SC));
 
-
         // Copy Message type and Content type from the original message ctx
         // so that the content type will be set properly
         String msgTypeProperty = (String)
@@ -108,20 +102,6 @@
 
         superTenantOutMessageContext.setDoingMTOM(msgContext.isDoingMTOM());
 
-        superTenantOutMessageContext.setProperty(org.apache.axis2.Constants.Configuration.CHARACTER_SET_ENCODING,
-                msgContext.getProperty(org.apache.axis2.Constants.Configuration.CHARACTER_SET_ENCODING));
-        superTenantOutMessageContext.setProperty(org.apache.axis2.Constants.Configuration.ENABLE_MTOM,
-                msgContext.getProperty(org.apache.axis2.Constants.Configuration.ENABLE_MTOM));
-        superTenantOutMessageContext.setProperty(org.apache.axis2.Constants.Configuration.ENABLE_SWA,
-                msgContext.getProperty(org.apache.axis2.Constants.Configuration.ENABLE_SWA));
-        superTenantOutMessageContext.setProperty(Constants.Configuration.HTTP_METHOD,
-                msgContext.getProperty(Constants.Configuration.HTTP_METHOD));
-        superTenantOutMessageContext.setProperty(MultitenantConstants.DISABLE_CHUNKING,
-                msgContext.getProperty(MultitenantConstants.DISABLE_CHUNKING));
-        superTenantOutMessageContext.setProperty(MultitenantConstants.NO_KEEPALIVE,
-                msgContext.getProperty(MultitenantConstants.NO_KEEPALIVE));
-
-
         Map headers = (Map) msgContext.getProperty(MessageContext.TRANSPORT_HEADERS);
 
         if (headers != null && headers.get(MultitenantConstants.CONTENT_LENGTH) != null) {
===================================================================
--- dependencies/axis2/modules/kernel/src/org/apache/axis2/context/MessageContext.java	(revision 201572)
+++ dependencies/axis2/modules/kernel/src/org/apache/axis2/context/MessageContext.java	(working copy)
@@ -1020,6 +1020,9 @@
         // nearest level is present and add the properties
         // We have to access the contexts in reverse order, in order to allow
         // a nearer context to overwrite values from a more distant context
+        
+        resultMap.putAll(super.getProperties());
+        
         if (configurationContext != null) {
             resultMap.putAll(configurationContext.getProperties());
         }

Index: src/main/java/org/wso2/carbon/utils/multitenancy/MultitenantConstants.java
===================================================================
--- src/main/java/org/wso2/carbon/utils/multitenancy/MultitenantConstants.java	(revision 201572)
+++ src/main/java/org/wso2/carbon/utils/multitenancy/MultitenantConstants.java	(working copy)
@@ -82,6 +82,10 @@
      * Properties required for evaluating Content-Length and Chunk Disabling
      */
     public static final String FORCE_HTTP_CONTENT_LENGTH = "FORCE_HTTP_CONTENT_LENGTH";
+    /**
+     * Properties required for evaluating POST_TO_URI
+     */    
+    public static final String POST_TO_URI = "POST_TO_URI";
 
     public static final String COPY_CONTENT_LENGTH_FROM_INCOMING = "COPY_CONTENT_LENGTH_FROM_INCOMING";
     public final static String PASSTROUGH_MESSAGE_LENGTH = "PASSTROUGH_MESSAGE_LENGTH";

Index: src/main/java/org/wso2/carbon/core/multitenancy/transports/TenantTransportSender.java
===================================================================
--- src/main/java/org/wso2/carbon/core/multitenancy/transports/TenantTransportSender.java	(revision 201572)
+++ src/main/java/org/wso2/carbon/core/multitenancy/transports/TenantTransportSender.java	(working copy)
@@ -132,6 +139,8 @@
         boolean forceContentLength = msgContext.isPropertyTrue(MultitenantConstants.FORCE_HTTP_CONTENT_LENGTH);
         boolean contentLengthCopy = msgContext.isPropertyTrue(MultitenantConstants.
                 COPY_CONTENT_LENGTH_FROM_INCOMING);
+        
+        superTenantOutMessageContext.setProperty(MultitenantConstants.POST_TO_URI, 
+                msgContext.getProperty(MultitenantConstants.POST_TO_URI));
 
         superTenantOutMessageContext.setProperty(MultitenantConstants.FORCE_HTTP_CONTENT_LENGTH,
                 forceContentLength);

_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to