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

spike/CAS-1341-CAS2-Prison-Transfer-Event-Emit-POC #2834

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

besscerule
Copy link

This is a POC branch to demonstrate how to set up a listener for the domain events topic.

Message Listener listens to the inboundQueue which is filtered by the allocation and handover event types and prints out the message.

You can run it locally and send messages using the scripts found in test-messages in the test resources folder.

It has a simple Integration test that checks that the listener was called and also a tests to check the health of the queue.

@besscerule besscerule changed the title added listener poc to domain events with testing spike/CAS-1341-CAS2-Prison-Transfer-Event-Emit-POC Jan 21, 2025
@besscerule besscerule self-assigned this Jan 21, 2025
@@ -64,6 +64,10 @@ generic-service:
elasticache-redis:
SPRING_DATA_REDIS_HOST: "primary_endpoint_address"
SPRING_DATA_REDIS_PASSWORD: "auth_token"
inbound-queue-sqs-instance-output:
HMPPS_SQS_QUEUES_INBOUNDQUEUE_QUEUE_NAME: "inboundqueue"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a specific reason this isn't either camel or snake case?

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Excellent!

@besscerule besscerule force-pushed the spike/CAS-1341-CAS2-Prison-Transfer-Event-Emit-POC branch 2 times, most recently from bc64d4d to f2a191a Compare January 21, 2025 10:07
fun `Put Message on Inbound Queue Request is successful`() {
putMessageOnInboundQueue()
TimeUnit.MILLISECONDS.sleep(10000)
verify(exactly = 1) { mockMessageListener.processMessage(any()) }
Copy link
Contributor

Choose a reason for hiding this comment

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

again, probably not an issue as this is POC but a library like awaitility would let us remove this sleep. I'm not sure if there's a more kotlin way of doing it though!

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure we even need the sleep tbf

Copy link
Author

Choose a reason for hiding this comment

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

ahh yes we do! fails when i remove!

This is a POC branch to demonstrate how to set up a listener for the domain events topic.

Message Listener listens to the inboundQueue which is filtered by the allocation and handover event types and prints out the message.

You can run it locally and send messages using the scripts found in test-messages in the test resources folder.

It has a simple Integration test that checks that the listener was called and also a tests to check the health of the queue.
@besscerule besscerule force-pushed the spike/CAS-1341-CAS2-Prison-Transfer-Event-Emit-POC branch from f2a191a to f422f8d Compare January 21, 2025 10:17
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.

3 participants