【问题标题】:Delete message older than 90 days from error/poison queue using masstransit使用 masstransit 从错误/毒物队列中删除超过 90 天的消息
【发布时间】:2021-01-20 18:32:33
【问题描述】:

场景: 我有 Windows 服务,它使用 MassTransit 从 MessageBus 读取消息。 MessageBus 可以配置为 RabbitMQ 或 AzureService Bus。 如果消息在 5 次后始终失败,则消息将被移动到另一个队列“publishToXYZ_Error”

问题: 我想删除使用 MassTransit 超过 90 天的“publishToXYZ_Error”中的所有消息。 或者有什么方法可以让我们使用 MassTransit 过滤和使用超过 90 天的消息。

示例负载

{
  "messageId": "acdc0000-0e07-28f1-43d2-08d87c0aad48",
  "conversationId": "acdc0000-0e07-28f1-bc6c-08d87c081e05",
  "sourceAddress": "rabbitmq://localhost/MyComputer_dotnet_bus_iuqyyyyqyhwxnoksbdc8ab6erb?durable=false&autodelete=true",
  "destinationAddress": "rabbitmq://localhost/PublishToXYZ_delay?type=x-delayed-message&delayedType=fanout&bindexchange=PublishToXYZ",
  "messageType": [],

  "message": {

    "xyzEndPointId": "3",
    "actorMail": "temp65@gmail.com",
    "scoreBandTitle": "fail",
    "resultStatus": 2,
    "maxScore": 100,
    "totalScore": 10,
    "percentageScore": 77,
    "firstName": "ParticipantNameANA 11",

  },

  "sentTime": "2020-10-29T13:00:57.1637274Z",

  "headers": {
    "MT-Redelivery-Count": 5
  },

  "host": {
    "machineName": "Mycomputer",
    "processName": "dotnet",
    "processId": 38008,
    "frameworkVersion": "4.0.30319.42000",
    "massTransitVersion": "5.5.5.0",
    "operatingSystemVersion": "Microsoft Windows NT 10.0.19041.0"
  }

}

【问题讨论】:

    标签: rabbitmq azureservicebus masstransit


    【解决方案1】:

    我相信你说的是错误队列或毒队列,或invalid message channel

    MassTransit 对该队列不做任何事情,也不会从那里删除消息。您可以通过 UI 或使用管理 API 或您的代理自行完成。

    我发现了一个类似的讨论:MassTransit/RabbitMq Error queue - how to delete messages?

    请让我知道这是否相关。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-02
      • 1970-01-01
      • 2021-12-09
      • 2013-12-29
      • 2015-10-22
      • 2016-09-21
      • 2021-03-03
      • 1970-01-01
      相关资源
      最近更新 更多