mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3903 - expand test to validate Full advisory: https://issues.apache.org/jira/browse/AMQ-3925
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1361138 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1cd533078a
commit
a5bb9bd1d7
|
@ -92,8 +92,11 @@ public class AMQ3903Test {
|
||||||
final TemporaryQueue queue = session.createTemporaryQueue();
|
final TemporaryQueue queue = session.createTemporaryQueue();
|
||||||
|
|
||||||
final Topic advisoryTopic = AdvisorySupport.getFastProducerAdvisoryTopic((ActiveMQDestination) queue);
|
final Topic advisoryTopic = AdvisorySupport.getFastProducerAdvisoryTopic((ActiveMQDestination) queue);
|
||||||
|
final Topic advisoryWhenFullTopic = AdvisorySupport.getFullAdvisoryTopic((ActiveMQDestination) queue);
|
||||||
|
|
||||||
MessageConsumer advisoryConsumer = session.createConsumer(advisoryTopic);
|
MessageConsumer advisoryConsumer = session.createConsumer(advisoryTopic);
|
||||||
|
MessageConsumer advisoryWhenFullConsumer = session.createConsumer(advisoryWhenFullTopic);
|
||||||
|
|
||||||
MessageProducer producer = session.createProducer(genericProducer ? null : queue);
|
MessageProducer producer = session.createProducer(genericProducer ? null : queue);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -113,6 +116,8 @@ public class AMQ3903Test {
|
||||||
Message advCmsg = advisoryConsumer.receive(4000);
|
Message advCmsg = advisoryConsumer.receive(4000);
|
||||||
assertNotNull(advCmsg);
|
assertNotNull(advCmsg);
|
||||||
|
|
||||||
|
advCmsg = advisoryWhenFullConsumer.receive(4000);
|
||||||
|
assertNotNull(advCmsg);
|
||||||
|
|
||||||
connection.close();
|
connection.close();
|
||||||
LOG.debug("Connection closed, destinations should now become inactive.");
|
LOG.debug("Connection closed, destinations should now become inactive.");
|
||||||
|
@ -125,6 +130,7 @@ public class AMQ3903Test {
|
||||||
|
|
||||||
PolicyEntry entry = new PolicyEntry();
|
PolicyEntry entry = new PolicyEntry();
|
||||||
entry.setAdvisoryForFastProducers(true);
|
entry.setAdvisoryForFastProducers(true);
|
||||||
|
entry.setAdvisoryWhenFull(true);
|
||||||
entry.setMemoryLimit(10000);
|
entry.setMemoryLimit(10000);
|
||||||
PolicyMap map = new PolicyMap();
|
PolicyMap map = new PolicyMap();
|
||||||
map.setDefaultEntry(entry);
|
map.setDefaultEntry(entry);
|
||||||
|
|
Loading…
Reference in New Issue