0

I'd like to create a system that 'appends' mails to each other.

Situation: Everytime an entity is changed I'd like to send a mail to subscribers of that entity.

But when the entity is changed 10 times on a small time (like 5 / 10 minutes) the subscribers don't need to be spammed with emails.

So I was thinking of creating a 'Queue'. And to be more precise I was thinking about using the Azure Servicebus.

After searching some of the documentation. I found two interesting properties.

  • SessionId => Would be the entity of the Id
  • BatchFlushInterval (Client-side batching)

'If the client sends additional messages during this time period, it transmits the messages in a single batch'

This sounded perfect. In this way I recieve all the 'changes of the entity' in a single batch. And could construct a single e-mail to send.

But I don't seem to find this option anymore in the new "Azure Service Bus NuGet".

Now that I searched for alternatives, I have a feeling this is not a 'normal' practice.

Does someone have some experience in this field? I would like to avoid having to use a cron job. But if this is the best solution please let me know.

I know this a really broad question and more a 'need for information'. So commenting with links can already make me real happy.

Thanks in advance Brecht

ErazerBrecht
  • 1,583
  • 2
  • 20
  • 37
  • 1
    I have not used this delayed batching property of ASB or the nuget package your referenced. I am using standard https://www.nuget.org/packages/WindowsAzure.ServiceBus/ and BatchFlushInterval property is available there, for example as a setting when instantiating messaging factory. – Slava Asipenko Jun 20 '17 at 16:51

1 Answers1

1

Don't think Message Sessions or BatchFlushInterval is the approach to take here. What you're looking for is to buffer messages to create a single notification rather than multiple ones. I'd personally go with receiving a batch from the Azure Service Bus and process the batch to "append" notifications.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80