You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ac...@apache.org on 2006/03/17 23:09:12 UTC

svn commit: r386738 - in /incubator/activemq/trunk: activemq-core/src/main/java/org/apache/activemq/network/ assembly/ assembly/src/test/java/org/apache/activemq/usecases/

Author: aco
Date: Fri Mar 17 14:09:11 2006
New Revision: 386738

URL: http://svn.apache.org/viewcvs?rev=386738&view=rev
Log:
- Send the ConnectionInfo first before sending the BrokerInfo in the DemandForwardingBridge, so it would work in http.
- Enabled the TwoBrokerTopicSendReceiveUsingHttpTest.
- Added a sleep to the test to give jetty enough time to setup before sending messages.

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
    incubator/activemq/trunk/assembly/project.xml
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingHttpTest.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java?rev=386738&r1=386737&r2=386738&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java Fri Mar 17 14:09:11 2006
@@ -173,8 +173,10 @@
             localClientId="NC_"+remoteBrokerName+"_inbound"+name;
             localConnectionInfo.setClientId(localClientId);
             localBroker.oneway(localConnectionInfo);
+
             localSessionInfo=new SessionInfo(localConnectionInfo,1);
             localBroker.oneway(localSessionInfo);
+            
             log.info("Network connection between "+localBroker+" and "+remoteBroker+"("+remoteBrokerName
                             +") has been established.");
             startedLatch.countDown();
@@ -184,18 +186,23 @@
 
     protected void startRemoteBridge() throws IOException {
         if(remoteBridgeStarted.compareAndSet(false,true)){
-            BrokerInfo brokerInfo=new BrokerInfo();
-            brokerInfo.setBrokerName(localBrokerName);
-            remoteBroker.oneway(brokerInfo);
+
             remoteConnectionInfo=new ConnectionInfo();
             remoteConnectionInfo.setConnectionId(new ConnectionId(idGenerator.generateId()));
             remoteConnectionInfo.setClientId("NC_"+localBrokerName+"_outbound"+name);
             remoteBroker.oneway(remoteConnectionInfo);
+
+            BrokerInfo brokerInfo=new BrokerInfo();
+            brokerInfo.setBrokerName(localBrokerName);
+            remoteBroker.oneway(brokerInfo);
+
             SessionInfo remoteSessionInfo=new SessionInfo(remoteConnectionInfo,1);
             remoteBroker.oneway(remoteSessionInfo);
+
             producerInfo=new ProducerInfo(remoteSessionInfo,1);
             producerInfo.setResponseRequired(false);
             remoteBroker.oneway(producerInfo);
+
             // Listen to consumer advisory messages on the remote broker to determine demand.
             demandConsumerInfo=new ConsumerInfo(remoteSessionInfo,1);
             demandConsumerInfo.setDispatchAsync(dispatchAsync);
@@ -203,6 +210,7 @@
                             +destinationFilter));
             demandConsumerInfo.setPrefetchSize(prefetchSize);
             remoteBroker.oneway(demandConsumerInfo);
+
             startedLatch.countDown();
         }
     }

Modified: incubator/activemq/trunk/assembly/project.xml
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/project.xml?rev=386738&r1=386737&r2=386738&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/project.xml (original)
+++ incubator/activemq/trunk/assembly/project.xml Fri Mar 17 14:09:11 2006
@@ -323,8 +323,6 @@
       <excludes>
           <!-- http://jira.activemq.org/jira/browse/AMQ-586: fails on Windows 2003 -->
           <exclude>**/TwoBrokerTopicSendReceiveTest.*</exclude>
-          <!-- http://jira.activemq.org/jira/browse/AMQ-563: HTTP not yet implemented -->
-          <exclude>**/TwoBrokerTopicSendReceiveUsingHttpTest.*</exclude>
           <!-- http://jira.activemq.org/jira/browse/AMQ-537 --> 
           <exclude>**/PublishOnQueueConsumedMessageUsingActivemqXMLTest.*</exclude>
           <!-- http://jira.activemq.org/jira/browse/AMQ-538 --> 

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingHttpTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingHttpTest.java?rev=386738&r1=386737&r2=386738&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingHttpTest.java (original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingHttpTest.java Fri Mar 17 14:09:11 2006
@@ -25,6 +25,14 @@
  */
 public class TwoBrokerTopicSendReceiveUsingHttpTest extends TwoBrokerTopicSendReceiveTest {
 
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        // Give jetty server enough time to setup,
+        // so we don't lose messages when connection fails
+        Thread.sleep(5000);
+    }
+
     protected ActiveMQConnectionFactory createReceiverConnectionFactory() throws JMSException {
         return createConnectionFactory("org/apache/activemq/usecases/receiver-http.xml", "receiver", "vm://receiver");
     }