diff --git a/src/constant/strings/service.go b/src/constant/strings/service.go index 9f3c1a5..f2a055f 100644 --- a/src/constant/strings/service.go +++ b/src/constant/strings/service.go @@ -13,5 +13,5 @@ const ( VideoCommentEvent = "video.comment.action" VideoPublishEvent = "video.publish.action" - MessageActionEvent = "message_send" + MessageActionEvent = "message.send" ) diff --git a/src/services/message/handler.go b/src/services/message/handler.go index bff6730..70090ad 100644 --- a/src/services/message/handler.go +++ b/src/services/message/handler.go @@ -65,7 +65,7 @@ func (c MessageServiceImpl) New() { failOnError(err, "Failed to open a channel") } - channel.ExchangeDeclare( + err = channel.ExchangeDeclare( strings.MessageExchange, "x-delayed-message", true, false, false, false, @@ -73,6 +73,9 @@ func (c MessageServiceImpl) New() { "x-delayed-type": "direct", }, ) + if err != nil { + failOnError(err, "Failed to get exchange") + } _, err = channel.QueueDeclare( strings.MessageActionEvent,