Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 40509 invoked from network); 17 Mar 2006 22:09:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Mar 2006 22:09:35 -0000 Received: (qmail 90074 invoked by uid 500); 17 Mar 2006 22:09:35 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 90049 invoked by uid 500); 17 Mar 2006 22:09:34 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 90040 invoked by uid 99); 17 Mar 2006 22:09:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Mar 2006 14:09:34 -0800 X-ASF-Spam-Status: No, hits=-8.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 17 Mar 2006 14:09:33 -0800 Received: (qmail 40317 invoked by uid 65534); 17 Mar 2006 22:09:13 -0000 Message-ID: <20060317220913.40316.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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/ Date: Fri, 17 Mar 2006 22:09:12 -0000 To: activemq-commits@geronimo.apache.org From: aco@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 @@ **/TwoBrokerTopicSendReceiveTest.* - - **/TwoBrokerTopicSendReceiveUsingHttpTest.* **/PublishOnQueueConsumedMessageUsingActivemqXMLTest.* 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"); }