Balaji Sudharsanam
Balaji Sudharsanam

Reputation: 67

2 Google App Engine Datastore updates

I have 2 GAE apps running (GAE1 and GAE2). I have to update the datastore of GAE2 from GAE1. How can I achieve this in Java? Does GAE provide any APIs for cross GAE datastore updates?

Note: I tried making a PUT request through the browser, by enabling CORS on the source and destination GAEs. Unfortunately CORS works only for GET and HEAD.

Upvotes: 3

Views: 59

Answers (2)

Balaji Sudharsanam
Balaji Sudharsanam

Reputation: 67

This issue is fixed in the following way, (Note my requirement is I should not use Remote API from GAE.)

  1. Open an URL in the destination GAE allow this url alone, if it contains a secure request header.

For example:

 public void filter(ContainerRequestContext requestContext) {
        if (requestContext.getUriInfo().getPath().contains("intgr")
    }
  1. Check for the request header that you pass, if it is present in the destination GAE.

  2. Write your REST service in this url path /intgr and send back the response to the Source GAE.

Upvotes: 3

Adam
Adam

Reputation: 5995

In addition to the Cloud Datastore API mentioned previously, you can also use the Remote API to access services across different App Engine applications including Datastore.

Upvotes: 1

Related Questions