activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1057186 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/proxy/ProxyConnection.java test/java/org/apache/activemq/proxy/ProxyFailoverTest.java
Date Mon, 10 Jan 2011 13:30:27 GMT
Author: dejanb
Date: Mon Jan 10 13:30:27 2011
New Revision: 1057186

URL: http://svn.apache.org/viewvc?rev=1057186&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3119 - proxy connector and failover

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnection.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/proxy/ProxyFailoverTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnection.java?rev=1057186&r1=1057185&r2=1057186&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnection.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnection.java
Mon Jan 10 13:30:27 2011
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.activemq.Service;
 import org.apache.activemq.command.ShutdownInfo;
+import org.apache.activemq.command.WireFormatInfo;
 import org.apache.activemq.transport.DefaultTransportListener;
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.util.IOExceptionSupport;
@@ -64,6 +65,10 @@ class ProxyConnection implements Service
                     shuttingDown.set(true);
                     shutdown = true;
                 }
+                // skipping WireFormat infos
+                if (command.getClass() == WireFormatInfo.class) {
+                    return;
+                }
                 try {
                     remoteTransport.oneway(command);
                     if (shutdown) {
@@ -84,6 +89,10 @@ class ProxyConnection implements Service
         this.remoteTransport.setTransportListener(new DefaultTransportListener() {
             public void onCommand(Object command) {
                 try {
+                    // skipping WireFormat infos
+                    if (command.getClass() == WireFormatInfo.class) {
+                        return;
+                    }
                     localTransport.oneway(command);
                 } catch (IOException error) {
                     onFailure(error);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/proxy/ProxyFailoverTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/proxy/ProxyFailoverTest.java?rev=1057186&r1=1057185&r2=1057186&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/proxy/ProxyFailoverTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/proxy/ProxyFailoverTest.java
Mon Jan 10 13:30:27 2011
@@ -68,9 +68,8 @@ public class ProxyFailoverTest extends T
         producer.start();
 
 
-        ActiveMQConnectionFactory consumerFactory = new ActiveMQConnectionFactory("tcp://localhost:51618?wireFormat.cacheEnabled=false");
-        // if used with cached enabled it will fail
-        //ActiveMQConnectionFactory consumerFactory = new ActiveMQConnectionFactory("tcp://localhost:51618");
+        //ActiveMQConnectionFactory consumerFactory = new ActiveMQConnectionFactory("tcp://localhost:51618?wireFormat.cacheEnabled=false");
+        ActiveMQConnectionFactory consumerFactory = new ActiveMQConnectionFactory("tcp://localhost:51618");
         Connection consumerConnection = consumerFactory.createConnection();
         consumerConnection.start();
         Session consumerSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);



Mime
View raw message