通过Go中的STOMP连接到ActiveMQ出错

我正在试图通过github.com/go-STOMP/STOMP库连接到AWS上的ActiveMQ实例。

以下代码引发了无效的命令错误:

func (s *STOMP) Init() error {
    netConn, err := stomp.Dial("tcp", "host:61614")
    if err != nil {
        return errors.Wrap(err, "dial to server")
    }

    s.conn = netConn

    return nil
}

AmazonMQ uses stomp+ssl proto, so the proper way to connect to it is to setup TLS connection on your own first:

func (s *STOMP) Init() error {
    netConn, err := tls.Dial("tcp", "host:61614", &tls.Config{})
    if err != nil {
        return errors.Wrap(err, "dial tls")
    }
    stompConn, err := stomp.Connect(netConn)
    if err != nil {
        return errors.Wrap(err, "dial to server")
    }

    s.conn = stompConn

    return nil
}

https://github.com/go-stomp/stomp/wiki/Connect-using-TLS