func HandleCrawl(message *consumer.Message) { var crawlMessage struct { Host string } err := message.ReadJson(&crawlMessage) if err != nil { log.Printf("Error decoding json msg: %v\n", err) message.GiveUp() return } log.Printf("new msg: %s\n", crawlMessage.Host) message.Success() }
func HandleTest(msg *consumer.Message) { t := &time.Time{} t.UnmarshalBinary(msg.Body) fmt.Printf("Consume latency: %s\n", time.Since(*t)) msg.Success() }