Skip to content

Conversation

@mattrpav
Copy link
Contributor

@mattrpav mattrpav commented Mar 30, 2023

Reviewer Notes:

  • JDK 17 required for Spring 6
  • Spring dependency update needed to pull in spring-jms jakarta.jms namespace
  • qpid dependency update needed to pull in jakarta.jms namespace
  • Rebase with to pickup jetty-continuation to servlet async refactor
  • Convert to jakarta.annotation
  • Convert to jakarta.jms
  • Convert to jakarta.resource
  • Convert to jakarta.servlet v5 (Jakarta EE 9)
  • Convert to jakarta.transaction
  • Jetty 11+ requires sub-protocol validation for web sockets Jetty #3709
  • Rebase & convert joram-jms-tests to ActiveMQ hosted
  • Jolokia is disabled, as it does not currently support jakarta
  • activemq-partition and zookeeper test dep removed (AMQ-9259)
  • Update web console to use jakarta jsp template urn
  • Address FIXMEs in *-web projects
  • Upgrade stompjms-client (v3.1.0 supports jakarta.jms.*)
  • Update assembly examples
  • Temporarily disable Camel (no Jakarta / Spring 6 support until v4)
  • Fix activemq-http 60s stopTimeout temporary work-around
  • Fix activemq-ra/ MessageEndpointProxyTest.java and ServerSessionImplTest.java (rollback jmock upgrade)
  • Fix activemq-spring/AMQDeadlockTest3 (failing)
  • Fix activemq-unit-tests/BrokerServiceTest.testLargeFileSystem (byte-buddy opens)
  • Fix network/CustomBridgeFactoryTest (mockito / byte-buddy opens)
  • Fix store.jdbc/LeaseDatabaseLockerTest, JDBCIOExceptionHandlerMockeryTest
  • Refactor activemq-spring/ParallelXATransactionTest (jencks lib is EOL and javax.jms)
  • Web Console - queue delete, pause resume throws exception
  • Run simulated -Prelease,deploy to exercise maven plugins (esp javadoc)
  • Updated activemq-client-jakarta with Maven relocation info back to activemq-client

TODO:

  • Review jetty.xml pathSpec change

Tests passing:

Short term (other JIRA):

  • Modernize activemq-openwire-generator project for JDK 17 and toolchain AMQ-9302

Long term (another JIRA):

  • Add sniHostCheck and sniRequired transport options

@tabish121
Copy link
Contributor

Just noticed this and wanted to say the TODO about stompjms update to Jakarta seems like something you might want to skip, that project hasn't seen activity since 2016 I think and depends on other equally dead projects like 'hawtio'. I'd maybe just remove any dependency on it at this point.

@mattrpav
Copy link
Contributor Author

Just noticed this and wanted to say the TODO about stompjms update to Jakarta seems like something you might want to skip, that project hasn't seen activity since 2016 I think and depends on other equally dead projects like 'hawtio'. I'd maybe just remove any dependency on it at this point.

@tabish121 good call. I'll update to that effect.

@mattrpav mattrpav self-assigned this Apr 15, 2023
@mattrpav
Copy link
Contributor Author

mattrpav commented Apr 16, 2023

activemq-http

-[ ] WSSTransportHttpTraceTest needs SSL setup repair -- JDK 17 enforces SNI rules (no 'localhost')

2023-04-20 20:32:04,685 [me-limited test] - WARN  config                         - No Client EndPointIdentificationAlgorithm configured for Client@6ec88514[provider=null,keyStore=null,trustStore=null]
2023-04-20 20:32:04,818 [tp1642679791-46] - WARN  HttpChannel                    - handleException / org.eclipse.jetty.http.BadMessageException: 400: Invalid SNI

Unit test runs:

1. [ERROR] Tests run: 531, Failures: 0, Errors: 129, Skipped: 0
2. [ERROR] Tests run: 531, Failures: 5, Errors: 70, Skipped: 0
3. [ERROR] Tests run: 531, Failures: 5, Errors: 4, Skipped: 0

I could use a set of eyes on the Jetty stopTimeout issue. The vast majority of unit tests are failing due to lifecycle problem w/ Jetty 11 taking too long to shutdown some resources. Setting a breakpoint (and some natural amount of time passing > 10s) and the tests pass. When I set the stopTimeout to 5s (up from current 500ms, the tests fail.

Jetty 11 stopTimeout related classes

./src/main/java/org/apache/activemq/transport/SecureSocketConnectorFactory.java
./src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java
./src/main/java/org/apache/activemq/transport/SocketConnectorFactory.java

ref: https://stackoverflow.com/questions/65443271/set-up-websockets-with-jetty-11

@hellokkiyer
Copy link

Is the jakarta supported activemq-broker jar going to be released?

@mattrpav
Copy link
Contributor Author

mattrpav commented May 23, 2023

@hellokkiyer yes. Once the work on this PR is completed, Jakarta support for ActiveMQ 5.x broker will be released. Currently, we are planning to target 5.19.0 for Jakarta broker support.

@hellokkiyer
Copy link

@mattrpav Thanks for the prompt response. Any tentative or approximate date for 5.19 release? It would help us plan our release better. Thanks in advance.

@mattrpav
Copy link
Contributor Author

@hellokkiyer no exact ETA at this point. I suspect a few weeks to 1-2 months max (hopefully?!)

@maverickabhi1991
Copy link

@mattrpav Nice to see this PR in running mode. Can we use apache activemq with Spring 6 without this PR as jakarta modules are required in Spring 6.0.0? I have a project with spring version is 5.3.27 and apache active client version is 5.18.1 and it's running fine. As soon as I upgrade the Spring to 6.0.0 it starts giving me "java.lang.IllegalStateException: Cannot convert value of type 'org.apache.activemq.pool.PooledConnectionFactory' to required type 'jakarta.jms.ConnectionFactory' for property 'connectionFactory': no matching editors or conversion strategy found".
Any workaround to this problem?

@mattrpav
Copy link
Contributor Author

mattrpav commented May 23, 2023

@maverickabhi1991 The pooled connection factory has not been ported to jakarta yet. That's part of this change, which moves all of ActiveMQ 5.x to Jakarta. You can use Spring 6 w/ activemq-client-jakarta, but not with a pooled connection factory at the moment.

@mattrpav
Copy link
Contributor Author

Web console queue functions - pause, resume and delete throw exception:

Caused by: jakarta.servlet.ServletException: Request processing failed: java.lang.UnsupportedOperationException: Possible CSRF attack
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1019) ~[spring-webmvc-6.0.7.jar:6.0.7]

@demidov163
Copy link

Hello, any chance to merge this PR in coming days? Very important functional.

@mattrpav
Copy link
Contributor Author

mattrpav commented Jun 9, 2023

Hi @demidov163- There are a couple things left to sort out. I'm hoping its in the next 1-2 weeks. Currently, the team is working on 5.17.x and 5.18.x point releases. Thanks!

@cshannon
Copy link
Contributor

cshannon commented Jun 19, 2023

@mattrpav - I submitted a PR to this branch to fix the http timeout stuff mattrpav#1

@ksdevelops
Copy link

hi @mattrpav
Any update on the 5.19 release for jakarta broker support?
It's a very important functionality. We are in middle of migrating to JDK17 and Spring 6. The current activemq broker doesn't support jakarta messaging.
Any tentative ETA would be helpful.

@narendranss
Copy link

narendranss commented Jul 28, 2023

Any idea when this change will be available? or is there any other alternative to migrate for jakarta?

@prasad5400
Copy link

What is the plan to release this functionality? We need this for your migration to JDK17 and Spring 6.

@mattrpav
Copy link
Contributor Author

mattrpav commented Jul 31, 2023

@narendranss @prasad5400 reminder-- the 5.18.2 release has support for a Jakarta client, and you can use SB3, Spring 6 and Java 17 with activemq-client-jakarta-5.18.2.jar.

As far as schedule, we are working through the last few issues and dependency clean-ups. I've had a 'green' CI run, so I have not seen any major bugs or issues up to this point.

@ksdevelops
Copy link

ksdevelops commented Aug 1, 2023

@narendranss @prasad5400 reminder-- the 5.18.2 release has support for a Jakarta client, and you can use SB3, Spring 6 and Java 17 with activemq-client-jakarta-5.18.2.jar.

As far as schedule, we are working through the last few issues and dependency clean-ups. I've had a 'green' CI run, so I have not seen any major bugs or issues up to this point.

hi @mattrpav
Thanks for the update. I know it's difficult to state exact date, but can you mention a tentative date by which we can get this released in 5.19?
It would help us to decide if we can wait for this functionality to be released or to migrate to any other alternative?
Thanks in advance

@mattrpav
Copy link
Contributor Author

mattrpav commented Aug 1, 2023

@ksdevelops we are targeting September

@cshannon
Copy link
Contributor

cshannon commented Aug 9, 2023

The ParallelXATransactionTest seems to be failing because you don't have an XA transaction manager being used, the new config you added uses two local JMS transaction managers. You need to replacement for Geronimo/Jencks such as Atomikos or mock something.

Some of the errors I get when running locally:

This stack trace is showing there is no distributed transaction in progress.

org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing
	at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:311)
	at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:184)
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:510)
	at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:587)
	at org.apache.activemq.spring.ParallelXATransactionTest$1ProducerThread$1.doInTransactionWithoutResult(ParallelXATransactionTest.java:109)
	at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:36)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
	at org.apache.activemq.spring.ParallelXATransactionTest$1ProducerThread.run(ParallelXATransactionTest.java:103)
Caused by: jakarta.jms.JMSException: Session's XAResource has not been enlisted in a distributed transaction.
	at org.apache.activemq.ActiveMQXASession.doStartTransaction(ActiveMQXASession.java:101)
	at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1973)
	at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:329)
	at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:289)
	at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:224)
	at org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:270)
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:637)
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:611)
	at org.springframework.jms.core.JmsTemplate.lambda$send$3(JmsTemplate.java:589)
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:507)

This stack trace shows that the JmsTransactionManager is calling commit() on the ActiveMQ XA transaction which isn't allowed and that is because the JmsTransactionManager doesn't know how to handle XA.

org.springframework.transaction.TransactionSystemException: Could not commit JMS transaction

	at org.springframework.jms.connection.JmsTransactionManager.doCommit(JmsTransactionManager.java:286)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711)
	at org.springframework.test.context.transaction.TransactionContext.endTransaction(TransactionContext.java:135)
	at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:259)
	at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:440)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:94)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)
Caused by: jakarta.jms.TransactionInProgressException: Cannot commit() inside an XASession
	at org.apache.activemq.ActiveMQXASession.commit(ActiveMQXASession.java:78)
	at org.springframework.jms.connection.JmsTransactionManager.doCommit(JmsTransactionManager.java:280)
	... 27 more

@cshannon
Copy link
Contributor

cshannon commented Aug 9, 2023

So anyways, you will need to configure a proper JTA/XA transaction manager set up if you want to use ActiveMQXAConnectionFactory. That factory is not going to work with the standard org.springframework.jms.connection.JmsTransactionManager that is currently configured.

Copy link
Contributor Author

@mattrpav mattrpav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1,321 of 1,421 files changed are namespace-only changes

@mattrpav
Copy link
Contributor Author

mattrpav commented Aug 17, 2023

Reviewer checklist

Files that had changes other than simple package namespace change.

activemq-amqp
test

  • AmqpAndStompInteroTest
  • AmqpTestSupport

activemq-http
main

  • transport/SecureSocketConnectorFactory.java

  • transport/SocketConnectorFactory.java

  • transport/WebTransportServerSupport.java

  • transport/http/HttpTunnelServlet.java

  • transport/ws/WSTransportProxy.java

  • transport/ws/WSTransportServer.java

  • transport/ws/jetty11/MQTTSocket.java

  • transport/ws/jetty11/StompSocket.java

  • transport/ws/jetty11/WSServlet.java

    webapp

  • webapp/WEB-INF/web.xml

    test

  • http/HttpMaxFrameSizeTest.java

  • http/HttpPullConsumerTest.java

  • http/HttpSendCompressedMessagesTest.java

  • http/HttpTraceTestSupport.java

  • http/HttpTransportConnectTimeoutTest.java

  • ws/MQTTWSSubProtocolTest.java

  • ws/MQTTWSTransportTest.java

  • ws/MQTTWSTransportWillTest.java

  • ws/SocketTest.java

  • ws/StompWSConnectionTimeoutTest.java

  • ws/StompWSSubProtocolTest.java

  • ws/StompWSTransportTest.java

  • ws/WSTransportTest.java

test/resources

  • activemq-https-need-client-auth.xml
  • activemq-https-want-client-auth.xml
  • activemq-https.xml
  • jetty.xml
  • spring-http.xml
  • org/apache/activemq/bugs/amq2764/reconnect-broker1.xml
  • org/apache/activemq/bugs/amq2764/reconnect-broker2.xml

activmeq-kahadb-store
test

  • journal/DataFileAccessorPoolTest.java

activemq-ra
test

  • ra/FailoverManagedClusterTest.java
  • ra/JmsXAQueueTransactionTest.java
  • ra/JmsXARollback2CxTransactionTest.java
  • ra/MDBTest.java
  • ra/MessageEndpointProxyTest.java
  • ra/SSLTest.java
  • ra/ServerSessionImplTest.java

activemq-spring
main/resources

  • resources/META-INF/spring.schemas

    test

  • spring/ParallelXATransactionTest.java

  • spring/geronimo/*.java (refactored from Jencks)

  • usecases/AMQDeadlockTest3.java

    test/resources

  • resources/spring/spring.xml

  • resources/spring/xa.xml

activemq-unit-tests
test

  • SpringTestSupport.java

  • broker/BrokerServiceTest.java

  • broker/SpringTest.java

  • bugs/AMQ3537Test.java

  • network/CustomBridgeFactoryTest.java

  • spring/SpringTestSupport.java

  • store/jdbc/JDBCIOExceptionHandlerMockeryTest.java

  • store/jdbc/LeaseDatabaseLockerTest.java

  • transport/tcp/SslContextBrokerServiceTest.java

  • transport/tcp/SslContextNBrokerServiceTest.java

  • xbean/MultipleTestsWithSpringXBeanFactoryBeanTest.java

    test/resources

  • resources/org/apache/activemq/network/localBroker-custom-factory.xml

activemq-web-console
main

  • web/WebConsoleStarter.java
  • webapp/WEB-INF/jspf/headertags.jspf
  • webapp/WEB-INF/tags/jms/forEachMessage.tag
  • webapp/WEB-INF/tags/jms/persistent.tag
  • webapp/WEB-INF/web.xml

activemq-web-demo
main

  • webapp/WEB-INF/web.xml

    test

  • web/RestTest.java

activemq-web
main

  • web/config/JspConfigurer.java

assembly
main

  • descriptors/common-bin.xml

    release

  • conf/jetty.xml

  • examples/amqp/java/pom.xml

  • examples/conf/activemq-demo.xml

  • examples/conf/jetty-demo.xml

  • mqtt/java/pom.xml

  • examples/openwire/advanced-scenarios/pom.xml

  • examples/openwire/java/pom.xml

  • examples/stomp/java/pom.xml

  • examples/stomp/java/src/main/java/example/Listener.java

  • examples/stomp/java/src/main/java/example/Publisher.java

  • webapps/api/WEB-INF/web.xml

    test

  • config/BrokerXmlConfigStartTest.java

@mattrpav mattrpav marked this pull request as ready for review August 17, 2023 18:09
Copy link
Contributor

@cshannon cshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried running a test release build with all the plugins? For example, I'm getting errors trying to build javadocs so that needs to be fixed.

Also, we should make sure that activemq-openwire-generator works and that is apparently broken with JDK 17. See: https://lists.apache.org/thread/rfjh94otnbx8h1rxs0l7d654zbf436wn

Copy link
Contributor

@cshannon cshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through a lot of custom tests with this and everything is looking good and I didn't find any issues. I think this is good to merge now. There are still some follow up things to fix like OSGi and openwire generation but there is time for that in follow on PRs before 5.19.0 goes out.

@nj185073
Copy link

@mattrpav @cshannon Hello there, any idea when these changes will be released?

@aeberhardo
Copy link

@mattrpav Hi, is there a roadmap when 5.19.x containing this PR will be available? Thanks!

@jbonofre
Copy link
Member

jbonofre commented Oct 9, 2023

@aeberhardo it's not 5.19.x but actually the next ActiveMQ release planned is 6.0.0 (including this change and others). The target date for the vote is end of this week/beginning of next week.

@hellokkiyer
Copy link

hellokkiyer commented Oct 10, 2023

hi @jbonofre
I read in ActiveMQ Artemis Page (https://activemq.apache.org/how-does-activemq-compare-to-artemis) that the next activemq 6 would be the Artemis version. So, will the 6.0.0 that you mentioned, be the Artemis?

@jbonofre
Copy link
Member

No that's not the case anymore (the website should be updated): we discussed on the mailing list to keep on our ActiveMQ versioning.

So ActiveMQ 6.0.0 will be ActiveMQ (not Artemis). I will update the website.

@HarikrishnaSelvarangan
Copy link

@jbonofre Kindly let us know when we can expect the active mq 6.0.0 which has upgrade to jakarta for PooledConnectionFactory.

@jbonofre
Copy link
Member

@HarikrishnaSelvarangan as said on the mailing list, it's planned for this week. We have a bunch of releases in preparation. So if the vote goes well, 6.0.0 should be available next week.

@HarikrishnaSelvarangan
Copy link

Hi @jbonofre, we could see last week 5.18.3 had been published for activemq-pool which doesn't have Jakarta upgrade. Can we expect activemq-pool with Jakarta this week or any tentative date ?

@kunal-bhatia
Copy link

@jbonofre , any update on release of version 6.0.0 with support of jakarta in activemq broker?

@jbonofre
Copy link
Member

jbonofre commented Nov 9, 2023

@kunal-bhatia you can follow the dev mailing list where we provide updates. I plan to submit 6.0.0 to vote before the end of this week. If the vote pass, 6.0.0 will be available next week.

@apache apache deleted a comment Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.