I know that this may sound totally absurd but I am trying to achieve an asynchronous mechanism between my 2 APIs - GET and POST. A quick lookup as follows in the image -
- Python client script calls a GET getObject() API available with Java server with 2 params - bucket name and object key
- Jetty server performs gets the real object from my custom S3 object server (on-prem)
- Jetty server also gets the lambda function name that is available in a Redis instance for the bucket name
- Jetty server now forwards the request to a Python Flask server which has the lambda function by passing object data to it
- Lambda function code perform the transformation on the object and POST it back to Jetty server (which is a different API called writeGetObjectResponse)
- WriteGetObjectResponse should now send response to the original caller (python client) where I am stuck at
Basically, I am trying to develop my own S3 Object Lambda and reproduce what AWS has done using a simpler way.
I am not sure if this is the right approach but AWS does this in the exact same way where s3.getObject() get the reply from s3.writeGetObjectResponse(). To make this work, I am trying to find something using which I would be able to map the request with some unique identifier and as soon as I get transformed data back in writeGetObjectResponse(), my jetty server will send the response back to the original client. I tried using getSession().getId() but seems like that is null for httpservletrequest.
Any idea how can I identify each GET request with unique identifier? And also can I reply to a request the way I am willing to do? Please help.