Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

Delayd


This repository is a fork of goinstant/delayd
aiming to support SQS and docker.

We are working on SQS and docker support.

Delayd is an available setTimeout() service for scheduling message sends.

Delayd can send and receive messages over AMQP,
with more transports planned.

To ensure availability, Delayd is clustered via
raft. You should run at least 3 Delayd
servers. This permits the cluster to keep running if one server fails.

Usage

$ docker run -it --rm nabeken/delayd delayd -h
NAME:
   delayd - available setTimeout()

USAGE:
   delayd [global options] command [command options] [arguments...]

VERSION:


COMMANDS:
   server, serv    Spawn a Delayd Server
   help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h        show help
   --version, -v    print the version

Guarantees

Delayd ensures that after a message has been received, it will be delivered at
least once. A message that has reached its delay time may be delivered more
than once if the cluster leader fails after emitting the message, but before
this state has replicated to the other cluster members.

AMQP

Message Format

Message bodies are forwarded unchanged from received messages after their delay
lapses. All Delayd directives are taken from AMQP headers.

Required Headers

  • delayd-delay (number) Delay time in ms before emitting this message.
  • delayd-target (string) Target exchange for this message.

Optional Headers

  • delayd-key (string) If a message with the same key exists in Delayd,
    this message will replace it.

SQS

Message Format

Message bodies are forwarded unchanged from received messages after their delay
lapses. All Delayd directives are taken from
SQS Message Attributes.

Required Message Attributes

  • delayd-delay (String) Delay time in ms before emitting this message.
  • delayd-target (string) Target exchange for this message.

Please note that delayd-delay is String not Number due to a limitation in SQS implementation in Go.

Optional Message Attributes

  • delayd-key (string) If a message with the same key exists in Delayd,
    this message will replace it.

Integration Tests against SQS

You need at least two SQS queue for delayd and target queue and make sure that queues exists.

$ vi delayd.toml
[sqs]
region = "ap-northeast-1"
queue = "delayd"
max_number_messages = 10
visibility_timeout = 10

$ export DELAYD_TARGET_SQS=delayd-target
$ make testsqs

Development

delayd is built/developed with go1.3.

To get started:

make deps  # install required modules
make check # run fmt, vet, lint
make test  # run unit tests
make       # build the executable

License (Docker and SQS support)

© 2014 Ken-ichi TANABE. Licensed under the same terms as the original work.

License (original work)

© 2014 salesforce.com. Licensed under the BSD 3-clause license.

Docker Pull Command
Owner
nabeken
Source Repository