For many of our customers, the webhooks they want to send start out as events flowing through internal message queues. We built our new agent, Bridge, to make adapting those pre-existing messages into webhooks as painless as possible.
Turning pre-existing messages into webhooks often means having to build something to pull messages off a queue, reshape them if needed, and finally send out a request to kick off delivery to your webhook subscribers.
Bridge simplifies integrating Svix Webhooks with your existing event-driven architecture, by bundling up queue consumers, transformations, and Svix API client calls into a single process.
With a small amount of configuration, you can start consuming events, reshaping, and sending webhooks in minutes. You tell it a queue to read from, how to optionally reshape the payload, and let Bridge take care of the rest.
Here's an example configuration, reading from RabbitMQ:
senders:
- name: 'send-from-rabbitmq-example'
input:
type: 'rabbitmq'
uri: ${RABBITMQ_URI}
queue_name: ${QUEUE_NAME}
transformation: |
function handler(input) {
return {
appId: input.key,
message: {
eventType: input.event_type,
payload: input.data
}
};
}
output:
type: 'svix'
token: ${SVIX_TOKEN}
In this example, we're subscribing to messages from a queue, making the payload conform to the expected shape, including the required fields:
appId
message.eventType
message.payload
Svix's
By using a JS transformation in Bridge, we remove the need to pre-process the data in yet another queue consumer running elsewhere. Instead, reshaping the data can be done inline.
Today, Bridge supports a short list of queue backends:
Our new library,
For more on Omniqueue, check out
Bridge can be a low-code option to conveniently start sending webhooks from the messages already flowing through your organization.
If you've got events flowing through a message queue and want to publish them as webhooks, give Bridge a try!
Sending webhooks is one place where using a message queue makes good sense, but so is consuming webhooks. Stay tuned for future posts on how Bridge can help streamline a set of best practices for receiving and handling webhooks.
For more content like this, make sure to follow us on
Also published here