stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject git commit: Fixed issue of cluster id not being available in synapse message context for statistics reporting
Date Wed, 05 Feb 2014 18:10:13 GMT
Updated Branches:
  refs/heads/master f5d1a1083 -> 101a4ec26


Fixed issue of cluster id not being available in synapse message context for statistics reporting


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/101a4ec2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/101a4ec2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/101a4ec2

Branch: refs/heads/master
Commit: 101a4ec26bfcb6bb10e1f4cc3a7a1276bfc46095
Parents: f5d1a10
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Wed Feb 5 13:10:05 2014 -0500
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Wed Feb 5 13:10:05 2014 -0500

----------------------------------------------------------------------
 .../balancer/endpoint/TenantAwareLoadBalanceEndpoint.java   | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/101a4ec2/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/endpoint/TenantAwareLoadBalanceEndpoint.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/endpoint/TenantAwareLoadBalanceEndpoint.java
b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/endpoint/TenantAwareLoadBalanceEndpoint.java
index 0429da4..aeeb3a1 100644
--- a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/endpoint/TenantAwareLoadBalanceEndpoint.java
+++ b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/endpoint/TenantAwareLoadBalanceEndpoint.java
@@ -142,18 +142,21 @@ public class TenantAwareLoadBalanceEndpoint extends org.apache.synapse.endpoints
      * These values will be used to update the Location value in the response header.
      *
      * @param synCtx
+     * @param currentMember
      */
-    private void setupLoadBalancerContextProperties(MessageContext synCtx) {
+    private void setupLoadBalancerContextProperties(MessageContext synCtx, org.apache.axis2.clustering.Member
currentMember) {
         String lbHostName = extractTargetHost(synCtx);
         org.apache.axis2.context.MessageContext axis2MsgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext();
         TransportInDescription httpTransportIn = axis2MsgCtx.getConfigurationContext().getAxisConfiguration().getTransportIn("http");
         TransportInDescription httpsTransportIn = axis2MsgCtx.getConfigurationContext().getAxisConfiguration().getTransportIn("https");
         String lbHttpPort = (String) httpTransportIn.getParameter("port").getValue();
         String lbHttpsPort = (String) httpsTransportIn.getParameter("port").getValue();
+        String clusterId = currentMember.getProperties().getProperty(Constants.CLUSTER_ID);
 
         synCtx.setProperty(Constants.LB_HOST_NAME, lbHostName);
         synCtx.setProperty(Constants.LB_HTTP_PORT, lbHttpPort);
         synCtx.setProperty(Constants.LB_HTTPS_PORT, lbHttpsPort);
+        synCtx.setProperty(Constants.CLUSTER_ID, clusterId);
     }
 
 
@@ -241,7 +244,7 @@ public class TenantAwareLoadBalanceEndpoint extends org.apache.synapse.endpoints
             axis2Member.setHttpsPort(httpsPort.getValue());
         axis2Member.setActive(member.isActive());
         // Set cluster id and partition id in message context
-        synCtx.setProperty(Constants.CLUSTER_ID, member.getClusterId());
+        axis2Member.getProperties().setProperty(Constants.CLUSTER_ID, member.getClusterId());
         return axis2Member;
     }
 
@@ -530,7 +533,7 @@ public class TenantAwareLoadBalanceEndpoint extends org.apache.synapse.endpoints
         }
         memberHosts.put(extractTargetHost(synCtx), "true");
         setupTransportHeaders(synCtx);
-        setupLoadBalancerContextProperties(synCtx);
+        setupLoadBalancerContextProperties(synCtx, currentMember);
 
         try {
             if (log.isDebugEnabled()) {


Mime
View raw message