thenativeweb / node-cqrs-eventdenormalizer

Node-cqrs-eventdenormalizer is a node.js module that implements the cqrs pattern. It can be very useful as eventdenormalizer component if you work with (d)ddd, cqrs, domain, host, etc.
http://cqrs.js.org/pages/eventdenormalizer.html
MIT License
38 stars 27 forks source link

'disconnect' event for dynamodb repository not working #62

Open elmolicious opened 7 years ago

elmolicious commented 7 years ago

Hi,

We are currently implementing the denormalizer with the dynamodb repository and it seems like the 'disconnect' event does not get emitted.

I tested it by setting up a docker-compose with my service (using the denormalizer) and dynamodb and simply stopped the dynamodb container while the service was still running.

Can someone confirm that this is a problem with dynamodb? or is it a general problem?

Thanks for the answers in advance

adrai commented 7 years ago

this is not a general problem... but in real life I think dynamodb as a service offering will not go down that easy... I think the aws sdk has no sort of disconnect event for dynamodb...

elmolicious commented 7 years ago

Ok you are right, I guess the aws-sdk is stateless (no open connection, each request is a new, fresh one) and the concept of connection-lifecycle-hooks ('connect' and 'disconnect' events) does not really work with dynamodb.

Maybe it would be a good idea to enhance the existing documentation and add a notifier that the connection events are not supported when working with dynamodb as the repository type.