org.apache.qpid.server.queue
Class DeepQueueConsumeWithSelector

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.qpid.test.utils.QpidTestCase
              extended by org.apache.qpid.test.utils.QpidBrokerTestCase
                  extended by org.apache.qpid.server.queue.DeepQueueConsumeWithSelector
All Implemented Interfaces:
MessageListener, junit.framework.Test

public class DeepQueueConsumeWithSelector
extends QpidBrokerTestCase
implements MessageListener

Test DeapQueueConsumerWithSelector Summary: Prior to M4 the broker had a different queue model which pre-processed the messages on the queue for any connecting subscription that had a selector. If the queue had a lot of data then this may take a long time to process to such an extent that the subscription creation may time out. During this pre-process phase the virtualhost would be come unresposive. Our solution was to allow the timeout to be adjusted QPID-1119, which allowed the subscription to connect but did not address the unresponsiveness. The new queue model introduced in M4 resolved this. This test is to validate that the new queueing model does indeed remove the long pre-processing phase and allow immediate subscription so that there is no unresponsive period. Test Strategy: Add 100k messages to the queue with a numberic header property that will allow later subscribers to use as in a selector. Connect the subscriber and time how long it takes to connect. Finally consume all the messages from the queue to clean up.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
QpidBrokerTestCase.MessageType
 
Field Summary
protected  long SYNC_WRITE_TIMEOUT
           
 
Fields inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
_broker, _brokerLanguage, _brokerLogPrefix, _brokerOutputStream, _brokerPersistent, _brokers, _configFile, _connectionFactory, _connections, _initialContext, _interleaveBrokerLog, _logger, _output, _outputFile, _testName, BROKER_READY, CONTENT, CPP, DEFAULT_MANAGEMENT_PORT, DEFAULT_MESSAGE_SIZE, DEFAULT_PORT, DEFAULT_SSL_PORT, DEFAULT_VM_PORT, EXTERNAL, INDEX, JAVA, LOGMONITOR_TIMEOUT, QPID_HOME, QpidHome, QUEUE, RECEIVE_TIMEOUT, TOPIC, VM
 
Fields inherited from class org.apache.qpid.test.utils.QpidTestCase
MEMORY_STORE_CLASS_NAME, MS_CLASS_NAME_KEY
 
Constructor Summary
DeepQueueConsumeWithSelector()
           
 
Method Summary
 Message createNextMessage(Session session, int msgCount)
           
 void onMessage(Message message)
           
 void setUp()
           
 void test()
           
 
Methods inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
cleanBroker, createMessage, drainQueue, getBroker, getBrokerCommand, getClientConnection, getConfigurationStringProperty, getConnection, getConnection, getConnection, getConnectionFactory, getConnectionFactory, getConnectionURL, getInitialContext, getLogger, getManagementPort, getMessageSize, getPort, getPort, getTestConfigFile, getTestQueue, getTestQueueName, getTestVirtualhostsFile, isBroker010, isBroker08, isBrokerStorePersistent, isCppBroker, isExternalBroker, isJavaBroker, makeVirtualHostPersistent, reloadBrokerSecurityConfig, restartBroker, restartBroker, revertLoggingLevels, revertSystemProperties, runBare, saveTestConfiguration, saveTestVirtualhosts, sendMessage, sendMessage, sendMessage, setBrokerEnvironment, setBrokerOnlySystemProperty, setConfigurationProperty, setLoggerLevel, setMessageSize, setSystemProperty, setSystemProperty, setTestClientSystemProperty, startBroker, startBroker, stopBroker, stopBroker, tearDown
 
Methods inherited from class org.apache.qpid.test.utils.QpidTestCase
getTestProfileMessageStoreClassName, run
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SYNC_WRITE_TIMEOUT

protected long SYNC_WRITE_TIMEOUT
Constructor Detail

DeepQueueConsumeWithSelector

public DeepQueueConsumeWithSelector()
Method Detail

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class QpidBrokerTestCase
Throws:
Exception

test

public void test()
          throws Exception
Throws:
Exception

createNextMessage

public Message createNextMessage(Session session,
                                 int msgCount)
                          throws JMSException
Overrides:
createNextMessage in class QpidBrokerTestCase
Throws:
JMSException

onMessage

public void onMessage(Message message)
Specified by:
onMessage in interface MessageListener


Licensed to the Apache Software Foundation