Reading SQS Message via Listener
Currently SQS provides way to read messages using listener (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/getting-started.html - Receiving messages asynchronously section). It is only implemented in JAVA. Is there corresponding .net implementation? I mean instead of polling SQS queue, listener should trigger event once message is received in queue.
That section corresponds to a JMS interface for SQS that allows existing JMS applications to work with SQS instead of a different JMS compatible product. JMS stands for Java Message Service and as such I do not think there is an implementation in other languages. The implementation of the SQS Java Messaging Library most probably includes a thread that polls the queue and when it receives messages, calls the listener. It can be easy to implement yourself.
Saying that, One way for achieving the asynchronous invocation without writing your own poller would be to use a Lambda function. In that case, the Lambda service does the polling, and it invokes your function when it receives new messages.
There are some examples of receiving SQS messages in the SDK developer guide.
If you go to the SQS introduction page and look at the topics, you'll see one for Sending messages and one for Receiving messages. The example for receiving messages uses an async method to wait for and return any messages that are placed into the queue. Perhaps this would be interesting for you to look at.
A fun exercise: If you use the examples cited above to create console apps to both send and receive messages, you can run them both at the same time and send yourself messages. :-)
In addition to the SQS examples cited above, there are also examples in the AWS Docs SDK Examples repo on GitHub. Specifically, in the dotnetv3/SQS folder.
Hope this helps.
Relevant questions
Read Policy to SQS
asked 5 months agoAvailability of SQS Temporary and Virtual Queues in Languages Other Than Java.
asked 6 months agoStandard SQS - Duplicate message
asked 2 months agoCan not access SQS via VPC SQS endpoint
asked 3 years agoSQS Listener not working Profile based authentication
asked 5 months agoWhy am I getting SQS messages with different MessageGroupId's in a single boto3 receive_messages call?
asked 5 months agoMultiple SQS messages of the same group in one batch
Accepted Answerasked 18 days agoRun callback when SQS gets message?
Accepted Answerasked 4 months agoReading SQS Message via Listener
asked 3 months agoSQS not receiving SNS message
asked 3 years ago