Using Distributed lock for a particular method based on a path parameter.

43 views
Skip to first unread message

Arun

unread,
Jan 16, 2019, 9:13:49 AM1/16/19
to Google App Engine
Is there a way to lock a method that processes a http request based on a particular path parameter in GAE java? If get three requests get/a, get/a and get/b for a path get/x where x is a dynamic path parameter. Is there a way to lock the method to process get/a serially while it processes get/b parallely.

Cristian (Google Cloud Platform Support)

unread,
Jan 22, 2019, 1:59:30 PM1/22/19
to Google App Engine

Hello,


Locking a method could be done in code. Further clarification is needed on your use case to address your question better using App Engine. So you may post your full detailed question on Stack Overflow since Google Groups are reserved for general discussions on Google Cloud Platform-end products.


Nevertheless, a viable solution is to use different services for your different handlers as described here and here. For this, you can use a dispatch file to override the routing rules and use different services based on the definition of the request, get/x. To process requests serially, you may also review the section “scheduling work outside of user requests” in App Engine’s How-to guides.


If you need further architectural assistance, I would like to suggest contacting one of the supported partners to discuss about your application-specific design.



Reply all
Reply to author
Forward
0 new messages