mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-28 22:45:26 +08:00
This PR implements a new CDC service for Milvus 2.6, providing log-based cross-cluster replication. issue: https://github.com/milvus-io/milvus/issues/44123 --------- Signed-off-by: bigsheeper <yihao.dai@zilliz.com> Signed-off-by: chyezh <chyezh@outlook.com> Co-authored-by: chyezh <chyezh@outlook.com>
38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
package rmq
|
|
|
|
import (
|
|
"github.com/milvus-io/milvus/pkg/v2/mq/mqimpl/rocksmq/client"
|
|
"github.com/milvus-io/milvus/pkg/v2/mq/mqimpl/rocksmq/server"
|
|
"github.com/milvus-io/milvus/pkg/v2/streaming/util/message"
|
|
"github.com/milvus-io/milvus/pkg/v2/streaming/walimpls"
|
|
"github.com/milvus-io/milvus/pkg/v2/streaming/walimpls/registry"
|
|
)
|
|
|
|
func init() {
|
|
// register the builder to the registry.
|
|
registry.RegisterBuilder(&builderImpl{})
|
|
// register the unmarshaler to the message registry.
|
|
message.RegisterMessageIDUnmsarshaler(message.WALNameRocksmq, UnmarshalMessageID)
|
|
}
|
|
|
|
// builderImpl is the builder for rmq opener.
|
|
type builderImpl struct{}
|
|
|
|
// Name of the wal builder, should be a lowercase string.
|
|
func (b *builderImpl) Name() message.WALName {
|
|
return message.WALNameRocksmq
|
|
}
|
|
|
|
// Build build a wal instance.
|
|
func (b *builderImpl) Build() (walimpls.OpenerImpls, error) {
|
|
c, err := client.NewClient(client.Options{
|
|
Server: server.Rmq,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &openerImpl{
|
|
c: c,
|
|
}, nil
|
|
}
|