I have a Spring Boot application with stomp interface and Amazon MQ version 5.17.2 is used as a broker. As per the implementation on each stomp connection from client a new AMQ connection gets created. While running the load with less than 500 parallel stomp connections total AMQ connection count is always less than the count of Stomp connection.
When the load increases beyond 800 stomp connection then count of AMQ connection is shooting to 3500 AMQ connections.
Can I get some help to understand this behaviour and how can I properly pool the AMQ connection in spring-boot application. Below is the snippet of AMQ broker configuration in stomp:
public void configureMessageBroker(MessageBrokerRegistry registry) {
SslContext sslContext;
try {
sslContext =
SslContextBuilder.forClient()
.sslProvider(SslProvider.JDK)
.trustManager(
InsecureTrustManagerFactory.INSTANCE) /** Configuration message broker which Accept specific CA certs only */
.build();
ReactorNettyTcpClient<byte[]> client =
new ReactorNettyTcpClient<>(
tcpClient ->
tcpClient.remoteAddress(socketAddressSupplier())
.secure(ssl -> ssl.sslContext(sslContext)),
new StompReactorNettyCodec());
registry
.enableStompBrokerRelay(stompBrokerConfigurationProperties.getRelay())
.setAutoStartup(true)
.setSystemLogin(stompBrokerConfigurationProperties.getLogin())
.setSystemPasscode(stompBrokerConfigurationProperties.getPassword())
.setClientLogin(stompProperties.getLogin())
.setClientPasscode(stompProperties.getPassword())
.setTcpClient(client);
registry.setApplicationDestinationPrefixes(stompProperties.getAppDestinationPrefix());
registry.setUserDestinationPrefix(stompProperties.getUserDestinationPrefix());
} catch (SSLException e) {
log.error(IpcLoggerConstants.EXCEPTION_OCCURRED, e);
}
}
Expecting to get some help to understand the AMQ connection and how to properly pool the connections