producer.go 500 字节
package message

import (
	"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/message/kafkax"
	"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/message/models"
)

// 消息发布器
// options["kafkaHosts"]="localhost:9092"
// options["timeInterval"]=time.Second*60*5
func NewMessageProducer(messageRepository models.MessageRepository, options map[string]interface{}) *kafkax.MessageDirector {
	dispatcher := kafkax.NewMessageDirector(messageRepository, options)
	return dispatcher
}