eventuate-tram-examples / eventuate-tram-examples-nodejs-customers-and-orders

Other
6 stars 4 forks source link

Order History Service should not need MySQL #8

Open cer opened 4 years ago

cer commented 4 years ago

https://github.com/eventuate-tram-examples/eventuate-tram-examples-nodejs-customers-and-orders/blob/8c19f208439e2dfc9c5a9221efae6cd36a299993/docker-compose.yml#L53-L57

dartvandru commented 4 years ago

These environment variables needed because the Order History Service uses MessageConsumer. https://github.com/eventuate-tram-examples/eventuate-tram-examples-nodejs-customers-and-orders/blob/master/order-history-service/index.js#L3

And the MessageConsumer uses messageHandlerDecorator https://github.com/eventuate-tram/eventuate-tram-core-nodejs/blob/master/lib/kafka/MessageConsumer.js#L8

The messageHandlerDecorator detects duplicated messages with SqlTableBasedDuplicateMessageDetector

cer commented 4 years ago

There needs to be a way for the Order History Service to configure the message consumer with the equivalent of this a NoopDuplicateMessageDetector as is done here

In the Java Tram framework, the MessageDecorators are not hardwired. Instead they are @Beans. This enables an application to choose which ones to use. See https://eventuate.io/docs/manual/eventuate-tram/latest/getting-started-eventuate-tram.html#_idempotent_message_consumers