sarama.go 683 字节
package sarama

import (
	"github.com/Shopify/sarama"
	saramaConsumer "github.com/linmadan/egglib-go/mom/kafka/sarama"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant"
	. "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
	// "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/sarama/messageHandler"
)

func Run() {
	messageHandlerMap := make(map[string]func(message *sarama.ConsumerMessage) error)
	//messageHandlerMap[constant.PUSH_MESSAGE_COMMAND] = messageHandler.PushMessageCommandHandler
	saramaConsumer.StartConsume(constant.KAFKA_HOSTS, constant.SERVICE_NAME, messageHandlerMap, Logger)
}