-
Notifications
You must be signed in to change notification settings - Fork 146
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
java.lang.NoSuchMethodError: javax.jms.MessageProducer.setDeliveryDelay #84
Comments
I'm facing exactly the same problem. |
Same |
2 similar comments
Same |
Same |
Someone to solve this? |
this means your client is expecting JMS 2.0 and this lib only supports 1.1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
I am using spring JMS and amazon-sqs-java-messaging-lib:1.0.8
I have a JMS template bean as
final JmsTemplate jmsTemplate = new JmsTemplate(sqsConnectionFactory);
and I set the deliveryDelay as
jmsTemplate.setDeliveryDelay(30000L);
The problem is that while calling the method
jmsTemplate.convertAndSend
I get the below error
java.lang.NoSuchMethodError: javax.jms.MessageProducer.setDeliveryDelay(J)V at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:628) at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:608) at org.springframework.jms.core.JmsTemplate.lambda$send$3(JmsTemplate.java:586) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:504) at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:584) at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:661)
After looking at the dependency tree of my project I found that
amazon-sqs-java-messaging-lib:1.0.8 uses geronimo-jms_1.1_spec in which the MessageProducer does not support setDeliveryDelay method, however I know that amazon-sqs-java-messaging-lib supports setDeliveryDelay since 1.0.6.
I got this to work by excluding geronimo-jms_1.1_spec as a transitive dependency and upgrading to geronimo-jms_2.0_spec manually in my build.gradle.
Will amazon-sqs-java-messaging-lib support geronimo-jms_2.0_spec or newer versions?
Is there a recommend way of setting the deliveryDelay using the JMS template?
Thanks
The text was updated successfully, but these errors were encountered: