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

ASF GitHub Bot logged work on AMQ-9541:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Dec/24 05:32
            Start Date: 02/Dec/24 05:32
    Worklog Time Spent: 10m 
      Work Description: kenliao94 commented on code in PR #1275:
URL: https://github.com/apache/activemq/pull/1275#discussion_r1865248949


##########
activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/adapter/DefaultJDBCAdapter.java:
##########
@@ -620,12 +618,12 @@ public void doRecoverNextMessages(TransactionContext c, 
ActiveMQDestination dest
 
     @Override
     public void doRecoverNextMessagesWithPriority(TransactionContext c, 
ActiveMQDestination destination, String clientId,
-            String subscriptionName, long seq, long priority, int maxReturned, 
JDBCMessageRecoveryListener listener) throws Exception {
+                                                  String subscriptionName, 
long seq, long priority, int maxReturned, JDBCMessageRecoveryListener listener) 
throws Exception {
 
         PreparedStatement s = null;
         ResultSet rs = null;
         try {
-            s = 
c.getConnection().prepareStatement(this.statements.getFindDurableSubMessagesByPriorityStatement());
+            s = 
c.getConnection().prepareStatement(this.limitQuery(this.statements.getFindDurableSubMessagesByPriorityStatement()));
             s.setMaxRows(Math.min(maxReturned * 2, maxRows));

Review Comment:
   Sorry, not following this logic here. Isn't this.limitQuery a no-ops? It 
just returns the original query (line 1188)





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

    Worklog Id:     (was: 946278)
    Time Spent: 1h 10m  (was: 1h)

> Missing limit on expensive queries.
> -----------------------------------
>
>                 Key: AMQ-9541
>                 URL: https://issues.apache.org/jira/browse/AMQ-9541
>             Project: ActiveMQ Classic
>          Issue Type: Bug
>    Affects Versions: 5.18.5, 6.1.2
>            Reporter: Jean-Louis Monteiro
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> https://issues.apache.org/jira/browse/AMQ-6049 did add the ability to limit 
> the size of the records returned by the database.
>  
> Some queries do not apply the limit even though the limit is applied on the 
> Java side.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to