main-fillx-fillmolnx

Dispatch

Easily schedule application messages to be delivered at a specific time in the future. Deliver messages to your custom Webhooks, Amazon SQS and SNS.

Introduction

Dispatch is a service that allows you to schedule a message to be delivered at a specific time in the future. It enables you to easily power your asynchronous processes without investing in a more heavy-weight workflow engine.

Dispatch currently supports delivering messages to custom webhooks, as well as integrating with cloud messaging systems you might already be using.

Supported delivery targets

Usage example

The code listings below show an example message being scheduled and delivered to pre-configured webhook target.

$ curl -X POST https://api.dispatch.molnx.com/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN
An OAuth 2 access token gotten from our authentication service. Read more about authentication at ...
" \
-d '
{
"targetId": "DI-T-aabbcc1122
The ID of the target the message will be delivered to.
",
"deliveryTime": "2020-07-01T12:34:00Z
An ISO 8601 compatible date and time string.
",
"payload": "Hello, World!
The payload may be any JSON embeddable string
"
}
'
Using cURL to schedule a message
POST /my-target-endpoint
The URL path as configured in the target.
Content-Type: application/json
{
"messageId": "DI-M-11111111-2222-3333-4444-555555555555
The ID of the message being delivered.
",
"targetId": "DI-T-aabbcc1122
The ID of the target being delivered to.
",
"originalDeliveryTime": "2020-07-01T12:34:00Z
The delivery time as specified in the scheduling request. An ISO 8601 date and time string.
",
"deliveryTime": "2020-07-01T12:34:56Z
The actual time when the delivery was made. An ISO 8601 date and time string.
",
"payload": "Hello, World!
The payload as specified in the scheduling request
"
}
An HTTP request being made to a Webhook

Use Cases

User onboarding

You could use Dispatch to schedule an application message to be delivered a certain amount of time after a user signs up for your application. Upon receiving this message your application could trigger an email to be sent to the user.

Calendar event reminders

It can be important to remind calendar users ahead of their events so that they don't arrive late. You can accomplish this easily be scheduling a message using Dispatch whenever a user RSVP's to an event. When your application receives the message it checks the reminder status and sends a push notification if it is still relevant.

Abort long-running processes

You might be integrating with another service or API that takes a very long time to finish an asynchronous operation, perhaps booking some real physical resource like a hotel room or rental car. Sometimes the service might not respond at all and you need the process to abort.

One approach might be the store the state of each process and continually poll their status. A better approach is to schedule a timeout message using Dispatch and cancel the process upon delivery.

Pricing

Dispatch is priced per each scheduled message. One message costs $0.0001 USD, or $1 USD for 10,000 messages.

There is a permanent free tier that discounts the first 1000 messages each month.

Pricing examples

  • 1 message per minute on average each month =
      60 * 24 * 31 = 44,640 messages (31 day month)
    1000 (free tier) = 43,640
    $0.0001 = $0.64 USD/month
    $4.36 USD/month
  • 10 messages per hour on average each month =
      10 * 24 * 31 = 7,440 messages (31 day month)
    1000 (free tier) = 6,440
    $0.0001 = $0.64 USD/month
    $0.64 USD/month

Documentation

Service documentation

Reference documentation