java - Consume message only once from Topic per listeners running in cluster -
i'm implementing domain event infrastructure, project doesn't allow messaging infra(financial services client) found alternative in hazelcast topics , executorservice,
but problem when running in cluster message shall delivered listeners going running in cluster, cluster of 2, have same listener running in 2 jvm, , message consume twice , acted upon, suppose domain event supposed perform non idempotent operation credit loyalty points, unless explicitly maintain trace of domain event acted upon , check against everytime receive event, end crediting twice, "any suggestion implementing without having write boiler plates possibly @ infralayer", or there known patter such implementation.
edit: meanwhile i'm evaluating hazelcast executorservice suggested here
the use case described can solved using hazelcast's queues instead of topics. main reason use topics if interested multiple (possibly independent) consumers same message. requirement sounds interested 1 of consumers gets message, , that's queues for, see the hazelcast documentation queues.
Comments
Post a Comment