upate plugin logic

This commit is contained in:
joy.zhou
2019-08-16 17:59:15 +08:00
parent e8ceea87b4
commit 93c02b0ea9
41 changed files with 429 additions and 890 deletions
+8 -5
View File
@@ -1,12 +1,15 @@
package broker
import (
"github.com/fhmq/hmq/plugins"
"github.com/fhmq/hmq/plugins/kafka"
"github.com/fhmq/hmq/plugins/bridge"
"go.uber.org/zap"
)
func (b *Broker) Publish(e *plugins.Elements) {
if b.pluginKafka {
kafka.Publish(e)
func (b *Broker) Publish(e *bridge.Elements) {
if b.BridgeMQ != nil {
err := b.BridgeMQ.Publish(e)
if err != nil {
log.Error("send message to mq error.", zap.Error(err))
}
}
}