This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/main by this push:
     new a991438aea Configure broker to check for expired messages every second 
in tests (#1626)
a991438aea is described below

commit a991438aeaf0e436ca170f15ef30e162f96f68c5
Author: Jean-Louis Monteiro <[email protected]>
AuthorDate: Thu Jan 22 16:58:47 2026 +0100

    Configure broker to check for expired messages every second in tests (#1626)
---
 .../src/test/java/org/apache/activemq/bugs/AMQ9255Test.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/activemq-http/src/test/java/org/apache/activemq/bugs/AMQ9255Test.java 
b/activemq-http/src/test/java/org/apache/activemq/bugs/AMQ9255Test.java
index 411f7f7827..1a0213de4e 100644
--- a/activemq-http/src/test/java/org/apache/activemq/bugs/AMQ9255Test.java
+++ b/activemq-http/src/test/java/org/apache/activemq/bugs/AMQ9255Test.java
@@ -25,6 +25,8 @@ import jakarta.jms.TextMessage;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.region.policy.PolicyEntry;
+import org.apache.activemq.broker.region.policy.PolicyMap;
 import org.apache.activemq.transport.http.WaitForJettyListener;
 import org.junit.After;
 import org.junit.Before;
@@ -130,10 +132,19 @@ public class AMQ9255Test {
     }
 
     protected BrokerService createBroker() throws Exception {
-        BrokerService answer = new BrokerService();
+        final BrokerService answer = new BrokerService();
         answer.setPersistent(false);
         answer.addConnector("http://localhost:0";);
         answer.setUseJmx(false);
+
+        // Configure broker to check for expired messages every second
+        // (default is 30 seconds which causes test timeout issues with the 
receive(30_000) bellow)
+        final PolicyEntry policy = new PolicyEntry();
+        policy.setExpireMessagesPeriod(1000);  // Check every 1 second
+        final PolicyMap policyMap = new PolicyMap();
+        policyMap.setDefaultEntry(policy);
+        answer.setDestinationPolicy(policyMap);
+
         return answer;
     }
 


---------------------------------------------------------------------
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