Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveMQ pooling option is not JMS 2.0 compliant #13927

Closed
pvanhees opened this issue Jul 27, 2018 · 4 comments
Closed

ActiveMQ pooling option is not JMS 2.0 compliant #13927

pvanhees opened this issue Jul 27, 2018 · 4 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@pvanhees
Copy link

pvanhees commented Jul 27, 2018

Spring boot version: 2.0.3.RELEASE

In this version of spring boot the following dependencies with versions are defined:
javax.jms:javax.jms-api:2.0.1
org.apache.activemq:activemq-pool:5.15.4
org.apache.activemq:activemq-jms-pool:5.15.4

However, this version of activemq-jms-pool is not fully compatible with the javax.jms-api version.
For example the activemq-jms-pool class org.apache.activemq.jms.pool.PooledProducer does not implement all methods from the stated version of the javax.jms-api interface javax.jms.MessageProducer

So when you create a spring boot project with dependencies:
org.springframework.boot:spring-boot-starter-activemq
org.apache.activemq:activemq-pool

and then you create a JmsTemplate with the deliveryDelay field, it will give the following exception upon sending a message to the queue:

Caused by: java.lang.AbstractMethodError: org.apache.activemq.jms.pool.PooledProducer.setDeliveryDelay(J)V
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:628) ~[spring-jms-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:608) ~[spring-jms-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.jms.core.JmsTemplate.lambda$send$3(JmsTemplate.java:586) ~[spring-jms-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:504) ~[spring-jms-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:584) ~[spring-jms-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:661) ~[spring-jms-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at be.fgov.caamihziv.memberdata.application.async.AsyncRequestService.sendAsyncRequestEvent(AsyncRequestService.java:94) ~[classes/:?]
	at be.fgov.caamihziv.memberdata.application.async.AsyncRequestService.lambda$resetFailedAsyncRequests$0(AsyncRequestService.java:49) ~[classes/:?]
	at io.vavr.collection.List.map(List.java:1017) ~[vavr-0.9.2.jar:?]
	at be.fgov.caamihziv.memberdata.application.async.AsyncRequestService.lambda$resetFailedAsyncRequests$df2ed96b$1(AsyncRequestService.java:47) ~[classes/:?]
	at io.vavr.control.Try.of(Try.java:75) ~[vavr-0.9.2.jar:?]
	at be.fgov.caamihziv.memberdata.application.async.AsyncRequestService.lambda$resetFailedAsyncRequests$1(AsyncRequestService.java:46) ~[classes/:?]
	at io.vavr.control.Try.flatMapTry(Try.java:472) ~[vavr-0.9.2.jar:?]
	at io.vavr.control.Try.flatMap(Try.java:454) ~[vavr-0.9.2.jar:?]
	at be.fgov.caamihziv.memberdata.application.async.AsyncRequestService.resetFailedAsyncRequests(AsyncRequestService.java:46) ~[classes/:?]
	at be.fgov.caamihziv.memberdata.application.async.AsyncRequestService$$FastClassBySpringCGLIB$$2ed1da93.invoke(<generated>) ~[classes/:?]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) ~[spring-aop-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at be.fgov.caamihziv.memberdata.application.async.AsyncRequestService$$EnhancerBySpringCGLIB$$19205d65.resetFailedAsyncRequests(<generated>) ~[classes/:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:261) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	... 13 more

I can give more information if it's required

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 27, 2018
@snicoll
Copy link
Member

snicoll commented Jul 27, 2018

Thanks for the report.

activemq-jms-pool is an optional dependency and it does not implement JMS 2.0. I am not sure what you expect us to do about it. As of Spring Boot 2.1 we are configuring CachingConnectionFactory by default.

Having said that, that makes an argument for stopping the integration with that library and use this project instead.

@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Jul 27, 2018
@pvanhees
Copy link
Author

I have no real expectations, it's just that in the spring boot docs it's suggested that you can add activemq-pool as dependency for JMS pooling, when in fact it isn't fully compatible with the spring JmsTemplate.

So using the deliveryDelay property from JmsTemplate can't work if you use activemq-pool.

Stopping the integration with the library would indeed be less confusing.

@snicoll snicoll changed the title incompatible spring boot bom versions: javax.jms-api & activemq-jms-pool ActiveMQ pooling option is not JMS 2.0 compliant Jul 27, 2018
@snicoll
Copy link
Member

snicoll commented Jul 27, 2018

Given that we now support Artemis as well (#13523) with the same implementation, I am tempted to document the limitation in 2.0.x and integrate with the new library in 2.1.

@snicoll snicoll added type: enhancement A general enhancement and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Jul 27, 2018
@snicoll snicoll added this to the 2.1.0.M1 milestone Jul 27, 2018
@snicoll snicoll self-assigned this Jul 27, 2018
@snicoll
Copy link
Member

snicoll commented Jul 30, 2018

In the meantime, that library has removed options that we're using in 2.0.x so I'd like to push back the upgrade to M2 so that we can properly deprecate those options in 2.0.x if necessary

messaginghub/pooled-jms#12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants