feathersjs-ecosystem / feathers-sync

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

[#143] amqp retry mechanism #160

Closed fragilehm closed 3 years ago

fragilehm commented 3 years ago

This PR addresses the issue #143 the implementation is only relevant for amqp adapter, which properly reconnects after RabbitMQ goes down.

apmcodes commented 3 years ago

@fragilehm Does this reconnect on Channel closed error?

apmcodes commented 3 years ago

@fragilehm Does this reconnect on Channel closed error?

Tested this by manually inducing channel error. New connection and channel was setup as expected.

@fragilehm Can we add log like something below, would be helpful for monitoring the apps (concerning rabbitmq)

        app.configure(core);
        ...
        amqpConnection.on('connect', () => {
            app.info('amqp connected');
        });

        amqpConnection.on('disconnect', (err) => {
            app.error('amqp connection closed %s', err.err.message);
        });

Thanks for this PR, looking forward to use this in production.

fragilehm commented 3 years ago

production

the amqpConnection is exposed so if you want to track the connectivity then you can use it in the app.

fragilehm commented 3 years ago

Hi @daffl thanks for the review! Do you have an ETA for the release?