Re: [jetty-users] Jakarta REST API Query

2021-06-28 Thread Aniruddha Tekade via jetty-users
Greg, I was going through your email and just noticed the cleared description part. So thought I can provide more details on interactions and issues - 1. Python script creates a S3 client (for my S3 service) and calls getObject() API by passing 2 parameters bucket name and object key 2.

Re: [jetty-users] Jakarta REST API Query

2021-06-27 Thread Aniruddha Tekade via jetty-users
Bill, I am trying to reproduce this mechanism - import boto3 import requests def lambda_handler(event, context): print(event ) object_get_context = event["getObjectContext"] request_route = object_get_context["outputRoute"] request_token = object_get_context[ "outputToken"] s3_url =

Re: [jetty-users] Jakarta REST API Query

2021-06-27 Thread Bill Ross
Aniruddha, How about e.g. (starting from retro code style I assume)     @Override     public void doGet(HttpServletRequest req, HttpServletResponse res)     throws ServletException, IOException  {     // get data from HS or HSC with synchronous GET     // pass data to Lambda

Re: [jetty-users] Jakarta REST API Query

2021-06-27 Thread Aniruddha Tekade via jetty-users
Greg, I think this can be helpful. Just to make sure I understand your point; do you mean - give some ID to request on the flask side or before sending request to flask i.e. on Jetty side? Sorry for so trivial question but I have just started learning this hence is a request for clarification.

Re: [jetty-users] Jakarta REST API Query

2021-06-27 Thread Greg Wilkins
Aniruddha, sorry, but I have no knowledge of the s3 APIs etc. All I'd say is that from an async API design point of view, there should always be some mechanism to allow you to associate an async response received with the request that you sent. There has got to be a way to either give some

Re: [jetty-users] Jakarta REST API Query

2021-06-27 Thread Aniruddha Tekade via jetty-users
Bill, Flask server only executes the lambda function (transforming the data -- ex. "my experiment with s3 object lambda".upper()) in python and then returns (or calls with) the transformed data in the body of response to write_get_object_response() defined with Java Server. Best, Aniruddha

Re: [jetty-users] Jakarta REST API Query

2021-06-27 Thread Aniruddha Tekade via jetty-users
Greg, Yes, exactly this is what I am trying to solve. Your steps 1 - 4 are my intended mechanism. it's a matter for the API talking to Flask, as you must be able to tunnel > some id or other that will allow you to do the lookup at step 3. My python client uses AWS boto3 session which makes a

Re: [jetty-users] Jakarta REST API Query

2021-06-27 Thread Bill Ross
If the Flask server doesn't do synchronous responses, that would explain my confusion. If it does, you may be misunderstanding me. Bill On 6/27/21 5:59 PM, Aniruddha Tekade via jetty-users wrote: Yes, I can remove the flask server and use Jython instead to make this run in the same Java

Re: [jetty-users] Jakarta REST API Query

2021-06-27 Thread Greg Wilkins
I'm a bit confused by your diagrams and descriptions. Perhaps a simple interaction diagram would help? If it is just Client ---GET--> Jetty --GET--> Flask, then I'm not seeing the problem. Just async wait for the response from Flask. But one of your diagrams/descriptions suggests that the

Re: [jetty-users] Jakarta REST API Query

2021-06-27 Thread Aniruddha Tekade via jetty-users
Yes, I can remove the flask server and use Jython instead to make this run in the same Java server. But since I am trying to reproduce what AWS does with S3 Object Lambda - *WriteGetObjectResponse* > >

Re: [jetty-users] Jakarta REST API Query

2021-06-27 Thread Bill Ross
Speaking from general server dev going back to the 90's, but w/o Amazon or Flask, so may not apply: # 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

[jetty-users] Jakarta REST API Query

2021-06-27 Thread Aniruddha Tekade via jetty-users
Hello All, 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 - Steps: 1. Python client script calls a GET getObject() API available with Java server with 2 params - bucket