Created
December 9, 2018 13:11
-
-
Save Solution/0d363f70ac3bc1e5ad49b797432e7a9f to your computer and use it in GitHub Desktop.
consumer definition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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