Google Cloud 将实体存储到 Memcache

问题描述 投票:0回答:1

在尝试寻找解决方案两周后,我非常渴望找到(并且我已阅读与该主题相关的所有内容)任何解决问题的方法。

我正在重新设计服务器,因为 Java 8 在 Google Cloud 上的支持已结束。我正在迁移到 Java 11。我已经能够设置 Jetty 服务器并从 Google Cloud Datastore 存储/获取实体。但是,我找不到任何方法在 Memcache 中存储实体。在(Java 8)之前,它非常简单明了,但这段代码不再工作,我不得不在 Java 11 上替换这段代码。

旧代码:

import com.google.appengine.api.memcache.MemcacheService;
import com.google.appengine.api.memcache.MemcacheServiceFactory;

MemcacheService syncCache = MemcacheServiceFactory.getMemcacheService();
Entity entity;
Key key;

public void load(){
    entity = (Entity)syncCache.get(key);
}
public void save(){
    syncCache.put(key,entity);
}
...
...
...

Java 11 中是否有类似的访问 Google Cloud Memcache 的解决方案?非常感谢您的帮助。

google-cloud-platform entity memcached java-11
1个回答
0
投票

我也遇到这个问题...如果您找到任何解决方案,请发布在这里。这将非常有用。 谢谢!@

© www.soinside.com 2019 - 2024. All rights reserved.