[ 
https://issues.apache.org/jira/browse/ARTEMIS-2451?focusedWorklogId=294556&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-294556
 ]

ASF GitHub Bot logged work on ARTEMIS-2451:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Aug/19 07:33
            Start Date: 14/Aug/19 07:33
    Worklog Time Spent: 10m 
      Work Description: michaelandrepearce commented on pull request #2794: 
ARTEMIS-2451 limit size of destination cache
URL: https://github.com/apache/activemq-artemis/pull/2794#discussion_r313739151
 
 

 ##########
 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:
   it seems we already have session inside destination as such this would be 
relatively easy.
   
   expose the session on ActiveMQDestination e.g.
   ```
      public ActiveMQSession getSession() {
         return session;
      }
   
   ```
   And then in this check:
   
   ```
         if (jbdest.isTemporary() && (jbdest.getSession() == null || connection 
!= jbdest.getSession().getConnection())) {
   ```
   
   lastly just clean up bits that we adding and removing temp address into the 
cache, as redundent.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 294556)
    Time Spent: 1h 50m  (was: 1h 40m)

> Limit size of destination cache
> -------------------------------
>
>                 Key: ARTEMIS-2451
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2451
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> This is the client-side version of ARTEMIS-2449. Simply put, there is no 
> limit on the destination cache for a core JMS client. For a long-lived 
> connection sending to lots of different destinations (e.g. in a request-reply 
> use-case involving temporary queues) this can present a significant problem.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to