简体   繁体   English

2个Google App Engine数据存储区更新

[英]2 Google App Engine Datastore updates

I have 2 GAE apps running (GAE1 and GAE2). 我有2个GAE应用运行(GAE1和GAE2)。 I have to update the datastore of GAE2 from GAE1. 我必须从GAE1更新GAE2的数据存储区。 How can I achieve this in Java? 我怎样才能在Java中实现这一目标? Does GAE provide any APIs for cross GAE datastore updates? GAE是否为跨GAE数据存储更新提供任何API?

Note: I tried making a PUT request through the browser, by enabling CORS on the source and destination GAEs. 注意:我尝试通过浏览器发出PUT请求,在源和目标GAE上启用CORS。 Unfortunately CORS works only for GET and HEAD. 不幸的是,CORS仅适用于GET和HEAD。

This issue is fixed in the following way, (Note my requirement is I should not use Remote API from GAE.) 此问题已通过以下方式修复,(请注意,我的要求是不应使用GAE中的远程API。)

  1. Open an URL in the destination GAE allow this url alone, if it contains a secure request header. 打开目标GAE中的URL,如果它包含安全请求标头,则仅允许此URL。

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. 检查您传递的请求标头(如果它存在于目标GAE中)。

  2. Write your REST service in this url path /intgr and send back the response to the Source GAE. 在此url path / intgr中编写REST服务,并将响应发送回Source GAE。

除了前面提到的Cloud Datastore API之外 ,您还可以使用Remote API访问不同App Engine应用程序(包括数据存储区)中的服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM