Author: aco
Date: Wed Feb  8 22:43:10 2006
New Revision: 376206

URL: http://svn.apache.org/viewcvs?rev=376206&view=rev
Log:
- Added a message to the request map in failover before sending it to prevent 
race condition where the response tries (and fails) to remove the message 
before it is even added. This is to prevent double sending a message because it 
is still in the requestMap. (This is for the master-slave test cases)
- Enabled a QueueBridgeTest, this test seems to pass already.
- Some minor typo correction.

Modified:
    incubator/activemq/trunk/activemq-core/project.xml
    
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ConnectionFailedException.java
    
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java

Modified: incubator/activemq/trunk/activemq-core/project.xml
URL: 
http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/project.xml?rev=376206&r1=376205&r2=376206&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/project.xml (original)
+++ incubator/activemq/trunk/activemq-core/project.xml Wed Feb  8 22:43:10 2006
@@ -339,14 +339,13 @@
                 <exclude>**/TcpTransportBrokerTest.*</exclude>
                 <exclude>**/activeio/*</exclude>
                 
-               <!-- These are performance tests so take too long to run -->
+                <!-- These are performance tests so take too long to run -->
                 <exclude>**/perf/*</exclude>
 
                 <!-- This test currently fails -->
                 <exclude>**/ItStillMarshallsTheSameTest.*</exclude>
-                <exclude>**/QueueBridgeTest.*</exclude>
 
-               <!-- https://jira.logicblaze.com/jira/browse/AMQ-502 -->
+                <!-- https://jira.logicblaze.com/jira/browse/AMQ-502 -->
                 <exclude>**/StompTest.*</exclude>
                 
                 <!-- http://jira.activemq.org/jira/browse/AMQ-522 -->

Modified: 
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ConnectionFailedException.java
URL: 
http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ConnectionFailedException.java?rev=376206&r1=376205&r2=376206&view=diff
==============================================================================
--- 
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ConnectionFailedException.java
 (original)
+++ 
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ConnectionFailedException.java
 Wed Feb  8 22:43:10 2006
@@ -37,7 +37,7 @@
     }
     
     public ConnectionFailedException() {
-        super("The JMS connection has failed due ti a Transport problem");
+        super("The JMS connection has failed due to a Transport problem");
     }
 
     static private String extractMessage(IOException cause) {

Modified: 
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
URL: 
http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java?rev=376206&r1=376205&r2=376206&view=diff
==============================================================================
--- 
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
 (original)
+++ 
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
 Wed Feb  8 22:43:10 2006
@@ -319,9 +319,6 @@
                             }
                             break;
                         }
-                        
-                        // Send the message.
-                        connectedTransport.oneway(command);
 
                         // If it was a request and it was not being tracked by
                         // the state tracker,
@@ -330,6 +327,20 @@
                         if (!stateTracker.track(command) && 
command.isResponseRequired()) {
                             requestMap.put(new Short(command.getCommandId()), 
command);
                         }
+                                                
+                        // Send the message.
+                        try {
+                            connectedTransport.oneway(command);
+                        } catch (IOException e) {
+                            // If there is an IOException in the send, remove 
the command from the requestMap
+                            if (!stateTracker.track(command) && 
command.isResponseRequired()) {
+                                requestMap.remove(new 
Short(command.getCommandId()), command);
+                            }
+                            
+                            // Rethrow the exception so it will handled by the 
outer catch
+                            throw e;
+                        }
+                        
                         return;
 
                     }


Reply via email to