I am using stompngo client library to connect and subscribe from a topic in ActiveMQ published as STOMP. I don't see a provision to mention the Destination as TOPIC and it seems that by default the subscription is registered in ActiveMQ as a QUEUE. Is there any specific step required to point to a TOPIC in specific?
func subscribe() { netconn, err := net.Dial("tcp", "localhost:61613")
check(err)
h := stompngo.Headers{stompngo.HK_ACCEPT_VERSION, "1.1",
stompngo.HK_HOST, "localhost"}
conn, err := stompngo.Connect(netconn, h)
check(err)
subHead := stompngo.Headers{stompngo.HK_DESTINATION, "MY_TOPIC"}
sub, err := conn.Subscribe(subHead)
check(err)
for {
msg := <-sub
log.Println("Message : ", msg.Message.BodyString())
}
}