activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r380616 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network: DemandForwardingBridge.java DurableConduitBridge.java NetworkConnector.java
Date Fri, 24 Feb 2006 08:04:25 GMT
Author: rajdavies
Date: Fri Feb 24 00:04:24 2006
New Revision: 380616

URL: http://svn.apache.org/viewcvs?rev=380616&view=rev
Log:
Add a name to a bridge - so multiple bridges between the same two brokers can be used

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DurableConduitBridge.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java?rev=380616&r1=380615&r2=380616&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
Fri Feb 24 00:04:24 2006
@@ -76,6 +76,7 @@
     protected int prefetchSize=1000;
     protected boolean dispatchAsync;
     protected String destinationFilter=">";
+    protected String name = "bridge";
     protected ConsumerInfo demandConsumerInfo;
     protected int demandConsumerDispatched;
     protected AtomicBoolean localBridgeStarted=new AtomicBoolean(false);
@@ -173,7 +174,7 @@
         if(localBridgeStarted.compareAndSet(false,true)){
             localConnectionInfo=new ConnectionInfo();
             localConnectionInfo.setConnectionId(new ConnectionId(idGenerator.generateId()));
-            localClientId="NC_"+remoteBrokerName+"_inbound";
+            localClientId="NC_"+remoteBrokerName+"_inbound"+name;
             localConnectionInfo.setClientId(localClientId);
             localBroker.oneway(localConnectionInfo);
             localSessionInfo=new SessionInfo(localConnectionInfo,1);
@@ -192,7 +193,7 @@
             remoteBroker.oneway(brokerInfo);
             remoteConnectionInfo=new ConnectionInfo();
             remoteConnectionInfo.setConnectionId(new ConnectionId(idGenerator.generateId()));
-            remoteConnectionInfo.setClientId("NC_"+localBrokerName+"_outbound");
+            remoteConnectionInfo.setClientId("NC_"+localBrokerName+"_outbound"+name);
             remoteBroker.oneway(remoteConnectionInfo);
             SessionInfo remoteSessionInfo=new SessionInfo(remoteConnectionInfo,1);
             remoteBroker.oneway(remoteSessionInfo);
@@ -552,17 +553,17 @@
 
 
     /**
-     * @return Returns the remoteBrokerName.
+     * @return Returns the name.
      */
-    public String getRemoteBrokerName(){
-        return remoteBrokerName;
+    public String getName(){
+        return name;
     }
 
     /**
-     * @param remoteBrokerName The remoteBrokerName to set.
+     * @param name The name to set.
      */
-    public void setRemoteBrokerName(String remoteBrokerName){
-        this.remoteBrokerName=remoteBrokerName;
+    public void setName(String name){
+        this.name=name;
     }
     
     /**
@@ -776,6 +777,8 @@
     protected void clearDownSubscriptions(){
         
     }
+
+   
 
   
     

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DurableConduitBridge.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DurableConduitBridge.java?rev=380616&r1=380615&r2=380616&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DurableConduitBridge.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DurableConduitBridge.java
Fri Feb 24 00:04:24 2006
@@ -53,7 +53,7 @@
                 if(isPermissableDestination(dest) && !doesConsumerExist(dest)){
                     DemandSubscription sub=createDemandSubscription(dest);
                     if(dest.isTopic()){
-                        sub.getLocalInfo().setSubcriptionName(getLocalBrokerName());
+                        sub.getLocalInfo().setSubcriptionName(getLocalBrokerName()+"_"+name);
                     }
                     try{
                         addSubscription(sub);

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java?rev=380616&r1=380615&r2=380616&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
Fri Feb 24 00:04:24 2006
@@ -60,6 +60,7 @@
     private boolean conduitSubscriptions = true;
     private boolean decreaseNetworkConsumerPriority;
     private int networkTTL = 1;
+    private String name = "bridge";
     
     
     public NetworkConnector(){
@@ -222,6 +223,20 @@
     public void setBrokerName(String brokerName){
         this.brokerName=brokerName;
     }
+    
+    /**
+     * @return Returns the name.
+     */
+    public String getName(){
+        return name;
+    }
+
+    /**
+     * @param name The name to set.
+     */
+    public void setName(String name){
+        this.name=name;
+    }
 
 
     /**
@@ -392,6 +407,7 @@
         };
         }
         result.setLocalBrokerName(brokerName);
+        result.setName(getBrokerName());
         result.setNetworkTTL(getNetworkTTL());
         result.setDecreaseNetworkConsumerPriority(isDecreaseNetworkConsumerPriority());
         



Mime
View raw message