Skip to content
This repository was archived by the owner on Feb 12, 2021. It is now read-only.

wealthsimple/goller

Repository files navigation

goller

CircleCI GoDoc

A Golang AWS SQS long poller.

Installation

go get github.com/wealthsimple/goller

Usage

import (
	"fmt"
	"github.com/wealthsimple/goller"
	"log"
	"os"
)

type testStruct struct {
	goller.Handler
}

func (t testStruct) Handle(message *string) {
	fmt.Printf("%+v\n", *message)
}

func main() {
	l := log.New(os.Stdout, "goller: ", log.Lshortfile|log.LstdFlags)
	config := goller.Configuration{
		WaitTimeSeconds:     20,
		VisibilityTimeout:   10,
		MaxNumberOfMessages: 1,
		Region:              "us-east-1",
		QueueURL:            os.Getenv("QUEUE_URL"),
		AccessKeyID:         os.Getenv("AWS_ACCESS_KEY_ID"),
		SecretKey:           os.Getenv("AWS_SECRET_KEY"),
	}

	t := new(testStruct)
	sqs := goller.NewSqsPoller(config, t, l)
	sqs.Poll()
}
  • See goller_integration_test.go for more details

About

An AWS SQS Queue poller for Go services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages