cshannon commented on code in PR #1139:
URL: https://github.com/apache/activemq/pull/1139#discussion_r1456436993
##########
activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java:
##########
@@ -291,13 +294,39 @@ public void send(ProducerBrokerExchange producerExchange,
final Message message)
transaction = getTransaction(context, message.getTransactionId(),
false);
}
context.setTransaction(transaction);
+
try {
+ // [AMQ-9344] Limit uncommitted transactions by count
+ verifyUncommittedCount(producerExchange, transaction, message);
next.send(producerExchange, message);
} finally {
context.setTransaction(originalTx);
}
}
+ protected void verifyUncommittedCount(ProducerBrokerExchange
producerExchange, Transaction transaction, Message message) throws Exception {
+ // maxUncommittedCount <= 0 disables
+ int maxUncommittedCount =
this.getBrokerService().getMaxUncommittedCount();
+ if (maxUncommittedCount > 0 && transaction.size() >=
maxUncommittedCount) {
Review Comment:
Nevermind, equals makes sense since you've already sent the max previous
(this is on the send of the next one) so i'm still wondering why the test
assertion is 11 and not 10 though.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]