rabbitmq rpc 消息格式及调用封装
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
546 B

package rabbitmqrpc
const DES_KEY = "mqbitrab"
type MsgBody struct {
Exchange string
Key string
Data string
}
type DelayMsgBody struct {
Exchange string
Key string
Data string
Delay int
}
type MsgSend struct {
Result string
}
func rpc_server_conn(url ...string) (*RabbitmqServiceClient, error) {
var wx_rpc_url string = "127.0.0.1:7955"
if len(url) > 0 && url[0] != "" {
wx_rpc_url = url[0]
}
conn, _, err := DialRabbitmqService("tcp", wx_rpc_url)
if err != nil {
return nil, err
}
return conn, nil
}