Skip to content

[Notifier][Docs] Prevent double sending #60768

@GrinWay

Description

@GrinWay

Description

NOTIFIER DOCUMENTATION IMPROVEMENT

Description
I suggest adding a piece of documentation to the Notifier component about the following situation I faced in a real commercial project.

Situation
Client gets the same notification several times (3-15 times, depends on failure configuration transport).

What happens?
One notification sends to many channels (email, telegram, sms)
Steps:

  1. telegram and sms are successfully sent except email (SMTP error)
  2. Notification sent to the failure transport
  3. Sends again, again telegram and sms are successfully sent except email (SMTP error)
  4. [Loop] until notification will be removed from the failure transport

My solution (maybe to add this solution in the docs)

  1. Use RabbitMQ, send notifications to "fanout" exchange:
    notification
    -> telegram_queue (a separate consumer for the telegram_queue)
    -> sms_queue (a separate consumer for the sms_queue)
    -> email_queue (a separate consumer for the email_queue)
  2. Use a custom serializer to decode notification and set channels depending on queue name
    For example:
    sms_queue sets only sms channel of Notification...
    and so on
  3. Run workers.

Maybe my solution is not easy as needed...
At any rate, this problem exists and I faced it in a real project.
I hope we'll find a solution how to avoid this together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions