RequestReply in Jms not working

Gatling version: 3.11.2 (must be up to date)
Gatling flavor: java
Gatling build tool: maven

I am experiencing a issue with Gatling when I am using requestReply(). The load test hangs . Here is the code snippet that I am using

public class PaymentRequestJmsSimulation extends Simulation {

    Logger log = LoggerFactory.getLogger(PaymentRequestJmsSimulation.class);

    ConnectionFactory connectionFactory =
            new org.apache.activemq.ActiveMQConnectionFactory("tcp://localhost:61616");

    String correlationId = UUID.randomUUID().toString();
    JmsProtocolBuilder jmsProtocol =
                    .credentials("admin", "secret")

    ScenarioBuilder scn =
            scenario("JMS DSL test")
                                    jms("Pain013 Message")
                                            .property("jms_correlationId", correlationId)

    // with pain013
    // xml message


    public boolean checkBodyTextCorrect(Message m) {
        // this assumes that the service just does an "uppercase" transform on the text
        if (m instanceof TextMessage) {
            try {
                return m.getJMSCorrelationID().equals(correlationId);
            } catch (JMSException e) {
                throw new RuntimeException(e);
        } else {
            return false;

On the JMS Listener side the code looks like

 public void onMessage(
            Message cparMessage,
            @Header(JmsHeaders.CORRELATION_ID) String idempotencyKey,
            Session session)
            throws JMSException {

jmsTemplate.send("rtp.pain013.acks", session1 -> {
  "Message sent to rtp.pain013.acks with correlation id {}", idempotencyKey);
            TextMessage message = session1.createTextMessage();
            return message;

The output looks like

---- JMS DSL test --------------------------------------------------------------
[--------------------------------------------------------------------------]  0%
          waiting: 0      / active: 1      / done: 0

JMS Listener receives the message but it seems like Gatling is not able to check the reply queue and that’s why it hangs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.