rocketmq-client-nodejs-bate 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +186 -0
- package/dist/client/BaseClient.d.ts +95 -0
- package/dist/client/BaseClient.js +324 -0
- package/dist/client/ClientId.d.ts +24 -0
- package/dist/client/ClientId.js +33 -0
- package/dist/client/Logger.d.ts +25 -0
- package/dist/client/Logger.js +33 -0
- package/dist/client/RpcClient.d.ts +48 -0
- package/dist/client/RpcClient.js +219 -0
- package/dist/client/RpcClientManager.d.ts +42 -0
- package/dist/client/RpcClientManager.js +144 -0
- package/dist/client/SessionCredentials.d.ts +21 -0
- package/dist/client/SessionCredentials.js +19 -0
- package/dist/client/Settings.d.ts +31 -0
- package/dist/client/Settings.js +40 -0
- package/dist/client/TelemetrySession.d.ts +27 -0
- package/dist/client/TelemetrySession.js +110 -0
- package/dist/client/UserAgent.d.ts +25 -0
- package/dist/client/UserAgent.js +47 -0
- package/dist/client/index.d.ts +26 -0
- package/dist/client/index.js +43 -0
- package/dist/consumer/Assignment.d.ts +23 -0
- package/dist/consumer/Assignment.js +40 -0
- package/dist/consumer/Assignments.d.ts +24 -0
- package/dist/consumer/Assignments.js +47 -0
- package/dist/consumer/ConsumeResult.d.ts +20 -0
- package/dist/consumer/ConsumeResult.js +25 -0
- package/dist/consumer/ConsumeService.d.ts +28 -0
- package/dist/consumer/ConsumeService.js +49 -0
- package/dist/consumer/ConsumeTask.d.ts +24 -0
- package/dist/consumer/ConsumeTask.js +40 -0
- package/dist/consumer/Consumer.d.ts +38 -0
- package/dist/consumer/Consumer.js +111 -0
- package/dist/consumer/FifoConsumeService.d.ts +25 -0
- package/dist/consumer/FifoConsumeService.js +123 -0
- package/dist/consumer/FilterExpression.d.ts +25 -0
- package/dist/consumer/FilterExpression.js +40 -0
- package/dist/consumer/MessageListener.d.ts +21 -0
- package/dist/consumer/MessageListener.js +19 -0
- package/dist/consumer/ProcessQueue.d.ts +39 -0
- package/dist/consumer/ProcessQueue.js +286 -0
- package/dist/consumer/PushConsumer.d.ts +68 -0
- package/dist/consumer/PushConsumer.js +377 -0
- package/dist/consumer/PushSubscriptionSettings.d.ts +31 -0
- package/dist/consumer/PushSubscriptionSettings.js +97 -0
- package/dist/consumer/SimpleConsumer.d.ts +50 -0
- package/dist/consumer/SimpleConsumer.js +122 -0
- package/dist/consumer/SimpleSubscriptionSettings.d.ts +28 -0
- package/dist/consumer/SimpleSubscriptionSettings.js +57 -0
- package/dist/consumer/StandardConsumeService.d.ts +24 -0
- package/dist/consumer/StandardConsumeService.js +42 -0
- package/dist/consumer/SubscriptionLoadBalancer.d.ts +23 -0
- package/dist/consumer/SubscriptionLoadBalancer.js +46 -0
- package/dist/consumer/index.d.ts +32 -0
- package/dist/consumer/index.js +49 -0
- package/dist/exception/BadRequestException.d.ts +20 -0
- package/dist/exception/BadRequestException.js +28 -0
- package/dist/exception/ClientException.d.ts +20 -0
- package/dist/exception/ClientException.js +31 -0
- package/dist/exception/ForbiddenException.d.ts +20 -0
- package/dist/exception/ForbiddenException.js +28 -0
- package/dist/exception/InternalErrorException.d.ts +20 -0
- package/dist/exception/InternalErrorException.js +28 -0
- package/dist/exception/NotFoundException.d.ts +20 -0
- package/dist/exception/NotFoundException.js +28 -0
- package/dist/exception/PayloadTooLargeException.d.ts +20 -0
- package/dist/exception/PayloadTooLargeException.js +28 -0
- package/dist/exception/PaymentRequiredException.d.ts +20 -0
- package/dist/exception/PaymentRequiredException.js +28 -0
- package/dist/exception/ProxyTimeoutException.d.ts +20 -0
- package/dist/exception/ProxyTimeoutException.js +28 -0
- package/dist/exception/RequestHeaderFieldsTooLargeException.d.ts +20 -0
- package/dist/exception/RequestHeaderFieldsTooLargeException.js +28 -0
- package/dist/exception/StatusChecker.d.ts +20 -0
- package/dist/exception/StatusChecker.js +98 -0
- package/dist/exception/TooManyRequestsException.d.ts +20 -0
- package/dist/exception/TooManyRequestsException.js +28 -0
- package/dist/exception/UnauthorizedException.d.ts +20 -0
- package/dist/exception/UnauthorizedException.js +28 -0
- package/dist/exception/UnsupportedException.d.ts +20 -0
- package/dist/exception/UnsupportedException.js +28 -0
- package/dist/exception/index.d.ts +29 -0
- package/dist/exception/index.js +46 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +39 -0
- package/dist/message/Message.d.ts +38 -0
- package/dist/message/Message.js +57 -0
- package/dist/message/MessageId.d.ts +59 -0
- package/dist/message/MessageId.js +123 -0
- package/dist/message/MessageView.d.ts +38 -0
- package/dist/message/MessageView.js +90 -0
- package/dist/message/PublishingMessage.d.ts +30 -0
- package/dist/message/PublishingMessage.js +100 -0
- package/dist/message/index.d.ts +20 -0
- package/dist/message/index.js +37 -0
- package/dist/producer/Producer.d.ts +55 -0
- package/dist/producer/Producer.js +318 -0
- package/dist/producer/PublishingLoadBalancer.d.ts +24 -0
- package/dist/producer/PublishingLoadBalancer.js +82 -0
- package/dist/producer/PublishingSettings.d.ts +28 -0
- package/dist/producer/PublishingSettings.js +70 -0
- package/dist/producer/RecallReceipt.d.ts +25 -0
- package/dist/producer/RecallReceipt.js +34 -0
- package/dist/producer/SendReceipt.d.ts +29 -0
- package/dist/producer/SendReceipt.js +60 -0
- package/dist/producer/Transaction.d.ts +28 -0
- package/dist/producer/Transaction.js +70 -0
- package/dist/producer/TransactionChecker.d.ts +21 -0
- package/dist/producer/TransactionChecker.js +19 -0
- package/dist/producer/index.d.ts +22 -0
- package/dist/producer/index.js +40 -0
- package/dist/retry/ExponentialBackoffRetryPolicy.d.ts +27 -0
- package/dist/retry/ExponentialBackoffRetryPolicy.js +64 -0
- package/dist/retry/RetryPolicy.d.ts +46 -0
- package/dist/retry/RetryPolicy.js +19 -0
- package/dist/retry/index.d.ts +18 -0
- package/dist/retry/index.js +35 -0
- package/dist/route/Broker.d.ts +25 -0
- package/dist/route/Broker.js +40 -0
- package/dist/route/Endpoints.d.ts +30 -0
- package/dist/route/Endpoints.js +71 -0
- package/dist/route/MessageQueue.d.ts +27 -0
- package/dist/route/MessageQueue.js +47 -0
- package/dist/route/TopicRouteData.d.ts +24 -0
- package/dist/route/TopicRouteData.js +37 -0
- package/dist/route/index.d.ts +20 -0
- package/dist/route/index.js +37 -0
- package/dist/util/index.d.ts +35 -0
- package/dist/util/index.js +88 -0
- package/package.json +62 -0
- package/proto/apache/rocketmq/v2/admin.proto +43 -0
- package/proto/apache/rocketmq/v2/admin_grpc_pb.d.ts +41 -0
- package/proto/apache/rocketmq/v2/admin_grpc_pb.js +60 -0
- package/proto/apache/rocketmq/v2/admin_pb.d.ts +56 -0
- package/proto/apache/rocketmq/v2/admin_pb.js +340 -0
- package/proto/apache/rocketmq/v2/definition.proto +570 -0
- package/proto/apache/rocketmq/v2/definition_grpc_pb.js +1 -0
- package/proto/apache/rocketmq/v2/definition_pb.d.ts +885 -0
- package/proto/apache/rocketmq/v2/definition_pb.js +6141 -0
- package/proto/apache/rocketmq/v2/service.proto +443 -0
- package/proto/apache/rocketmq/v2/service_grpc_pb.d.ts +294 -0
- package/proto/apache/rocketmq/v2/service_grpc_pb.js +637 -0
- package/proto/apache/rocketmq/v2/service_pb.d.ts +1249 -0
- package/proto/apache/rocketmq/v2/service_pb.js +9723 -0
- package/src/client/BaseClient.ts +404 -0
- package/src/client/ClientId.ts +31 -0
- package/src/client/Logger.ts +36 -0
- package/src/client/RpcClient.ts +258 -0
- package/src/client/RpcClientManager.ts +180 -0
- package/src/client/SessionCredentials.ts +22 -0
- package/src/client/Settings.ts +46 -0
- package/src/client/TelemetrySession.ts +130 -0
- package/src/client/UserAgent.ts +45 -0
- package/src/client/index.ts +27 -0
- package/src/consumer/Assignment.ts +39 -0
- package/src/consumer/Assignments.ts +46 -0
- package/src/consumer/ConsumeResult.ts +21 -0
- package/src/consumer/ConsumeService.ts +54 -0
- package/src/consumer/ConsumeTask.ts +40 -0
- package/src/consumer/Consumer.ts +129 -0
- package/src/consumer/FifoConsumeService.ts +136 -0
- package/src/consumer/FilterExpression.ts +42 -0
- package/src/consumer/MessageListener.ts +23 -0
- package/src/consumer/ProcessQueue.ts +326 -0
- package/src/consumer/PushConsumer.ts +473 -0
- package/src/consumer/PushSubscriptionSettings.ts +123 -0
- package/src/consumer/SimpleConsumer.ts +153 -0
- package/src/consumer/SimpleSubscriptionSettings.ts +64 -0
- package/src/consumer/StandardConsumeService.ts +44 -0
- package/src/consumer/SubscriptionLoadBalancer.ts +47 -0
- package/src/consumer/index.ts +33 -0
- package/src/exception/BadRequestException.ts +25 -0
- package/src/exception/ClientException.ts +29 -0
- package/src/exception/ForbiddenException.ts +25 -0
- package/src/exception/InternalErrorException.ts +25 -0
- package/src/exception/NotFoundException.ts +25 -0
- package/src/exception/PayloadTooLargeException.ts +25 -0
- package/src/exception/PaymentRequiredException.ts +25 -0
- package/src/exception/ProxyTimeoutException.ts +25 -0
- package/src/exception/RequestHeaderFieldsTooLargeException.ts +25 -0
- package/src/exception/StatusChecker.ts +94 -0
- package/src/exception/TooManyRequestsException.ts +25 -0
- package/src/exception/UnauthorizedException.ts +25 -0
- package/src/exception/UnsupportedException.ts +25 -0
- package/src/exception/index.ts +30 -0
- package/src/index.ts +23 -0
- package/src/message/Message.ts +67 -0
- package/src/message/MessageId.ts +123 -0
- package/src/message/MessageView.ts +94 -0
- package/src/message/PublishingMessage.ts +104 -0
- package/src/message/index.ts +21 -0
- package/src/producer/Producer.ts +388 -0
- package/src/producer/PublishingLoadBalancer.ts +85 -0
- package/src/producer/PublishingSettings.ts +78 -0
- package/src/producer/RecallReceipt.ts +32 -0
- package/src/producer/SendReceipt.ts +63 -0
- package/src/producer/Transaction.ts +86 -0
- package/src/producer/TransactionChecker.ts +23 -0
- package/src/producer/index.ts +24 -0
- package/src/retry/ExponentialBackoffRetryPolicy.ts +76 -0
- package/src/retry/RetryPolicy.ts +51 -0
- package/src/retry/index.ts +19 -0
- package/src/route/Broker.ts +39 -0
- package/src/route/Endpoints.ts +70 -0
- package/src/route/MessageQueue.ts +49 -0
- package/src/route/TopicRouteData.ts +38 -0
- package/src/route/index.ts +21 -0
- package/src/util/index.ts +83 -0
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
// Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
// contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
// this work for additional information regarding copyright ownership.
|
|
4
|
+
// The ASF licenses this file to You under the Apache License, Version 2.0
|
|
5
|
+
// (the "License"); you may not use this file except in compliance with
|
|
6
|
+
// the License. You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
|
|
16
|
+
syntax = "proto3";
|
|
17
|
+
|
|
18
|
+
import "google/protobuf/timestamp.proto";
|
|
19
|
+
import "google/protobuf/duration.proto";
|
|
20
|
+
|
|
21
|
+
package apache.rocketmq.v2;
|
|
22
|
+
|
|
23
|
+
option csharp_namespace = "Apache.Rocketmq.V2";
|
|
24
|
+
option java_multiple_files = true;
|
|
25
|
+
option java_package = "apache.rocketmq.v2";
|
|
26
|
+
option java_generate_equals_and_hash = true;
|
|
27
|
+
option java_string_check_utf8 = true;
|
|
28
|
+
option java_outer_classname = "MQDomain";
|
|
29
|
+
|
|
30
|
+
enum TransactionResolution {
|
|
31
|
+
TRANSACTION_RESOLUTION_UNSPECIFIED = 0;
|
|
32
|
+
COMMIT = 1;
|
|
33
|
+
ROLLBACK = 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
enum TransactionSource {
|
|
37
|
+
SOURCE_UNSPECIFIED = 0;
|
|
38
|
+
SOURCE_CLIENT = 1;
|
|
39
|
+
SOURCE_SERVER_CHECK = 2;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
enum Permission {
|
|
43
|
+
PERMISSION_UNSPECIFIED = 0;
|
|
44
|
+
NONE = 1;
|
|
45
|
+
READ = 2;
|
|
46
|
+
WRITE = 3;
|
|
47
|
+
READ_WRITE = 4;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
enum FilterType {
|
|
51
|
+
FILTER_TYPE_UNSPECIFIED = 0;
|
|
52
|
+
TAG = 1;
|
|
53
|
+
SQL = 2;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message FilterExpression {
|
|
57
|
+
FilterType type = 1;
|
|
58
|
+
string expression = 2;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message RetryPolicy {
|
|
62
|
+
int32 max_attempts = 1;
|
|
63
|
+
oneof strategy {
|
|
64
|
+
ExponentialBackoff exponential_backoff = 2;
|
|
65
|
+
CustomizedBackoff customized_backoff = 3;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// https://en.wikipedia.org/wiki/Exponential_backoff
|
|
70
|
+
message ExponentialBackoff {
|
|
71
|
+
google.protobuf.Duration initial = 1;
|
|
72
|
+
google.protobuf.Duration max = 2;
|
|
73
|
+
float multiplier = 3;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message CustomizedBackoff {
|
|
77
|
+
// To support classic backoff strategy which is arbitrary defined by end users.
|
|
78
|
+
// Typical values are: `1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h`
|
|
79
|
+
repeated google.protobuf.Duration next = 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
message Resource {
|
|
83
|
+
string resource_namespace = 1;
|
|
84
|
+
|
|
85
|
+
// Resource name identifier, which remains unique within the abstract resource
|
|
86
|
+
// namespace.
|
|
87
|
+
string name = 2;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
message SubscriptionEntry {
|
|
91
|
+
Resource topic = 1;
|
|
92
|
+
FilterExpression expression = 2;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
enum AddressScheme {
|
|
96
|
+
ADDRESS_SCHEME_UNSPECIFIED = 0;
|
|
97
|
+
IPv4 = 1;
|
|
98
|
+
IPv6 = 2;
|
|
99
|
+
DOMAIN_NAME = 3;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
message Address {
|
|
103
|
+
string host = 1;
|
|
104
|
+
int32 port = 2;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
message Endpoints {
|
|
108
|
+
AddressScheme scheme = 1;
|
|
109
|
+
repeated Address addresses = 2;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
message Broker {
|
|
113
|
+
// Name of the broker
|
|
114
|
+
string name = 1;
|
|
115
|
+
|
|
116
|
+
// Broker index. Canonically, index = 0 implies that the broker is playing
|
|
117
|
+
// leader role while brokers with index > 0 play follower role.
|
|
118
|
+
int32 id = 2;
|
|
119
|
+
|
|
120
|
+
// Address of the broker, complying with the following scheme
|
|
121
|
+
// 1. dns:[//authority/]host[:port]
|
|
122
|
+
// 2. ipv4:address[:port][,address[:port],...] – IPv4 addresses
|
|
123
|
+
// 3. ipv6:address[:port][,address[:port],...] – IPv6 addresses
|
|
124
|
+
Endpoints endpoints = 3;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
message MessageQueue {
|
|
128
|
+
Resource topic = 1;
|
|
129
|
+
int32 id = 2;
|
|
130
|
+
Permission permission = 3;
|
|
131
|
+
Broker broker = 4;
|
|
132
|
+
repeated MessageType accept_message_types = 5;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
enum MessageType {
|
|
136
|
+
MESSAGE_TYPE_UNSPECIFIED = 0;
|
|
137
|
+
|
|
138
|
+
NORMAL = 1;
|
|
139
|
+
|
|
140
|
+
// Sequenced message
|
|
141
|
+
FIFO = 2;
|
|
142
|
+
|
|
143
|
+
// Messages that are delivered after the specified duration.
|
|
144
|
+
DELAY = 3;
|
|
145
|
+
|
|
146
|
+
// Messages that are transactional. Only committed messages are delivered to
|
|
147
|
+
// subscribers.
|
|
148
|
+
TRANSACTION = 4;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
enum DigestType {
|
|
152
|
+
DIGEST_TYPE_UNSPECIFIED = 0;
|
|
153
|
+
|
|
154
|
+
// CRC algorithm achieves goal of detecting random data error with lowest
|
|
155
|
+
// computation overhead.
|
|
156
|
+
CRC32 = 1;
|
|
157
|
+
|
|
158
|
+
// MD5 algorithm achieves good balance between collision rate and computation
|
|
159
|
+
// overhead.
|
|
160
|
+
MD5 = 2;
|
|
161
|
+
|
|
162
|
+
// SHA-family has substantially fewer collision with fair amount of
|
|
163
|
+
// computation.
|
|
164
|
+
SHA1 = 3;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// When publishing messages to or subscribing messages from brokers, clients
|
|
168
|
+
// shall include or validate digests of message body to ensure data integrity.
|
|
169
|
+
//
|
|
170
|
+
// For message publishing, when an invalid digest were detected, brokers need
|
|
171
|
+
// respond client with BAD_REQUEST.
|
|
172
|
+
//
|
|
173
|
+
// For messages subscription, when an invalid digest were detected, consumers
|
|
174
|
+
// need to handle this case according to message type:
|
|
175
|
+
// 1) Standard messages should be negatively acknowledged instantly, causing
|
|
176
|
+
// immediate re-delivery; 2) FIFO messages require special RPC, to re-fetch
|
|
177
|
+
// previously acquired messages batch;
|
|
178
|
+
message Digest {
|
|
179
|
+
DigestType type = 1;
|
|
180
|
+
string checksum = 2;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
enum ClientType {
|
|
184
|
+
CLIENT_TYPE_UNSPECIFIED = 0;
|
|
185
|
+
PRODUCER = 1;
|
|
186
|
+
PUSH_CONSUMER = 2;
|
|
187
|
+
SIMPLE_CONSUMER = 3;
|
|
188
|
+
PULL_CONSUMER = 4;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
enum Encoding {
|
|
192
|
+
ENCODING_UNSPECIFIED = 0;
|
|
193
|
+
|
|
194
|
+
IDENTITY = 1;
|
|
195
|
+
|
|
196
|
+
GZIP = 2;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
message SystemProperties {
|
|
200
|
+
// Tag, which is optional.
|
|
201
|
+
optional string tag = 1;
|
|
202
|
+
|
|
203
|
+
// Message keys
|
|
204
|
+
repeated string keys = 2;
|
|
205
|
+
|
|
206
|
+
// Message identifier, client-side generated, remains unique.
|
|
207
|
+
// if message_id is empty, the send message request will be aborted with
|
|
208
|
+
// status `INVALID_ARGUMENT`
|
|
209
|
+
string message_id = 3;
|
|
210
|
+
|
|
211
|
+
// Message body digest
|
|
212
|
+
Digest body_digest = 4;
|
|
213
|
+
|
|
214
|
+
// Message body encoding. Candidate options are identity, gzip, snappy etc.
|
|
215
|
+
Encoding body_encoding = 5;
|
|
216
|
+
|
|
217
|
+
// Message type, normal, FIFO or transactional.
|
|
218
|
+
MessageType message_type = 6;
|
|
219
|
+
|
|
220
|
+
// Message born time-point.
|
|
221
|
+
google.protobuf.Timestamp born_timestamp = 7;
|
|
222
|
+
|
|
223
|
+
// Message born host. Valid options are IPv4, IPv6 or client host domain name.
|
|
224
|
+
string born_host = 8;
|
|
225
|
+
|
|
226
|
+
// Time-point at which the message is stored in the broker, which is absent
|
|
227
|
+
// for message publishing.
|
|
228
|
+
optional google.protobuf.Timestamp store_timestamp = 9;
|
|
229
|
+
|
|
230
|
+
// The broker that stores this message. It may be broker name, IP or arbitrary
|
|
231
|
+
// identifier that uniquely identify the server.
|
|
232
|
+
string store_host = 10;
|
|
233
|
+
|
|
234
|
+
// Time-point at which broker delivers to clients, which is optional.
|
|
235
|
+
optional google.protobuf.Timestamp delivery_timestamp = 11;
|
|
236
|
+
|
|
237
|
+
// If a message is acquired by way of POP, this field holds the receipt,
|
|
238
|
+
// which is absent for message publishing.
|
|
239
|
+
// Clients use the receipt to acknowledge or negatively acknowledge the
|
|
240
|
+
// message.
|
|
241
|
+
optional string receipt_handle = 12;
|
|
242
|
+
|
|
243
|
+
// Message queue identifier in which a message is physically stored.
|
|
244
|
+
int32 queue_id = 13;
|
|
245
|
+
|
|
246
|
+
// Message-queue offset at which a message is stored, which is absent for
|
|
247
|
+
// message publishing.
|
|
248
|
+
optional int64 queue_offset = 14;
|
|
249
|
+
|
|
250
|
+
// Period of time servers would remain invisible once a message is acquired.
|
|
251
|
+
optional google.protobuf.Duration invisible_duration = 15;
|
|
252
|
+
|
|
253
|
+
// Business code may failed to process messages for the moment. Hence, clients
|
|
254
|
+
// may request servers to deliver them again using certain back-off strategy,
|
|
255
|
+
// the attempt is 1 not 0 if message is delivered first time, and it is absent
|
|
256
|
+
// for message publishing.
|
|
257
|
+
optional int32 delivery_attempt = 16;
|
|
258
|
+
|
|
259
|
+
// Define the group name of message in the same topic, which is optional.
|
|
260
|
+
optional string message_group = 17;
|
|
261
|
+
|
|
262
|
+
// Trace context for each message, which is optional.
|
|
263
|
+
optional string trace_context = 18;
|
|
264
|
+
|
|
265
|
+
// If a transactional message stay unresolved for more than
|
|
266
|
+
// `transaction_orphan_threshold`, it would be regarded as an
|
|
267
|
+
// orphan. Servers that manages orphan messages would pick up
|
|
268
|
+
// a capable publisher to resolve
|
|
269
|
+
optional google.protobuf.Duration orphaned_transaction_recovery_duration = 19;
|
|
270
|
+
|
|
271
|
+
// Information to identify whether this message is from dead letter queue.
|
|
272
|
+
optional DeadLetterQueue dead_letter_queue = 20;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
message DeadLetterQueue {
|
|
276
|
+
// Original topic for this DLQ message.
|
|
277
|
+
string topic = 1;
|
|
278
|
+
// Original message id for this DLQ message.
|
|
279
|
+
string message_id = 2;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
message Message {
|
|
283
|
+
|
|
284
|
+
Resource topic = 1;
|
|
285
|
+
|
|
286
|
+
// User defined key-value pairs.
|
|
287
|
+
// If user_properties contain the reserved keys by RocketMQ,
|
|
288
|
+
// the send message request will be aborted with status `INVALID_ARGUMENT`.
|
|
289
|
+
// See below links for the reserved keys
|
|
290
|
+
// https://github.com/apache/rocketmq/blob/master/common/src/main/java/org/apache/rocketmq/common/message/MessageConst.java#L58
|
|
291
|
+
map<string, string> user_properties = 2;
|
|
292
|
+
|
|
293
|
+
SystemProperties system_properties = 3;
|
|
294
|
+
|
|
295
|
+
bytes body = 4;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
message Assignment {
|
|
299
|
+
MessageQueue message_queue = 1;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
enum Code {
|
|
303
|
+
CODE_UNSPECIFIED = 0;
|
|
304
|
+
|
|
305
|
+
// Generic code for success.
|
|
306
|
+
OK = 20000;
|
|
307
|
+
|
|
308
|
+
// Generic code for multiple return results.
|
|
309
|
+
MULTIPLE_RESULTS = 30000;
|
|
310
|
+
|
|
311
|
+
// Generic code for bad request, indicating that required fields or headers are missing.
|
|
312
|
+
BAD_REQUEST = 40000;
|
|
313
|
+
// Format of access point is illegal.
|
|
314
|
+
ILLEGAL_ACCESS_POINT = 40001;
|
|
315
|
+
// Format of topic is illegal.
|
|
316
|
+
ILLEGAL_TOPIC = 40002;
|
|
317
|
+
// Format of consumer group is illegal.
|
|
318
|
+
ILLEGAL_CONSUMER_GROUP = 40003;
|
|
319
|
+
// Format of message tag is illegal.
|
|
320
|
+
ILLEGAL_MESSAGE_TAG = 40004;
|
|
321
|
+
// Format of message key is illegal.
|
|
322
|
+
ILLEGAL_MESSAGE_KEY = 40005;
|
|
323
|
+
// Format of message group is illegal.
|
|
324
|
+
ILLEGAL_MESSAGE_GROUP = 40006;
|
|
325
|
+
// Format of message property key is illegal.
|
|
326
|
+
ILLEGAL_MESSAGE_PROPERTY_KEY = 40007;
|
|
327
|
+
// Transaction id is invalid.
|
|
328
|
+
INVALID_TRANSACTION_ID = 40008;
|
|
329
|
+
// Format of message id is illegal.
|
|
330
|
+
ILLEGAL_MESSAGE_ID = 40009;
|
|
331
|
+
// Format of filter expression is illegal.
|
|
332
|
+
ILLEGAL_FILTER_EXPRESSION = 40010;
|
|
333
|
+
// The invisible time of request is invalid.
|
|
334
|
+
ILLEGAL_INVISIBLE_TIME = 40011;
|
|
335
|
+
// The delivery timestamp of message is invalid.
|
|
336
|
+
ILLEGAL_DELIVERY_TIME = 40012;
|
|
337
|
+
// Receipt handle of message is invalid.
|
|
338
|
+
INVALID_RECEIPT_HANDLE = 40013;
|
|
339
|
+
// Message property conflicts with its type.
|
|
340
|
+
MESSAGE_PROPERTY_CONFLICT_WITH_TYPE = 40014;
|
|
341
|
+
// Client type could not be recognized.
|
|
342
|
+
UNRECOGNIZED_CLIENT_TYPE = 40015;
|
|
343
|
+
// Message is corrupted.
|
|
344
|
+
MESSAGE_CORRUPTED = 40016;
|
|
345
|
+
// Request is rejected due to missing of x-mq-client-id header.
|
|
346
|
+
CLIENT_ID_REQUIRED = 40017;
|
|
347
|
+
// Polling time is illegal.
|
|
348
|
+
ILLEGAL_POLLING_TIME = 40018;
|
|
349
|
+
// Offset is illegal.
|
|
350
|
+
ILLEGAL_OFFSET = 40019;
|
|
351
|
+
|
|
352
|
+
// Generic code indicates that the client request lacks valid authentication
|
|
353
|
+
// credentials for the requested resource.
|
|
354
|
+
UNAUTHORIZED = 40100;
|
|
355
|
+
|
|
356
|
+
// Generic code indicates that the account is suspended due to overdue of payment.
|
|
357
|
+
PAYMENT_REQUIRED = 40200;
|
|
358
|
+
|
|
359
|
+
// Generic code for the case that user does not have the permission to operate.
|
|
360
|
+
FORBIDDEN = 40300;
|
|
361
|
+
|
|
362
|
+
// Generic code for resource not found.
|
|
363
|
+
NOT_FOUND = 40400;
|
|
364
|
+
// Message not found from server.
|
|
365
|
+
MESSAGE_NOT_FOUND = 40401;
|
|
366
|
+
// Topic resource does not exist.
|
|
367
|
+
TOPIC_NOT_FOUND = 40402;
|
|
368
|
+
// Consumer group resource does not exist.
|
|
369
|
+
CONSUMER_GROUP_NOT_FOUND = 40403;
|
|
370
|
+
// Offset not found from server.
|
|
371
|
+
OFFSET_NOT_FOUND = 40404;
|
|
372
|
+
|
|
373
|
+
// Generic code representing client side timeout when connecting to, reading data from, or write data to server.
|
|
374
|
+
REQUEST_TIMEOUT = 40800;
|
|
375
|
+
|
|
376
|
+
// Generic code represents that the request entity is larger than limits defined by server.
|
|
377
|
+
PAYLOAD_TOO_LARGE = 41300;
|
|
378
|
+
// Message body size exceeds the threshold.
|
|
379
|
+
MESSAGE_BODY_TOO_LARGE = 41301;
|
|
380
|
+
// Message body is empty.
|
|
381
|
+
MESSAGE_BODY_EMPTY = 41302;
|
|
382
|
+
|
|
383
|
+
// Generic code for use cases where pre-conditions are not met.
|
|
384
|
+
// For example, if a producer instance is used to publish messages without prior start() invocation,
|
|
385
|
+
// this error code will be raised.
|
|
386
|
+
PRECONDITION_FAILED = 42800;
|
|
387
|
+
|
|
388
|
+
// Generic code indicates that too many requests are made in short period of duration.
|
|
389
|
+
// Requests are throttled.
|
|
390
|
+
TOO_MANY_REQUESTS = 42900;
|
|
391
|
+
|
|
392
|
+
// Generic code for the case that the server is unwilling to process the request because its header fields are too large.
|
|
393
|
+
// The request may be resubmitted after reducing the size of the request header fields.
|
|
394
|
+
REQUEST_HEADER_FIELDS_TOO_LARGE = 43100;
|
|
395
|
+
// Message properties total size exceeds the threshold.
|
|
396
|
+
MESSAGE_PROPERTIES_TOO_LARGE = 43101;
|
|
397
|
+
|
|
398
|
+
// Generic code indicates that server/client encountered an unexpected
|
|
399
|
+
// condition that prevented it from fulfilling the request.
|
|
400
|
+
INTERNAL_ERROR = 50000;
|
|
401
|
+
// Code indicates that the server encountered an unexpected condition
|
|
402
|
+
// that prevented it from fulfilling the request.
|
|
403
|
+
// This error response is a generic "catch-all" response.
|
|
404
|
+
// Usually, this indicates the server cannot find a better alternative
|
|
405
|
+
// error code to response. Sometimes, server administrators log error
|
|
406
|
+
// responses like the 500 status code with more details about the request
|
|
407
|
+
// to prevent the error from happening again in the future.
|
|
408
|
+
//
|
|
409
|
+
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
|
|
410
|
+
INTERNAL_SERVER_ERROR = 50001;
|
|
411
|
+
// The HA-mechanism is not working now.
|
|
412
|
+
HA_NOT_AVAILABLE = 50002;
|
|
413
|
+
|
|
414
|
+
// Generic code means that the server or client does not support the
|
|
415
|
+
// functionality required to fulfill the request.
|
|
416
|
+
NOT_IMPLEMENTED = 50100;
|
|
417
|
+
|
|
418
|
+
// Generic code represents that the server, which acts as a gateway or proxy,
|
|
419
|
+
// does not get an satisfied response in time from its upstream servers.
|
|
420
|
+
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504
|
|
421
|
+
PROXY_TIMEOUT = 50400;
|
|
422
|
+
// Message persistence timeout.
|
|
423
|
+
MASTER_PERSISTENCE_TIMEOUT = 50401;
|
|
424
|
+
// Slave persistence timeout.
|
|
425
|
+
SLAVE_PERSISTENCE_TIMEOUT = 50402;
|
|
426
|
+
|
|
427
|
+
// Generic code for unsupported operation.
|
|
428
|
+
UNSUPPORTED = 50500;
|
|
429
|
+
// Operation is not allowed in current version.
|
|
430
|
+
VERSION_UNSUPPORTED = 50501;
|
|
431
|
+
// Not allowed to verify message. Chances are that you are verifying
|
|
432
|
+
// a FIFO message, as is violating FIFO semantics.
|
|
433
|
+
VERIFY_FIFO_MESSAGE_UNSUPPORTED = 50502;
|
|
434
|
+
|
|
435
|
+
// Generic code for failed message consumption.
|
|
436
|
+
FAILED_TO_CONSUME_MESSAGE = 60000;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
message Status {
|
|
440
|
+
Code code = 1;
|
|
441
|
+
string message = 2;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
enum Language {
|
|
445
|
+
LANGUAGE_UNSPECIFIED = 0;
|
|
446
|
+
JAVA = 1;
|
|
447
|
+
CPP = 2;
|
|
448
|
+
DOT_NET = 3;
|
|
449
|
+
GOLANG = 4;
|
|
450
|
+
RUST = 5;
|
|
451
|
+
PYTHON = 6;
|
|
452
|
+
PHP = 7;
|
|
453
|
+
NODE_JS = 8;
|
|
454
|
+
RUBY = 9;
|
|
455
|
+
OBJECTIVE_C = 10;
|
|
456
|
+
DART = 11;
|
|
457
|
+
KOTLIN = 12;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// User Agent
|
|
461
|
+
message UA {
|
|
462
|
+
// SDK language
|
|
463
|
+
Language language = 1;
|
|
464
|
+
|
|
465
|
+
// SDK version
|
|
466
|
+
string version = 2;
|
|
467
|
+
|
|
468
|
+
// Platform details, including OS name, version, arch etc.
|
|
469
|
+
string platform = 3;
|
|
470
|
+
|
|
471
|
+
// Hostname of the node
|
|
472
|
+
string hostname = 4;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
message Settings {
|
|
476
|
+
// Configurations for all clients.
|
|
477
|
+
optional ClientType client_type = 1;
|
|
478
|
+
|
|
479
|
+
optional Endpoints access_point = 2;
|
|
480
|
+
|
|
481
|
+
// If publishing of messages encounters throttling or server internal errors,
|
|
482
|
+
// publishers should implement automatic retries after progressive longer
|
|
483
|
+
// back-offs for consecutive errors.
|
|
484
|
+
//
|
|
485
|
+
// When processing message fails, `backoff_policy` describes an interval
|
|
486
|
+
// after which the message should be available to consume again.
|
|
487
|
+
//
|
|
488
|
+
// For FIFO messages, the interval should be relatively small because
|
|
489
|
+
// messages of the same message group would not be readily available until
|
|
490
|
+
// the prior one depletes its lifecycle.
|
|
491
|
+
optional RetryPolicy backoff_policy = 3;
|
|
492
|
+
|
|
493
|
+
// Request timeout for RPCs excluding long-polling.
|
|
494
|
+
optional google.protobuf.Duration request_timeout = 4;
|
|
495
|
+
|
|
496
|
+
oneof pub_sub {
|
|
497
|
+
Publishing publishing = 5;
|
|
498
|
+
|
|
499
|
+
Subscription subscription = 6;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// User agent details
|
|
503
|
+
UA user_agent = 7;
|
|
504
|
+
|
|
505
|
+
Metric metric = 8;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
message Publishing {
|
|
509
|
+
// Publishing settings below here is appointed by client, thus it is
|
|
510
|
+
// unnecessary for server to push at present.
|
|
511
|
+
//
|
|
512
|
+
// List of topics to which messages will publish to.
|
|
513
|
+
repeated Resource topics = 1;
|
|
514
|
+
|
|
515
|
+
// If the message body size exceeds `max_body_size`, broker servers would
|
|
516
|
+
// reject the request. As a result, it is advisable that Producer performs
|
|
517
|
+
// client-side check validation.
|
|
518
|
+
int32 max_body_size = 2;
|
|
519
|
+
|
|
520
|
+
// When `validate_message_type` flag set `false`, no need to validate message's type
|
|
521
|
+
// with messageQueue's `accept_message_types` before publishing.
|
|
522
|
+
bool validate_message_type = 3;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
message Subscription {
|
|
526
|
+
// Subscription settings below here is appointed by client, thus it is
|
|
527
|
+
// unnecessary for server to push at present.
|
|
528
|
+
//
|
|
529
|
+
// Consumer group.
|
|
530
|
+
optional Resource group = 1;
|
|
531
|
+
|
|
532
|
+
// Subscription for consumer.
|
|
533
|
+
repeated SubscriptionEntry subscriptions = 2;
|
|
534
|
+
|
|
535
|
+
// Subscription settings below here are from server, it is essential for
|
|
536
|
+
// server to push.
|
|
537
|
+
//
|
|
538
|
+
// When FIFO flag is `true`, messages of the same message group are processed
|
|
539
|
+
// in first-in-first-out manner.
|
|
540
|
+
//
|
|
541
|
+
// Brokers will not deliver further messages of the same group until prior
|
|
542
|
+
// ones are completely acknowledged.
|
|
543
|
+
optional bool fifo = 3;
|
|
544
|
+
|
|
545
|
+
// Message receive batch size here is essential for push consumer.
|
|
546
|
+
optional int32 receive_batch_size = 4;
|
|
547
|
+
|
|
548
|
+
// Long-polling timeout for `ReceiveMessageRequest`, which is essential for
|
|
549
|
+
// push consumer.
|
|
550
|
+
optional google.protobuf.Duration long_polling_timeout = 5;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
message Metric {
|
|
554
|
+
// Indicates that if client should export local metrics to server.
|
|
555
|
+
bool on = 1;
|
|
556
|
+
|
|
557
|
+
// The endpoint that client metrics should be exported to, which is required if the switch is on.
|
|
558
|
+
optional Endpoints endpoints = 2;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
enum QueryOffsetPolicy {
|
|
562
|
+
// Use this option if client wishes to playback all existing messages.
|
|
563
|
+
BEGINNING = 0;
|
|
564
|
+
|
|
565
|
+
// Use this option if client wishes to skip all existing messages.
|
|
566
|
+
END = 1;
|
|
567
|
+
|
|
568
|
+
// Use this option if time-based seek is targeted.
|
|
569
|
+
TIMESTAMP = 2;
|
|
570
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// GENERATED CODE -- NO SERVICES IN PROTO
|