Skip to content

Commit b727cdb

Browse files
committed
Adjust ActiveMQ settings in integration tests
Before this change tests on the CI server showed the following message: Store limit is 102400 mb, whilst the data directory: /opt/.../KahaDB only has 74810 mb of usable space This change turns off store persistence and also explicitly sets the limit on memory usage.
1 parent 2ec4c00 commit b727cdb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,9 @@ public String getSessionId() {
469469

470470
@Override
471471
public void afterConnected(TcpConnection<byte[]> connection) {
472+
if (logger.isDebugEnabled()) {
473+
logger.debug("Established TCP connection to broker in session=" + this.sessionId);
474+
}
472475
this.tcpConnection = connection;
473476
connection.send(MessageBuilder.withPayload(EMPTY_PAYLOAD).setHeaders(this.connectHeaders).build());
474477
}

spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.concurrent.TimeUnit;
2626

2727
import org.apache.activemq.broker.BrokerService;
28+
import org.apache.activemq.store.memory.MemoryPersistenceAdapter;
2829
import org.apache.commons.logging.Log;
2930
import org.apache.commons.logging.LogFactory;
3031
import org.junit.After;
@@ -89,7 +90,9 @@ private void startActiveMqBroker() throws Exception {
8990
this.activeMQBroker = new BrokerService();
9091
this.activeMQBroker.addConnector("stomp://localhost:" + this.port);
9192
this.activeMQBroker.setStartAsync(false);
92-
this.activeMQBroker.setDeleteAllMessagesOnStartup(true);
93+
this.activeMQBroker.setPersistent(false);
94+
this.activeMQBroker.getSystemUsage().getMemoryUsage().setLimit(1024 * 1024 * 5);
95+
this.activeMQBroker.getSystemUsage().getTempUsage().setLimit(1024 * 1024 * 5);
9396
this.activeMQBroker.start();
9497
}
9598

0 commit comments

Comments
 (0)