milvus/internal/mq/msgstream/mq_factory.go
chyezh f97127ae55
add nats mq wrappers (#24445)
bug fixup, configurable natsmq, add unittest, pass e2e.



move natsmq to pkg project

Signed-off-by: chyezh <ye.zhen@zilliz.com>
Co-authored-by: yiwangdr <yiwangdr@gmail.com>
2023-06-07 10:00:37 +08:00

25 lines
773 B
Go

package msgstream
import (
"github.com/milvus-io/milvus/internal/mq/mqimpl/rocksmq/server"
"github.com/milvus-io/milvus/internal/mq/msgstream/mqwrapper/rmq"
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/mq/msgstream"
"go.uber.org/zap"
)
// NewRocksmqFactory creates a new message stream factory based on rocksmq.
func NewRocksmqFactory(path string) msgstream.Factory {
if err := server.InitRocksMQ(path); err != nil {
log.Fatal("fail to init rocksmq", zap.Error(err))
}
log.Info("init rocksmq msgstream success", zap.String("path", path))
return &msgstream.CommonFactory{
Newer: rmq.NewClientWithDefaultOptions,
DispatcherFactory: msgstream.ProtoUDFactory{},
ReceiveBufSize: 1024,
MQBufSize: 1024,
}
}