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.



git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@563854 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2007-08-08 13:22:15 +00:00
parent b6fad12ac6
commit 0945e32b6a
6 changed files with 20 additions and 16 deletions

View File

@ -145,11 +145,12 @@ public class AdvisoryBroker extends BrokerFilter {
public Destination addDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception {
Destination answer = next.addDestination(context, destination);
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,10 +158,12 @@ public class AdvisoryBroker extends BrokerFilter {
ActiveMQDestination destination = info.getDestination();
next.addDestinationInfo(context, 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 {
next.removeDestination(context, destination, timeout);

View File

@ -1367,12 +1367,12 @@ public class BrokerService implements Service {
// 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();
}
};

View File

@ -222,11 +222,12 @@ public class MasterConnector implements Service,BrokerServiceAware{
}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){

View File

@ -126,8 +126,8 @@ public class JmsSendReceiveTestSupport extends TestSupport implements MessageLis
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());
}
}
}

View File

@ -122,7 +122,7 @@ public class TestSupport extends TestCase {
}
protected String getSubject() {
return getClass().getName() + "." + getName();
return getName();
}

View File

@ -34,12 +34,12 @@ public class TopicMasterSlaveTest extends QueueMasterSlaveTest{
}
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;
}
}