https://github.com/culturekings/webhook-to-amqp
  
  
    Log Webhook events in to a RabbitMQ Queue for worker processing - Unsupported as of April 2021 
    https://github.com/culturekings/webhook-to-amqp
  
        Last synced: 2 months ago 
        JSON representation
    
Log Webhook events in to a RabbitMQ Queue for worker processing - Unsupported as of April 2021
- Host: GitHub
- URL: https://github.com/culturekings/webhook-to-amqp
- Owner: culturekings
- License: apache-2.0
- Created: 2016-04-07T00:07:13.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-07T05:16:21.000Z (over 9 years ago)
- Last Synced: 2025-07-08T22:05:24.709Z (4 months ago)
- Language: Go
- Homepage:
- Size: 86.9 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
- 
            Metadata Files:
            - Readme: README.md
- License: LICENSE
 
Awesome Lists containing this project
README
          # Webhook to RabbitMQ / AMQP
This simple project logs webhook events in to a RabbitMQ queue. The benefit of this is to allow webhooks to be executed by a background task rather than syncronously. This allows webhooks to withstand application failure, allows webhooks to scale and allows the application to control processing speed. It is designed to work with Heroku and require no installation.
## Setup
1. Create app in Heroku
2. Deploy this repository
3. Set a ``AMQP_SERVER`` environmental variable in Heroku to point to your Queue Server
4. Optionally the queue routing key can be changed with a ``AMQP_ROUTING_KEY`` variable. The default is ``webhooks``
## Usage
The service is designed to handle any url, method, headers and body content input and log it against the queue task in a simple json format. An example is below
    {
      "Method": "GET",
      "Url": {
        "Scheme": "",
        "Opaque": "",
        "User": null,
        "Host": "",
        "Path": "\/what",
        "RawPath": "",
        "RawQuery": "",
        "Fragment": ""
      },
      "Headers": {
        "Accept": [
          "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8"
        ],
        "Accept-Encoding": [
          "gzip, deflate, sdch"
        ],
        "Accept-Language": [
          "en-US,en;q=0.8"
        ],
        "Cache-Control": [
          "max-age=0"
        ],
        "Connection": [
          "keep-alive"
        ],
        "Upgrade-Insecure-Requests": [
          "1"
        ],
        "User-Agent": [
          "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/49.0.2623.87 Safari\/537.36"
        ]
      },
      "Body": ""
    }
This allows workers to consume the queue and handle the allocation of each task to its relevant processor.