Closed jmartin-sul closed 5 years ago
Integrating SQS with Trellis's JMS implementation may not be as straightforward as we thought. Reading through https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-java-message-service-jms-client.html, it seems to me that this is documenting a Java library that Trellis would have to implement in its own source code. That would eliminate option 1 above.
I haven't seen any docs that suggest Trellis can emit SNS messages, and I also am not aware of any SNS/JMS bridge, which would eliminate option 2 above.
If we want to make use of Trellis's built-in JMS publisher, our best hope may be AmazonMQ, which can already handle JMS. Ideally, that would be as easy as pointing the Trellis JMS configuration at our AmazonMQ endpoint. AmazonMQ supports two concepts: topics and queues. If it publishes to an AmazonMQ queue, the message will stick around for a while (akin to SQS). If a topic, and no one is consuming that topic actively, the message will never be seen (akin to SNS). Thus, in the latter scenario, we'd want to make sure we have a persistent AmazonMQ listener that, e.g., publishes those messages somewhere stickier (an AmazonMQ or SQS queue). I'm not sure whether Trellis would publish to a topic or a queue or how to determine that at the moment. This needs more analysis.
This also means we will likely need to write some code that polls the AmazonMQ or SQS queue (see above paragraph) as part of the work on #46.
@mjgiarlo :speech_balloon:
... AmazonMQ supports two concepts: topics and queues. If it publishes to an AmazonMQ queue, the message will stick around for a while (akin to SQS). If a topic, and no one is consuming that topic actively, the message will never be seen (akin to SNS). Thus, in the latter scenario, we'd want to make sure we have a persistent AmazonMQ listener that, e.g., publishes those messages somewhere stickier (an AmazonMQ or SQS queue). I'm not sure whether Trellis would publish to a topic or a queue or how to determine that at the moment. This needs more analysis.
Looking at the Trellis source code, it looks like it publishes to a queue rather than a topic: https://github.com/trellis-ldp/trellis/blob/master/notifications/jms/src/main/java/org/trellisldp/jms/JmsPublisher.java#L100
See in particular the usage of #createQueue
over #createTopic
(which are documented in Javadoc: https://docs.oracle.com/javaee/7/api/javax/jms/Session.html#createQueue-java.lang.String-).
Hi @mjgiarlo, I just pushed up a branch jms-notification
that uses a Docker ActiveMQ image with Trellis (this was just to test how Trellis sends JMS locally) and I believe that you are right, Trellis is using ActiveMQ/AmazonMQ queues. I haven't gone beyond setting up the docker-compose and config.yml changes.
@jermnelson :speech_balloon:
Hi @mjgiarlo, I just pushed up a branch
jms-notification
that uses a Docker ActiveMQ image with Trellis (this was just to test how Trellis sends JMS locally) and I believe that you are right, Trellis is using ActiveMQ/AmazonMQ queues. I haven't gone beyond setting up the docker-compose and config.yml changes.
Oh, super! That is enough to get me off the blocks for now. Thank you. :smiley:
@jermnelson I added the 61613
port to the docker-compose config and now I have things working: https://github.com/LD4P/sinopia_server/issues/46#issuecomment-462521824
Thanks again.
options seem to be: