Open cer opened 4 years ago
NoopDuplicateMessageDetector should not be the default - it's too dangerous.
Chris,
I checked the micronaut docs. It seems we can use
@Requires(property="transactional.duplicate.detector.factory", value="sqlTable", default="sqlTable")
For SqlTableBasedDuplicateMessageDetector bean
and:
@Requires(property="transactional.duplicate.detector.factory", value="noop")
for TransactionalNoopDuplicateMessageDetector
Please let me know if I can start working on it.
This seems pretty ugly: https://github.com/eventuate-tram/eventuate-tram-docs/blob/master/src/docs/asciidoc/getting-started-eventuate-tram.adoc#micronaut-3
I understand that Micronaut searches the classpath for beans/factories - no @Import
This is the fallback
NoopDuplicateMessageDetector
and is only defined if there is no other bean. The developer can use it by not addingeventuate-tram-micronaut-consumer-jdbc
as a dependency.If the developer wants either of these:
SqlTableBasedDuplicateMessageDetector
TransactionalNoopDuplicateMessageDetector
Then they have add
eventuate-tram-micronaut-consumer-jdbc
as a dependency.It seems ugly to have a boolean flag. What would be cleaner would be a property like
transactional.duplicate.detector.factory
:sqlTable
-> useSqlTableBasedDuplicateMessageDetector
noop
-> useTransactionalNoopDuplicateMessageDetector
Does
@Requires
supportUnset or
sqlTable` - time to read the manual?