jmsqpid

Error: jakarta.jms.JMSException: 'void org.apache.qpid.proton.engine. Transport.setOutboundFrameSizeLimit(int)


I am trying to post a message to Amazon ActiveMQ broker using SoapUI 5.7.2 and Groovy script. Java 17 is installed on the machine.

Below is the code:

import org.apache.qpid.jms.JmsConnectionFactory;
import jakarta.jms.Connection;
import jakarta.jms.DeliveryMode;
import jakarta.jms.MessageProducer;
import jakarta.jms.Session;
import jakarta.jms.TextMessage;
import jakarta.jms.Topic;

JmsConnectionFactory factory = new JmsConnectionFactory("amqps://broker-url:5671");
factory.setUsername("username");
factory.setPassword("password");

Connection connection = factory.createConnection();
connection.start();

Getting an error:

jakarta.jms.JMSException: 'void org.apache.qpid.proton.engine. Transport.setOutboundFrameSizeLimit(int)' error at Connection connection = factory.createConnection()

Following jars are added:

Could someone please guide as what might be the cause of this error and how this can be fixed? Do we need to pass any other parameters with the url?


Solution

  • The error most likely indicates a Classpath issue where an old (very old pre 2018) proton-j library is being used. The method 'setOutboundFrameSizeLimit' was added many years ago to proton-j v0.27.0 and if not present in the version on the classpath it would throw an error.