feathersjs-ecosystem / feathers-sync

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

add adapterType option #86

Closed ramzes13 closed 6 years ago

ramzes13 commented 6 years ago

Summary

Hello I encountered such a problem, when an adapter has a secure url, like: amqps://user:pass feathers-sync throw an exception: amqps is an invalid adapter (uri amqps) In this PR I added a adapterType with which you can choose the explicit adapter.

daffl commented 6 years ago

Thank you! I'm wondering if we should add amqps to the list of mappings in https://github.com/feathersjs-ecosystem/feathers-sync/blob/master/lib/index.js#L6 instead.

It is also possible to force the adapter using snc.<adaptername>

const feathers = require('@feathers/feathers');
const sync = require('feathers-sync');

const app = feathers();

app.configure(sync.amqp({
  uri: 'amqps://localhost:27017/sync'
}));
ramzes13 commented 6 years ago

Hello, For firs solution, amqps, is not a generic solution, the same problem will occur with the other adapters, which use a secure connection. I like the second solution, can I modify this PR, to implement that ?

ramzes13 commented 6 years ago

Sorry, I did not notice the Object.assign(module.exports, mappings); at the end of the file :). I close the PR, Thank you!

daffl commented 6 years ago

True, we can always use the adapter option for those cases. Even though we closed the PR, thank you for submitting it!