You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2007/08/08 15:22:16 UTC

svn commit: r563854 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/advisory/ main/java/org/apache/activemq/broker/ main/java/org/apache/activemq/broker/ft/ test/java/org/apache/activemq/ test/java/org/apache/activemq/broker/ft/

Author: chirino
Date: Wed Aug  8 06:22:15 2007
New Revision: 563854

URL: http://svn.apache.org/viewvc?view=rev&rev=563854
Log:
Fix the TopicMasterSlaveTest that was failing
 - Stack was overflowing due to the advisory broker advising on topic advisories
 - MasterConnector now makes sync request to the slave if it's given a sync request
 - Test was failing due to kaha not being able to create a file that was too long.. fixed by making the 
   sub name and client id and dest name shorter.  Need to revisit.


Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TestSupport.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/TopicMasterSlaveTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java?view=diff&rev=563854&r1=563853&r2=563854
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java Wed Aug  8 06:22:15 2007
@@ -145,11 +145,12 @@
     
     public Destination addDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception {
         Destination answer = next.addDestination(context, destination);  
-      
-        ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destination);
-        DestinationInfo info = new DestinationInfo(context.getConnectionId(), DestinationInfo.ADD_OPERATION_TYPE, destination);
-        fireAdvisory(context, topic, info);        
-        destinations.put(destination, info);
+        if( !AdvisorySupport.isAdvisoryTopic(destination) ) { 
+            ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destination);
+            DestinationInfo info = new DestinationInfo(context.getConnectionId(), DestinationInfo.ADD_OPERATION_TYPE, destination);
+            fireAdvisory(context, topic, info);        
+            destinations.put(destination, info);
+        }
         return answer;
     }
     
@@ -157,9 +158,11 @@
         ActiveMQDestination destination =  info.getDestination();
         next.addDestinationInfo(context, info);  
         
-        ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destination);
-        fireAdvisory(context, topic, info);        
-        destinations.put(destination, info);    
+        if( !AdvisorySupport.isAdvisoryTopic(destination) ) { 
+            ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destination);
+            fireAdvisory(context, topic, info);        
+            destinations.put(destination, info); 
+        }
     }
 
     public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?view=diff&rev=563854&r1=563853&r2=563854
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java Wed Aug  8 06:22:15 2007
@@ -1367,12 +1367,12 @@
         // Add a filter that will stop access to the broker once stopped
         broker = new MutableBrokerFilter(broker) {
             public void stop() throws Exception {
-                super.stop();
                 setNext(new ErrorBroker("Broker has been stopped: "+this) {
                     // Just ignore additional stop actions.
                     public void stop() throws Exception {
                     }
                 });
+                super.stop();
             }
         };
         

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java?view=diff&rev=563854&r1=563853&r2=563854
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java Wed Aug  8 06:22:15 2007
@@ -222,11 +222,12 @@
             }else{
                 boolean responseRequired=command.isResponseRequired();
                 int commandId=command.getCommandId();
-                localBroker.oneway(command);
                 if(responseRequired){
-                    Response response=new Response();
+                    Response response = (Response)localBroker.request(command);
                     response.setCorrelationId(commandId);
                     remoteBroker.oneway(response);
+                } else {
+                    localBroker.oneway(command);                    
                 }
             }
         }catch(IOException e){

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java?view=diff&rev=563854&r1=563853&r2=563854
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java Wed Aug  8 06:22:15 2007
@@ -126,8 +126,8 @@
         if (data.length != copyOfMessages.size()) {
             for (Iterator iter = copyOfMessages.iterator(); iter.hasNext();) {
                 TextMessage message = (TextMessage) iter.next();
-                if (log.isDebugEnabled()) {
-                    log.info("<== " + counter++ + " = " + message);
+                if (log.isInfoEnabled()) {
+                    log.info("<== " + counter++ + " = " + message.getText());
                 }
             }
         }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TestSupport.java?view=diff&rev=563854&r1=563853&r2=563854
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TestSupport.java Wed Aug  8 06:22:15 2007
@@ -122,7 +122,7 @@
     }
 
     protected String getSubject() {
-        return getClass().getName() + "." + getName();
+        return getName();
     }
     
     

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/TopicMasterSlaveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/TopicMasterSlaveTest.java?view=diff&rev=563854&r1=563853&r2=563854
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/TopicMasterSlaveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/TopicMasterSlaveTest.java Wed Aug  8 06:22:15 2007
@@ -34,12 +34,12 @@
     }
 
     protected MessageConsumer createConsumer(Session session,Destination dest) throws JMSException{
-        return session.createDurableSubscriber((Topic) dest,dest.toString());
+        return session.createDurableSubscriber((Topic) dest,"subName");
     }
 
     protected Connection createReceiveConnection() throws Exception{
         Connection result=super.createReceiveConnection();
-        result.setClientID(getClass().getName());
+        result.setClientID("clientId");
         return result;
     }
 }