JMS 1.1 and AWS SQS SimpleQueueService #359
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted to add support for an AWS SQS (Simple Queue Service) provider to jms4s.
Unfortunately the AWS SQS driver only implements some of the JMS 1.1 API, whereas jms4s was using the JMS 2.0 API. This led to a number of issues:
Firstly I downgraded jms4s from JMS 2.0 to JMS 1.1 (which seems to work fine with IBM MQ and Apache MQ Artemis). The he main piece of work here was implementing a stand-in for
javax.jms.JMSContext
that is available in JMS 2.0, but not JMS 1.1. I decided to take this approach as jms4s makes heavy use of JMSContext. This was actually relatively easy to achieve.I commented out any methods that used JMS send with delay, as the 1.1 API does not support send with delay.
I added an AWS SQS provider and test suite. As a stand-in for integration testing against AWS SQS, I selected ElasticMQ as it provides an SQS compatible API.
I had to separate some of the test cases into separate traits as SQS supports Queues, but does NOT support Topics. Likewise SQS does not support local transactions for JMS.
Finally all tests pass currently against IBM MQ, Apache MQ Artemis, and ElasticMQ.
Downgrading from JMS 2.0 to 1.1 seems to have had little impact on jms4s (apart from removing send with delay functionality), It would be ideal if we could find a way to have jms4s support both JMS 1.1 and 2.0 but I am not sure what such an approach would look like... I would be very interested to discuss such an approach with the authors or jms4s ASAP.