Skip to content

Instantly share code, notes, and snippets.

@Solution
Created December 9, 2018 13:11
Show Gist options
  • Save Solution/0d363f70ac3bc1e5ad49b797432e7a9f to your computer and use it in GitHub Desktop.
Save Solution/0d363f70ac3bc1e5ad49b797432e7a9f to your computer and use it in GitHub Desktop.
consumer definition
func() {
// create consumer
c := consumer.NewConsumer(q, facade)
ch, _ := amqpSession.GetConnection().Channel()
interruptor := grupttor.NewGrupttor(
handlers.NewAmqpHandler(
ch,
q.GetTag(),
),
[]grupttor.Hook{hooks.NewSystemInterruptHook([]os.Signal{syscall.SIGTERM})},
)
go interruptor.StartAndWait()
// start consuming messages
q.Consume(c.Consume(interruptor), 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment