ARTEMIS-4238 transactionTimeout ActivationConfigProperty is no longer working.

* Re-adding the missing code

Jira: https://issues.apache.org/jira/browse/ARTEMIS-4238

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
This commit is contained in:
Emmanuel Hugonnet 2023-04-12 18:04:02 +02:00 committed by Justin Bertram
parent 4eb978b931
commit fc971b12ef
1 changed files with 7 additions and 0 deletions

View File

@ -55,6 +55,7 @@ import org.apache.activemq.artemis.utils.VersionLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.invoke.MethodHandles;
import javax.transaction.TransactionManager;
/**
* The message handler
@ -298,6 +299,12 @@ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventList
boolean beforeDelivery = false;
try {
if (activation.getActivationSpec().getTransactionTimeout() > 0) {
TransactionManager tm = ServiceUtils.getTransactionManager();
if (tm != null) {
tm.setTransactionTimeout(activation.getActivationSpec().getTransactionTimeout());
}
}
logger.trace("ActiveMQMessageHandler::calling beforeDelivery on message {}", message);
endpoint.beforeDelivery(ActiveMQActivation.ONMESSAGE);