27 lines
408 B
Go
27 lines
408 B
Go
package messaging
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.fjla.uk/owlboard/mq-client/log"
|
|
|
|
"github.com/go-stomp/stomp/v3"
|
|
)
|
|
|
|
func Listen() {
|
|
sub, err := client.Subscribe("/topic/VSTP_ALL", stomp.AckAuto)
|
|
if err != nil {
|
|
log.Msg.Fatal("Unable to start subscription: " + err.Error())
|
|
}
|
|
|
|
msg := <-sub.C
|
|
if msg.Err != nil {
|
|
fmt.Println(msg.Err)
|
|
}
|
|
handle(msg)
|
|
}
|
|
|
|
func handle(msg *stomp.Message) {
|
|
fmt.Println(msg)
|
|
}
|