From 04d19d9088bc9a0803b6fa737ae0e7435fe7f506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 24 Sep 2021 11:08:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0redis=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- queue/message/abstract.go | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/queue/message/abstract.go b/queue/message/abstract.go index c7989b4..9b4754d 100644 --- a/queue/message/abstract.go +++ b/queue/message/abstract.go @@ -7,7 +7,9 @@ // Date : 2021-09-23 10:58 下午 package message -import "git.zhangdeman.cn/zhangdeman/gopkg/middleware/kafka" +import ( + "git.zhangdeman.cn/zhangdeman/gopkg/middleware/kafka" +) // IMessageQueue 消息队列的接口约束 // @@ -19,11 +21,23 @@ type IMessageQueue interface { Publish(data interface{}) error // Subscribe 订阅消息 Subscribe() - // Success 成功回调 - Success(data []byte) - // Fail 失败回调 - Fail(data []byte, err error) } // IKafkaMessageHandler 卡夫卡消息处理 type IKafkaMessageHandler kafka.IConsumeDataHandler + +// IRedisMessageHandler redis消息的处理 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 11:04 上午 2021/9/24 +type IRedisMessageHandler interface { + // Execute 处理数据 + Execute(data []byte) error + // Success 成功回调 + Success(data []byte) + // Fail 处理失败回调 + Fail(data []byte, err error) + // Exception 消费出现异常回调 + Exception(err error) +}