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.
26 lines
552 B
26 lines
552 B
2 years ago
|
package channel
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"git.oa00.com/supply-chain/service/client"
|
||
|
"github.com/smallnest/rpcx/share"
|
||
|
)
|
||
|
|
||
|
type mq struct {
|
||
|
}
|
||
|
|
||
|
type ArgsMqSubscribe struct {
|
||
|
Name string // 队列名称
|
||
|
}
|
||
|
|
||
|
// Subscribe @Title 订阅mq
|
||
|
func (m *mq) Subscribe(ctx context.Context, channelId string, args ArgsMqSubscribe) (err error) {
|
||
|
reply := 0
|
||
|
xClient, err := client.GetClient(m)
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Subscribe", args, &reply)
|
||
|
return
|
||
|
}
|