2021-04-19 13:42:47 +08:00
|
|
|
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
|
|
|
// with the License. You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
|
|
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
|
|
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
|
|
|
2021-04-02 10:01:11 +08:00
|
|
|
package mqclient
|
2021-03-26 20:10:11 +08:00
|
|
|
|
2021-09-27 20:32:13 +08:00
|
|
|
// Client is the interface that provides operations of message queues
|
2021-03-26 20:10:11 +08:00
|
|
|
type Client interface {
|
2021-12-02 22:36:31 +08:00
|
|
|
// CreateReader creates a producer instance
|
2021-11-19 15:57:12 +08:00
|
|
|
CreateReader(options ReaderOptions) (Reader, error)
|
|
|
|
|
2021-12-02 22:38:23 +08:00
|
|
|
// CreateProducer creates a producer instance
|
2021-03-26 20:10:11 +08:00
|
|
|
CreateProducer(options ProducerOptions) (Producer, error)
|
|
|
|
|
2021-12-02 22:40:21 +08:00
|
|
|
// Subscribe creates a consumer instance and subscribe a topic
|
2021-03-26 20:10:11 +08:00
|
|
|
Subscribe(options ConsumerOptions) (Consumer, error)
|
|
|
|
|
|
|
|
// Get the earliest MessageID
|
|
|
|
EarliestMessageID() MessageID
|
|
|
|
|
|
|
|
// String to msg ID
|
|
|
|
StringToMsgID(string) (MessageID, error)
|
|
|
|
|
2021-10-20 10:52:35 +08:00
|
|
|
// Deserialize MessageId from a byte array
|
2021-03-27 09:46:54 +08:00
|
|
|
BytesToMsgID([]byte) (MessageID, error)
|
|
|
|
|
2021-03-26 20:10:11 +08:00
|
|
|
// Close the client and free associated resources
|
|
|
|
Close()
|
|
|
|
}
|