|
@@ -30,6 +30,12 @@ func HandlerEventNotify(svcCtx *svc.ServiceContext) error {
|
|
func toMQ(queue *redis.Client, info eventInfo) {
|
|
func toMQ(queue *redis.Client, info eventInfo) {
|
|
channel := fmt.Sprintf(EVTNE_NOTIFY_KEY_FORMAT, info.ProjectId, info.EventName)
|
|
channel := fmt.Sprintf(EVTNE_NOTIFY_KEY_FORMAT, info.ProjectId, info.EventName)
|
|
if bs, err := json.Marshal(info); err == nil {
|
|
if bs, err := json.Marshal(info); err == nil {
|
|
|
|
+ //queue.XAdd(context.Background(), &redis.XAddArgs{
|
|
|
|
+ // Stream: channel,
|
|
|
|
+ // MaxLen: 5000,
|
|
|
|
+ // Values: ``,
|
|
|
|
+ //})
|
|
|
|
+
|
|
if intCmd := queue.Publish(context.Background(), channel, string(bs)); intCmd == nil {
|
|
if intCmd := queue.Publish(context.Background(), channel, string(bs)); intCmd == nil {
|
|
logx.Errorf("handlerEvent queue.Publish toMQ error: %s %+v", channel, info)
|
|
logx.Errorf("handlerEvent queue.Publish toMQ error: %s %+v", channel, info)
|
|
}
|
|
}
|