Almost kinda there...

This commit is contained in:
Dan Buch 2012-11-14 22:27:46 -05:00
parent 1991c87ba9
commit f1c4f20058

View File

@ -26,8 +26,29 @@ func main() {
log.Fatal("Failed to declare exchange!: ", err)
}
_, err = channel.QueueDeclare("hello-queue", true, false, false, false, nil)
if err != nil {
log.Fatal("Failed to declare queue!: ", err)
}
err = channel.QueueBind("hello-queue", "hola", "hello-exchange", false, nil)
if err != nil {
log.Fatal("Failed to bind to queue!: ", err)
}
hellos, err := channel.Consume("hello-queue", "hello-consumer", false, false, false, false, nil)
if err != nil {
log.Fatal("Failed to start consuming!:", err)
}
quit := make(chan bool)
go func() {
for hello := range hellos {
log.Println("hello ->", hello)
hello.Ack(false)
}
}()
<-quit
}