Modulus Meteor Microservices Subscriptions not working -


we moving our app rackspace modulus. have 2 apps configured microservices using meteorhacks:cluster package. seems meteor methods (server1 server2) call working meteor subscription (client2 server1) not working. trying figure out if cross domain request issue.

// 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 collection on client never populated.

our apps works on rackspace expected.

i'm not using meteorhacks:cluster running microservices meteor app. it's on do, setup may different, here how i'm doing it.

i'm using reactive-publish server side reactivity

// client ------ /server/lib/ddp-setup.js contentlibrary = ddp.connect('10.123.455.332:3000')  /server/publications.js content = new mongo.collection('content', {connection: contentlibrary}) meteor.publish('content', function(opts){   check(opts, object)   this.autorun(()=>{     let sub = contentlibrary.subscribe('content', opts)     if( sub.ready() ){       return content.find({})     }   }) })  // server1 @ 10.123.455.332:3000 -------  /server/publications.js meteor.publish('content', function(opts){   check(opts, object)   // opts...   return content.find({}) }) 

the idea client ever talking it's own server, server talks of other microservices. affords increased security of allowing servers speak each other on private network (as have setup digital ocean).

letting servers talk each other on private network security @ best , network latency 0 between servers. setting means have worry sticky sessions between client browser , web-facing app/service.

this may or may not answer question, give insight setting architecture.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -