Ruby on rails 递归Webhook ID

Ruby on rails 递归Webhook ID,ruby-on-rails,webhooks,recurly,Ruby On Rails,Webhooks,Recurly,我试图防止在错误地重试Webhook时重复执行多次Webhook(例如:当构建超时,服务器偶尔超时时)。我在仪表板中看到Webhook有唯一的ID,但这些ID在消息哈希中似乎不可访问,我是否遗漏了什么?我使用Rails是为了它的价值 <?xml version="1.0" encoding="UTF-8"?> <updated_subscription_notification> <account> <account_code>1<

我试图防止在错误地重试Webhook时重复执行多次Webhook(例如:当构建超时,服务器偶尔超时时)。我在仪表板中看到Webhook有唯一的ID,但这些ID在消息哈希中似乎不可访问,我是否遗漏了什么?我使用Rails是为了它的价值

<?xml version="1.0" encoding="UTF-8"?>
<updated_subscription_notification>
  <account>
    <account_code>1</account_code>
    <username nil="true"></username>
    <email>verena@example.com</email>
    <first_name>Verena</first_name>
    <last_name>Example</last_name>
    <company_name nil="true"></company_name>
  </account>
  <subscription>
    <plan>
      <plan_code>1dpt</plan_code>
      <name>Subscription One</name>
    </plan>
    <uuid>292332928954ca62fa48048be5ac98ec</uuid>
    <state>active</state>
    <quantity type="integer">1</quantity>
    <total_amount_in_cents type="integer">200</total_amount_in_cents>
    <activated_at type="datetime">2010-09-23T22:12:39Z</activated_at>
    <canceled_at nil="true" type="datetime"></canceled_at>
    <expires_at nil="true" type="datetime"></expires_at>
    <current_period_started_at type="datetime">2010-09-23T22:03:30Z</current_period_started_at>
    <current_period_ends_at type="datetime">2010-09-24T22:03:30Z</current_period_ends_at>
    <trial_started_at nil="true" type="datetime">
    </trial_started_at>
    <trial_ends_at nil="true" type="datetime">
    </trial_ends_at>
    <collection_method>automatic</collection_method>
  </subscription>
</updated_subscription_notification>

1.
verena@example.com
维雷纳
例子
1dpt
订阅一
292332928954ca62fa48048be5ac98ec
积极的
1.
200
2010-09-23T22:12:39Z
2010-09-23T22:03:30Z
2010-09-24T22:03:30Z
自动的

webhook可能会多次失效,但是一旦服务器接收到成功的状态代码,就会再次停止尝试重新发送该通知。因此,每个事件只传递一个webhook。此外,webhook ID不包括在消息哈希中,它们只在UI中找到。

不幸的是,阻止webhook重新发送的唯一方法是在5秒钟内回复200状态代码。()

当时是30秒,但我想2015年11月改变了

无论如何,我解决了这个问题,将消息放到队列中,并立即响应200个响应