awslabs / awslabs/amazon-sqs-java-temporary-queues-client

Separate request/response queues?

Open
#55 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
99
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Greetings!

I'm currently investigating how to implement an asynchronous request-response pattern using SQS/SNS, but with a few added wrinkles into the mix. When the API receives the initial request we want to forward it on to a separate service via SQS, perform some additional processing over a number of services (effectively lambdas, but not actual Lambdas) using SNS/SQS, and then send the response back to the API service via SQS. If this process takes longer than the API service is willing to wait (around 10 seconds), then we want it to fail-over to a separate queue so a different processor can pick it up and run with it.

This is a pretty complex use case, I know, and while I had initially hoped that this would work with this library, I'm struggling to figure out how to make this work. So I thought I'd run some of this by you guys and a) make sure my assumptions check out, and b) gather any suggestions on how I should approach this.

The biggest thing I've noticed is that the vast majority of the code assumes that the requester and responder are utilizing the same queue. I might be completely off track here, but I don't see any way to specify in the API two separate queues.

The second thing I've noticed is that the VirtualQueueClient doesn't seem to support multiple JVMs on the same queue, unless I'm really missing something. Specifically, there doesn't appear to be any logic for handling virtual queues created by other JVMs or processes; it looks like it just treats them as orphaned, since as far as I can tell it doesn't attempt to synchronize the virtual queues across hosts.

I've been working on drafting up a proof-of-concept that demonstrates this use case, but I'm starting to think I might need to modify the client code itself in order to support the concept of dual queues. That would at least let me use the original RequesterClient and ResponderClient libraries.

Is this a use case you guys support/are interested in supporting? I can continue investigating into this if so.

Contributor guide

Open the contributing guide

Research direction

Start by reading the RequesterClient, ResponderClient, and VirtualQueueClient entry points mentioned in the issue, then trace how queue names and virtual queues are coordinated across processes. Compare the current same-queue assumptions with the proposed separate-queue and multi-JVM flow; done would require a decided, documented design and verified support for the intended pattern.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
backend-api-design, cloud, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.