2021-12-29 09:49:47 +00:00
|
|
|
// Licensed to the LF AI & Data foundation under one
|
|
|
|
// or more contributor license agreements. See the NOTICE file
|
|
|
|
// distributed with this work for additional information
|
|
|
|
// regarding copyright ownership. The ASF licenses this file
|
|
|
|
// to you under the Apache License, Version 2.0 (the
|
|
|
|
// "License"); you may not use this file except in compliance
|
2021-04-19 05:42:47 +00:00
|
|
|
// with the License. You may obtain a copy of the License at
|
|
|
|
//
|
2021-12-29 09:49:47 +00:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2021-04-19 05:42:47 +00:00
|
|
|
//
|
2021-12-29 09:49:47 +00:00
|
|
|
// 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-19 05:42:47 +00:00
|
|
|
|
2021-04-02 02:01:11 +00:00
|
|
|
package mqclient
|
2021-03-26 12:10:11 +00:00
|
|
|
|
2021-09-27 12:32:13 +00:00
|
|
|
// Client is the interface that provides operations of message queues
|
2021-03-26 12:10:11 +00:00
|
|
|
type Client interface {
|
2021-12-25 01:38:19 +00:00
|
|
|
// CreateReader creates a reader instance
|
2021-11-19 07:57:12 +00:00
|
|
|
CreateReader(options ReaderOptions) (Reader, error)
|
|
|
|
|
2021-12-02 14:38:23 +00:00
|
|
|
// CreateProducer creates a producer instance
|
2021-03-26 12:10:11 +00:00
|
|
|
CreateProducer(options ProducerOptions) (Producer, error)
|
|
|
|
|
2021-12-02 14:40:21 +00:00
|
|
|
// Subscribe creates a consumer instance and subscribe a topic
|
2021-03-26 12:10:11 +00:00
|
|
|
Subscribe(options ConsumerOptions) (Consumer, error)
|
|
|
|
|
|
|
|
// Get the earliest MessageID
|
|
|
|
EarliestMessageID() MessageID
|
|
|
|
|
|
|
|
// String to msg ID
|
|
|
|
StringToMsgID(string) (MessageID, error)
|
|
|
|
|
2021-10-20 02:52:35 +00:00
|
|
|
// Deserialize MessageId from a byte array
|
2021-03-27 01:46:54 +00:00
|
|
|
BytesToMsgID([]byte) (MessageID, error)
|
|
|
|
|
2021-03-26 12:10:11 +00:00
|
|
|
// Close the client and free associated resources
|
|
|
|
Close()
|
|
|
|
}
|