Hiram R. Chirino 2006-06-12 19:42:33 +00:00
parent 7dafbb582f
commit e264e6f9d1
4 changed files with 8 additions and 12 deletions

View File

@ -561,10 +561,10 @@ final public class OpenWireFormat implements WireFormat {
return preferedWireFormatInfo; return preferedWireFormatInfo;
} }
public void renegociatWireFormat(WireFormatInfo info) throws IOException { public void renegotiateWireFormat(WireFormatInfo info) throws IOException {
if( preferedWireFormatInfo==null ) if( preferedWireFormatInfo==null )
throw new IllegalStateException("Wireformat cannot not be renegociated."); throw new IllegalStateException("Wireformat cannot not be renegotiated.");
this.setVersion(Math.max(preferedWireFormatInfo.getVersion(), info.getVersion()) ); this.setVersion(Math.max(preferedWireFormatInfo.getVersion(), info.getVersion()) );
this.stackTraceEnabled = info.isStackTraceEnabled() && preferedWireFormatInfo.isStackTraceEnabled(); this.stackTraceEnabled = info.isStackTraceEnabled() && preferedWireFormatInfo.isStackTraceEnabled();

View File

@ -26,7 +26,7 @@ import org.apache.activemq.command.WireFormatInfo;
public class OpenWireFormatFactory implements WireFormatFactory { public class OpenWireFormatFactory implements WireFormatFactory {
// //
// The default values here are what the wireformat chanages to after a default negociation. // The default values here are what the wire format changes to after a default negotiation.
// //
private int version=1; private int version=1;

View File

@ -97,7 +97,7 @@ public class WireFormatNegotiator extends TransportFilter {
onException(new IOException("Remote wire format ("+info.getVersion()+") is lower the minimum version required ("+minimumVersion+")")); onException(new IOException("Remote wire format ("+info.getVersion()+") is lower the minimum version required ("+minimumVersion+")"));
} }
wireFormat.renegociatWireFormat(info); wireFormat.renegotiateWireFormat(info);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug(this + " after negotiation: " + wireFormat); log.debug(this + " after negotiation: " + wireFormat);

View File

@ -27,18 +27,14 @@ import java.net.Socket;
import javax.jms.Connection; import javax.jms.Connection;
import javax.jms.Message; import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer; import javax.jms.MessageProducer;
import javax.jms.Session; import javax.jms.Session;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.region.RegionBroker;
import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.transport.stomp.Stomp;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -183,14 +179,14 @@ public class StompSubscriptionRemoveTest extends TestCase {
} }
stompSocket.close(); stompSocket.close();
broker.stop(); broker.stop();
log.info("Total messages receved: " + messagesCount); log.info("Total messages received: " + messagesCount);
assertTrue("Messages receved after connection loss: " + messagesCount, messagesCount >= 2000); assertTrue("Messages received after connection loss: " + messagesCount, messagesCount >= 2000);
// The first ack messages has no chance complete, so we receiving more messages // The first ack messages has no chance complete, so we receiving more messages
// Don't know how to list subscriptions for the broker. Currently you // Don't know how to list subscriptions for the broker. Currently you
// can check using jmx console. You'll see // can check using JMX console. You'll see
// Subscription whithout any connections // Subscription without any connections
} }
public void sendFrame(String data) throws Exception { public void sendFrame(String data) throws Exception {