mirror of
https://github.com/fhmq/hmq.git
synced 2026-08-31 23:04:52 +00:00
upate plugin logic
This commit is contained in:
+8
-5
@@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user