Exemplo n.º 1
0
func main() {
	max_count := 30000
	common.NsqConsumer("test_topic1", "test_channel", handle{})

	m := &Msg{}
	for i := 0; i < max_count; i++ {
		m.Id = int64(1000000 + i)
		m.Start_time = time.Now().Unix()
		common.NsqPublish("test_topic2", m.pack())
		time.Sleep(time.Millisecond)
	}

	fmt.Println("finish")
	select {}
}
Exemplo n.º 2
0
func main() {
	common.NsqConsumer("test_topic2", "test_channel", handle{})
	//common.NsqConsumer("test_topic2", "test_channel", handle{})
	//common.NsqConsumer("test_topic2", "test_channel", handle{})
	select {}
}