michaelandrepearce commented on a change in pull request #2794: ARTEMIS-2451
limit size of destination cache
URL: https://github.com/apache/activemq-artemis/pull/2794#discussion_r313731994
##########
File path:
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TemporaryDestinationTest.java
##########
@@ -266,6 +266,24 @@ public void testForTempQueueTargetInfosSizeLimit() throws
Exception {
}
}
+ @Test
+ public void testForKnownAddressSizeLimit() throws Exception {
+ try {
+ conn = createConnection();
+ Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ for (int i = 0; i < 200; i++) {
+ TemporaryQueue temporaryQueue = s.createTemporaryQueue();
+ MessageProducer producer = s.createProducer(temporaryQueue);
+ producer.send(s.createMessage());
+ }
+ assertTrue(((ActiveMQConnection)conn).getKnownDestinations().size()
<= 100);
Review comment:
e.g. where you make a temp dest for a reply from for other services, that is
set in the replyto on the produced message, and then setup the consumer to
listen to, currently if > 100 other services it would need to co-ordinate with,
it will now break, due to the below check, in session which will break the
ability to make a consumer for temp destination (when more than100)
if (jbdest.isTemporary() &&
!connection.containsTemporaryQueue(jbdest.getSimpleAddress())) {
throw new JMSException("Can not create consumer for temporary
destination " + destination +
" from another JMS connection");
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services