Fix the rest of the code

This commit is contained in:
Asim
2015-12-23 19:16:55 +00:00
parent 02aca819d7
commit 536216fd01
2 changed files with 9 additions and 6 deletions

View File

@@ -33,8 +33,9 @@ func pub() {
}
func sub() {
_, err := broker.Subscribe(topic, func(msg *broker.Message) {
fmt.Println("[sub] received message:", string(msg.Body), "header", msg.Header)
_, err := broker.Subscribe(topic, func(p broker.Publication) error {
fmt.Println("[sub] received message:", string(p.Message().Body), "header", p.Message().Header)
return nil
})
if err != nil {
fmt.Println(err)