0

I’m using ActiveMQ "Classic" 5.18.1 with Spring 6 and the Jakarta namespace. I’m using activemq-client-jakarta for TCP connections, but now I’m facing a new problem. I need to deal with http, but no activemq-http-jakarta jar is provided.

Are there any plans to create an activemq-http-jakarta jar as was done for activemq-client?

ActiveMQConnectionFactory is coming from activemq-client-jakarta.

Here is the log I'm getting when I try to send message over https protocol:

Caused by: jakarta.jms.JMSException: Transport scheme NOT recognized: [https]
    at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:91)
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1483)
    at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1548)
    at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:370)
    at org.springframework.jms.core.JmsTemplate.executeLocal(JmsTemplate.java:950)
    ... 170 common frames omitted
Caused by: java.io.IOException: Transport scheme NOT recognized: [https]
    at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:30)
    at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:185)
    at org.apache.activemq.transport.TransportFactory.compositeConnect(TransportFactory.java:90)
    at org.apache.activemq.transport.failover.FailoverTransport.doReconnect(FailoverTransport.java:1020)
    at org.apache.activemq.transport.failover.FailoverTransport$2.iterate(FailoverTransport.java:151)
    at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133)
    at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    ... 1 common frames omitted
Caused by: java.io.IOException: Could not find factory class for resource: META-INF/services/org/apache/activemq/transport/https
    at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.loadProperties(FactoryFinder.java:104)
    at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.create(FactoryFinder.java:61)
    at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:154)
    at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:182)
    ... 8 common frames omitted
Justin Bertram
  • 29,372
  • 4
  • 21
  • 43

1 Answers1

1

As far as I can tell no changes are required to the activemq-http jar for it to work with the activemq-client-jakarta jar so that you can use the http or https URL schemes. You just need to have both jars on the classpath of your application which, given the stack-trace you pasted, is clearly not the case.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • when i'm adding the activemq-http jar as maven dependency, i get many other activemq jar by transitivity like activemq-client/activemq-spring/activemq-jms-pool/activemq-mqtt/activemq-jms-pool/activemq-broker, i have exclude all of them and my https connection seems to work. i just think that because maven get activemq-client by transitivity i need to change activemq-http to jakarta too! finally not! thanks – Mançaux Pierre-Alexandre May 30 '23 at 19:30
  • FYI-- This comment should be updated to note that activemq-http 5.18.1 won't work with activemq-client-jakarta until 5.19.0 with full Jakarta support – Matt Pavlovich May 31 '23 at 16:40
  • What changes are being made to the `activemq-http` module for Jakarta support from the client's perspective? I realize that there are some uses of `javax` in the module, but they look related specifically to the broker, not the client. Also, unless I misunderstood the OP everything appears to be working now that they classpath issue is sorted. – Justin Bertram May 31 '23 at 16:58
  • activemq-http contains both the client and server bits. It has transitive dependencies, such as spring, jetty, activemq-pool, etc. No guarantee you can happy path client-only without having a transitive reference problem. – Matt Pavlovich May 31 '23 at 17:09
  • The transitive dependencies are all for the server bits, right? A remote JMS client using `https` (i.e. `org.apache.activemq.transport.https.HttpsTransportFactory`) or `http` (i.e. `org.apache.activemq.transport.http.HttpTransportFactory`) shouldn't care about all those transitive dependencies so it should be safe from anything that uses `javax`/`jakarta`. – Justin Bertram May 31 '23 at 17:29