![]() The AmazonSQS client, which is part of the AWS SDK, provides the methods sendMessage() and sendMessageBatch() to send messages to an SQS queue. Be sure this event bus name has to match what’s defined on the publisher app in step 1. Let’s start with the easy part and look at publishing messages. Access EventBridge under AWS Services click on left navigation menu Event Buses click on Create event bus button to create a event bus, test-event-bus in this example. This is exactly what we’ll be building in this article.Īs a bonus, we’ll build a message publisher that wraps the AWS SDK and adds a little extra robustness in the form of retries. However, it’s missing a polling mechanism that allows us to pull messages from the queue regularly and process them in near-realtime across a pool of message handlers working in parallel. Isn’t the AWS SDK Good Enough?ĪWS provides an SDK that provides functionality to interact with an SQS queue. It’s available on Maven Central and I’ll welcome any contributions you might have to make it better. The code in this article comes from the SQS Starter library that I built for one of my projects. In the end, we’ll wrap this component into a Spring Boot starter to be used in our Spring Boot applications. This article shows a way of implementing a component that is capable of sending messages to and retrieving messages from an SQS queue in a robust and scalable manner. It’s not rocket science, but it requires some careful design to build a robust and scalable message handler. ![]() This was also the case when I had First Contact with AWS’s “Simple Queue Service” or SQS.Īnd while it is rather simple to send messages to an SQS queue, there are some things to consider when retrieving messages from it. I mistrust tools and products that have the word “simple” in their name.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |