feathersjs-ecosystem / feathers-sync

Synchronize service events between Feathers application instances
MIT License
222 stars 41 forks source link

Mongo events don't get emitted on serverX #45

Closed MichaelErmer closed 7 years ago

MichaelErmer commented 7 years ago

Expected behavior

Server2 should emit the event that server1 sends.

Actual behavior

server1:

  feathers-sync subscribing to handler locations created +0ms
  feathers-sync subscribing to handler locations updated +0ms
  feathers-sync subscribing to handler locations removed +0ms
  feathers-sync subscribing to handler locations patched +0ms
Feathers application started on 127.0.0.1:3031
  feathers-sync emitting event to channel auth/token created +4s
  feathers-sync emitting event to channel auth/token created +13ms
  feathers-sync got event, calling old emit auth/token created +81ms
  feathers-sync got event, calling old emit auth/token created +4ms

  feathers-sync emitting event to channel locations created +22s

server2:

  feathers-sync subscribing to handler locations created +0ms
  feathers-sync subscribing to handler locations updated +0ms
  feathers-sync subscribing to handler locations removed +0ms
  feathers-sync subscribing to handler locations patched +0ms
Feathers application started on 127.0.0.1:3032

There is also no event in the mongo events collection:

db.events.find({event: "locations created"}).sort({_id:-1}).limit(5)

Returns nothing, however there are some auth/* events.

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working): "body-parser": "^1.15.0", "compression": "^1.6.1", "cors": "^2.7.1", "crypto": "0.0.3", "elasticsearch": "^11.0.1", "feathers": "^2.0.0", "feathers-authentication": "^0.7.9", "feathers-configuration": "^0.2.2", "feathers-errors": "^2.1.0", "feathers-hooks": "^1.6.1", "feathers-hooks-common": "^2.0.1", "feathers-mongoose": "^3.6.1", "feathers-rest": "^1.2.5", "feathers-sequelize": "^1.3.3", "feathers-socketio": "^1.3.4", "feathers-sync": "^0.1.1", "hashids": "^1.1.1", "lodash": "^4.16.2", "mailgun-js": "^0.7.13", "mongoose": "^4.6.6", "mongoose-history": "^0.4.2", "newrelic": "^1.34.0", "passport": "^0.3.2", "passport-local": "^1.0.0", "pg": "^4.5.6", "pg-hstore": "^2.3.2", "pg-pool": "^1.5.0", "randomstring": "^1.1.5", "raven": "^0.12.1", "request": "^2.75.0", "request-promise": "^4.1.1", "sequelize": "^3.21.0", "serve-favicon": "^2.3.0", "shortid": "^2.2.6", "winston": "^2.2.0"

NodeJS version: 4.6.2

Operating System: Ubuntu16.04

Browser Version:

React Native Version:

Module Loader:

MichaelErmer commented 7 years ago

I tried redis, it kind of works, however i dont undestand 4 emitted events for 1 redis publish:

redis-cli -h 172.17.0.8 monitor
OK
1481625700.550331 [0 172.17.0.32:60148] "publish" "locations created" “{\”__v\":0,\"name\":\"x VPN2x\”,\”zip\":\"93049\",\"_id\":\"584fd064b06144001cfa097c\",\"updatedAt\":\"2016-12-13T10:41:40.543Z\",\"createdAt\":\"2016-12-13T10:41:40.543Z\",\"active\":true,\"ips\":[\"x\"]}"

server:

  feathers-sync:redis got event, calling old emit [object Object] +1m
  feathers-sync:redis got event, calling old emit [object Object] +1ms
  feathers-sync:redis got event, calling old emit [object Object] +0ms
  feathers-sync:redis got event, calling old emit [object Object] +1ms

I get 4 events in my client:

42["locations created”,{"__v":0,"name":"x VPN2x”,"zip":"93049","_id":"584fd064b06144001cfa097c","updatedAt":"2016-12-13T10:41:40.543Z","createdAt":"2016-12-13T10:41:40.543Z","active":true,"ips":["x"]}]   219 
11:41:40.618
42["locations updated”,{"__v":0,"name":"x VPN2x”,"zip":"93049","_id":"584fd064b06144001cfa097c","updatedAt":"2016-12-13T10:41:40.543Z","createdAt":"2016-12-13T10:41:40.543Z","active":true,"ips":["x"]}]   219 
11:41:40.619
42["locations removed”,{"__v":0,"name":"x VPN2x”,"zip":"93049","_id":"584fd064b06144001cfa097c","updatedAt":"2016-12-13T10:41:40.543Z","createdAt":"2016-12-13T10:41:40.543Z","active":true,"ips":["x"]}]   219 
11:41:40.620
42["locations patched”,{"__v":0,"name":"x VPN2x”,"zip":"93049","_id":"584fd064b06144001cfa097c","updatedAt":"2016-12-13T10:41:40.543Z","cr
MichaelErmer commented 7 years ago

closing this, as upgrade to feathers-sync@0.1.2 fixed the redis issues