func (this *ActiveMQ) Subscribe(destination string, handler func(err error, msg string)) error {

	conn, err := this.Connect()
	if err != nil {
		return err
	}
	sub, err := conn.Subscribe(destination, stomp.AckAuto)
	if err != nil {
		return err
	}
	defer conn.Disconnect()
	defer sub.Unsubscribe()
	for {
		m := <-sub.C
		handler(m.Err, string(m.Body))
	}
	return err
}
// Subscribe Message from destination
// func handler handle msg reveived from destination
Subscribe Message from destination
func handler handle msg reveived from destination
// Subscribe Message from destination // func handler handle msg reveived from destination
func (this *ActiveMQ) Subscribe(destination string, handler func(err error, msg string)) error {
	conn, err := this.Connect()
	if err != nil {
		return err
	}
	sub, err := conn.Subscribe(destination, stomp.AckAuto)
	if err != nil {
		return err
	}
	defer conn.Disconnect()
	defer sub.Unsubscribe()
	for {
		m := <-sub.C
		handler(m.Err, string(m.Body))
	}
	return err
}
func ( this * ActiveMQ ) Subscribe ( destination string , handler func ( err error , msg string ) ) error { conn , err := this . Connect ( ) if err != nil { return err } sub , err := conn . Subscribe ( destination , stomp . AckAuto ) if err != nil { return err } defer conn . Disconnect ( ) defer sub . Unsubscribe ( ) for { m := <- sub . C handler ( m . Err , string ( m . Body ) ) } return err }
Subscribe Message from destination
func handler handle msg reveived from destination
Subscribe Message from destination func handler handle msg reveived from destination