我们正在将我们的应用程序从 Rackspace 转移到 Modulus。我们有 2 个使用 meteorhacks:cluster 包配置为微服务的应用程序。似乎 Meteor 方法(服务器 1 到服务器 2)调用正在工作,但流星订阅(客户端 2 到服务器 1)不起作用。我想弄清楚这是否是跨域请求问题。
// https://github.com/meteorhacks/cluster#microservices
//server2/app.js
Cluster.register(process.env.APP_NAME,{endpoint:process.env.ROOT_URL});
mainApp = Cluster.discoverConnection("server1");
Cluster.allowPublicAccess("server1");
//client2/app.js
mainApp = Cluster.discoverConnection("server1");
ContentLibrary= new Meteor.Collection('content_library', {connection:mainApp,idGeneration : 'MONGO'});
//client2/home.js
mainApp.subscribe('contentDocuments','all',function(e){
if(!e)
doSomething();//Never gets called
});
//server1/publish.js
Meteor.publish("contentDocuments", function(){
return ContentLibrary.find({});
}
永远不会填充客户端上的 ContentLibrary 集合。
我们的应用程序按预期在 Rackspace 上运行。