Issue with scheduling events with masstransit

28 views
Skip to first unread message

Bar

unread,
Jul 20, 2017, 11:04:31 PM7/20/17
to masstransit-discuss
Hello, I am relatively new to MassTransit. I have a scheduler application that publishes messages to a queue according to a schedule defined in the database. Consumers pick up messages and do the work. The problem is that sometimes work takes long time to complete, during which the next schedule interval elapses and the schedule publishes a second message. I want to prevent other consumers from picking up the message by not publishing it. This is to avoid having overlapping threads. Currently, I am having consumers send a message back to scheduler notifying that the work is done. This "works" but occasionally a consumer fails and the message is retried causing duplication of work. I am looking into breaking down the long running consumers, but it's hard to prevent because it's driven by clients. For example, some consumers have to email hundreds of people. I can write the status of the consumer to the database and manage them myself. Is it better to use sagas or Corriers?
Reply all
Reply to author
Forward
0 new messages