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,443 @@
|
|
|
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/duration.proto";
|
|
19
|
+
import "google/protobuf/timestamp.proto";
|
|
20
|
+
|
|
21
|
+
import "apache/rocketmq/v2/definition.proto";
|
|
22
|
+
|
|
23
|
+
package apache.rocketmq.v2;
|
|
24
|
+
|
|
25
|
+
option csharp_namespace = "Apache.Rocketmq.V2";
|
|
26
|
+
option java_multiple_files = true;
|
|
27
|
+
option java_package = "apache.rocketmq.v2";
|
|
28
|
+
option java_generate_equals_and_hash = true;
|
|
29
|
+
option java_string_check_utf8 = true;
|
|
30
|
+
option java_outer_classname = "MQService";
|
|
31
|
+
|
|
32
|
+
// Topics are destination of messages to publish to or subscribe from. Similar
|
|
33
|
+
// to domain names, they will be addressable after resolution through the
|
|
34
|
+
// provided access point.
|
|
35
|
+
//
|
|
36
|
+
// Access points are usually the addresses of name servers, which fulfill
|
|
37
|
+
// service discovery, load-balancing and other auxiliary services. Name servers
|
|
38
|
+
// receive periodic heartbeats from affiliate brokers and erase those which
|
|
39
|
+
// failed to maintain alive status.
|
|
40
|
+
//
|
|
41
|
+
// Name servers answer queries of QueryRouteRequest, responding clients with
|
|
42
|
+
// addressable message-queues, which they may directly publish messages to or
|
|
43
|
+
// subscribe messages from.
|
|
44
|
+
//
|
|
45
|
+
// QueryRouteRequest shall include source endpoints, aka, configured
|
|
46
|
+
// access-point, which annotates tenant-id, instance-id or other
|
|
47
|
+
// vendor-specific settings. Purpose-built name servers may respond customized
|
|
48
|
+
// results based on these particular requirements.
|
|
49
|
+
message QueryRouteRequest {
|
|
50
|
+
Resource topic = 1;
|
|
51
|
+
Endpoints endpoints = 2;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message QueryRouteResponse {
|
|
55
|
+
Status status = 1;
|
|
56
|
+
|
|
57
|
+
repeated MessageQueue message_queues = 2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message SendMessageRequest {
|
|
61
|
+
repeated Message messages = 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message SendResultEntry {
|
|
65
|
+
Status status = 1;
|
|
66
|
+
string message_id = 2;
|
|
67
|
+
string transaction_id = 3;
|
|
68
|
+
int64 offset = 4;
|
|
69
|
+
// Unique handle to identify message to recall, support delay message for now.
|
|
70
|
+
string recall_handle = 5;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message SendMessageResponse {
|
|
74
|
+
Status status = 1;
|
|
75
|
+
|
|
76
|
+
// Some implementation may have partial failure issues. Client SDK developers are expected to inspect
|
|
77
|
+
// each entry for best certainty.
|
|
78
|
+
repeated SendResultEntry entries = 2;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message QueryAssignmentRequest {
|
|
82
|
+
Resource topic = 1;
|
|
83
|
+
Resource group = 2;
|
|
84
|
+
Endpoints endpoints = 3;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message QueryAssignmentResponse {
|
|
88
|
+
Status status = 1;
|
|
89
|
+
repeated Assignment assignments = 2;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message ReceiveMessageRequest {
|
|
93
|
+
Resource group = 1;
|
|
94
|
+
MessageQueue message_queue = 2;
|
|
95
|
+
FilterExpression filter_expression = 3;
|
|
96
|
+
int32 batch_size = 4;
|
|
97
|
+
// Required if client type is simple consumer.
|
|
98
|
+
optional google.protobuf.Duration invisible_duration = 5;
|
|
99
|
+
// For message auto renew and clean
|
|
100
|
+
bool auto_renew = 6;
|
|
101
|
+
optional google.protobuf.Duration long_polling_timeout = 7;
|
|
102
|
+
optional string attempt_id = 8;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
message ReceiveMessageResponse {
|
|
106
|
+
oneof content {
|
|
107
|
+
Status status = 1;
|
|
108
|
+
Message message = 2;
|
|
109
|
+
// The timestamp that brokers start to deliver status line or message.
|
|
110
|
+
google.protobuf.Timestamp delivery_timestamp = 3;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
message AckMessageEntry {
|
|
115
|
+
string message_id = 1;
|
|
116
|
+
string receipt_handle = 2;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message AckMessageRequest {
|
|
120
|
+
Resource group = 1;
|
|
121
|
+
Resource topic = 2;
|
|
122
|
+
repeated AckMessageEntry entries = 3;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
message AckMessageResultEntry {
|
|
126
|
+
string message_id = 1;
|
|
127
|
+
string receipt_handle = 2;
|
|
128
|
+
|
|
129
|
+
// Acknowledge result may be acquired through inspecting
|
|
130
|
+
// `status.code`; In case acknowledgement failed, `status.message`
|
|
131
|
+
// is the explanation of the failure.
|
|
132
|
+
Status status = 3;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
message AckMessageResponse {
|
|
136
|
+
|
|
137
|
+
// RPC tier status, which is used to represent RPC-level errors including
|
|
138
|
+
// authentication, authorization, throttling and other general failures.
|
|
139
|
+
Status status = 1;
|
|
140
|
+
|
|
141
|
+
repeated AckMessageResultEntry entries = 2;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
message ForwardMessageToDeadLetterQueueRequest {
|
|
145
|
+
Resource group = 1;
|
|
146
|
+
Resource topic = 2;
|
|
147
|
+
string receipt_handle = 3;
|
|
148
|
+
string message_id = 4;
|
|
149
|
+
int32 delivery_attempt = 5;
|
|
150
|
+
int32 max_delivery_attempts = 6;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
message ForwardMessageToDeadLetterQueueResponse { Status status = 1; }
|
|
154
|
+
|
|
155
|
+
message HeartbeatRequest {
|
|
156
|
+
optional Resource group = 1;
|
|
157
|
+
ClientType client_type = 2;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
message HeartbeatResponse { Status status = 1; }
|
|
161
|
+
|
|
162
|
+
message EndTransactionRequest {
|
|
163
|
+
Resource topic = 1;
|
|
164
|
+
string message_id = 2;
|
|
165
|
+
string transaction_id = 3;
|
|
166
|
+
TransactionResolution resolution = 4;
|
|
167
|
+
TransactionSource source = 5;
|
|
168
|
+
string trace_context = 6;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
message EndTransactionResponse { Status status = 1; }
|
|
172
|
+
|
|
173
|
+
message PrintThreadStackTraceCommand { string nonce = 1; }
|
|
174
|
+
|
|
175
|
+
message ReconnectEndpointsCommand { string nonce = 1; }
|
|
176
|
+
|
|
177
|
+
message ThreadStackTrace {
|
|
178
|
+
string nonce = 1;
|
|
179
|
+
optional string thread_stack_trace = 2;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
message VerifyMessageCommand {
|
|
183
|
+
string nonce = 1;
|
|
184
|
+
Message message = 2;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
message VerifyMessageResult {
|
|
188
|
+
string nonce = 1;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
message RecoverOrphanedTransactionCommand {
|
|
192
|
+
Message message = 1;
|
|
193
|
+
string transaction_id = 2;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
message TelemetryCommand {
|
|
197
|
+
optional Status status = 1;
|
|
198
|
+
|
|
199
|
+
oneof command {
|
|
200
|
+
// Client settings
|
|
201
|
+
Settings settings = 2;
|
|
202
|
+
|
|
203
|
+
// These messages are from client.
|
|
204
|
+
//
|
|
205
|
+
// Report thread stack trace to server.
|
|
206
|
+
ThreadStackTrace thread_stack_trace = 3;
|
|
207
|
+
|
|
208
|
+
// Report message verify result to server.
|
|
209
|
+
VerifyMessageResult verify_message_result = 4;
|
|
210
|
+
|
|
211
|
+
// There messages are from server.
|
|
212
|
+
//
|
|
213
|
+
// Request client to recover the orphaned transaction message.
|
|
214
|
+
RecoverOrphanedTransactionCommand recover_orphaned_transaction_command = 5;
|
|
215
|
+
|
|
216
|
+
// Request client to print thread stack trace.
|
|
217
|
+
PrintThreadStackTraceCommand print_thread_stack_trace_command = 6;
|
|
218
|
+
|
|
219
|
+
// Request client to verify the consumption of the appointed message.
|
|
220
|
+
VerifyMessageCommand verify_message_command = 7;
|
|
221
|
+
|
|
222
|
+
// Request client to reconnect server use the latest endpoints.
|
|
223
|
+
ReconnectEndpointsCommand reconnect_endpoints_command = 8;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
message NotifyClientTerminationRequest {
|
|
228
|
+
// Consumer group, which is absent for producer.
|
|
229
|
+
optional Resource group = 1;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
message NotifyClientTerminationResponse { Status status = 1; }
|
|
233
|
+
|
|
234
|
+
message ChangeInvisibleDurationRequest {
|
|
235
|
+
Resource group = 1;
|
|
236
|
+
Resource topic = 2;
|
|
237
|
+
|
|
238
|
+
// Unique receipt handle to identify message to change
|
|
239
|
+
string receipt_handle = 3;
|
|
240
|
+
|
|
241
|
+
// New invisible duration
|
|
242
|
+
google.protobuf.Duration invisible_duration = 4;
|
|
243
|
+
|
|
244
|
+
// For message tracing
|
|
245
|
+
string message_id = 5;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
message ChangeInvisibleDurationResponse {
|
|
249
|
+
Status status = 1;
|
|
250
|
+
|
|
251
|
+
// Server may generate a new receipt handle for the message.
|
|
252
|
+
string receipt_handle = 2;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
message PullMessageRequest {
|
|
256
|
+
Resource group = 1;
|
|
257
|
+
MessageQueue message_queue = 2;
|
|
258
|
+
int64 offset = 3;
|
|
259
|
+
int32 batch_size = 4;
|
|
260
|
+
FilterExpression filter_expression = 5;
|
|
261
|
+
google.protobuf.Duration long_polling_timeout = 6;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
message PullMessageResponse {
|
|
265
|
+
oneof content {
|
|
266
|
+
Status status = 1;
|
|
267
|
+
Message message = 2;
|
|
268
|
+
int64 next_offset = 3;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
message UpdateOffsetRequest {
|
|
273
|
+
Resource group = 1;
|
|
274
|
+
MessageQueue message_queue = 2;
|
|
275
|
+
int64 offset = 3;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
message UpdateOffsetResponse {
|
|
279
|
+
Status status = 1;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
message GetOffsetRequest {
|
|
283
|
+
Resource group = 1;
|
|
284
|
+
MessageQueue message_queue = 2;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
message GetOffsetResponse {
|
|
288
|
+
Status status = 1;
|
|
289
|
+
int64 offset = 2;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
message QueryOffsetRequest {
|
|
293
|
+
MessageQueue message_queue = 1;
|
|
294
|
+
QueryOffsetPolicy query_offset_policy = 2;
|
|
295
|
+
optional google.protobuf.Timestamp timestamp = 3;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
message QueryOffsetResponse {
|
|
299
|
+
Status status = 1;
|
|
300
|
+
int64 offset = 2;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
message RecallMessageRequest {
|
|
304
|
+
Resource topic = 1;
|
|
305
|
+
// Refer to SendResultEntry.
|
|
306
|
+
string recall_handle = 2;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
message RecallMessageResponse {
|
|
310
|
+
Status status = 1;
|
|
311
|
+
string message_id = 2;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// For all the RPCs in MessagingService, the following error handling policies
|
|
315
|
+
// apply:
|
|
316
|
+
//
|
|
317
|
+
// If the request doesn't bear a valid authentication credential, return a
|
|
318
|
+
// response with common.status.code == `UNAUTHENTICATED`. If the authenticated
|
|
319
|
+
// user is not granted with sufficient permission to execute the requested
|
|
320
|
+
// operation, return a response with common.status.code == `PERMISSION_DENIED`.
|
|
321
|
+
// If the per-user-resource-based quota is exhausted, return a response with
|
|
322
|
+
// common.status.code == `RESOURCE_EXHAUSTED`. If any unexpected server-side
|
|
323
|
+
// errors raise, return a response with common.status.code == `INTERNAL`.
|
|
324
|
+
service MessagingService {
|
|
325
|
+
|
|
326
|
+
// Queries the route entries of the requested topic in the perspective of the
|
|
327
|
+
// given endpoints. On success, servers should return a collection of
|
|
328
|
+
// addressable message-queues. Note servers may return customized route
|
|
329
|
+
// entries based on endpoints provided.
|
|
330
|
+
//
|
|
331
|
+
// If the requested topic doesn't exist, returns `NOT_FOUND`.
|
|
332
|
+
// If the specific endpoints is empty, returns `INVALID_ARGUMENT`.
|
|
333
|
+
rpc QueryRoute(QueryRouteRequest) returns (QueryRouteResponse) {}
|
|
334
|
+
|
|
335
|
+
// Producer or consumer sends HeartbeatRequest to servers periodically to
|
|
336
|
+
// keep-alive. Additionally, it also reports client-side configuration,
|
|
337
|
+
// including topic subscription, load-balancing group name, etc.
|
|
338
|
+
//
|
|
339
|
+
// Returns `OK` if success.
|
|
340
|
+
//
|
|
341
|
+
// If a client specifies a language that is not yet supported by servers,
|
|
342
|
+
// returns `INVALID_ARGUMENT`
|
|
343
|
+
rpc Heartbeat(HeartbeatRequest) returns (HeartbeatResponse) {}
|
|
344
|
+
|
|
345
|
+
// Delivers messages to brokers.
|
|
346
|
+
// Clients may further:
|
|
347
|
+
// 1. Refine a message destination to message-queues which fulfills parts of
|
|
348
|
+
// FIFO semantic;
|
|
349
|
+
// 2. Flag a message as transactional, which keeps it invisible to consumers
|
|
350
|
+
// until it commits;
|
|
351
|
+
// 3. Time a message, making it invisible to consumers till specified
|
|
352
|
+
// time-point;
|
|
353
|
+
// 4. And more...
|
|
354
|
+
//
|
|
355
|
+
// Returns message-id or transaction-id with status `OK` on success.
|
|
356
|
+
//
|
|
357
|
+
// If the destination topic doesn't exist, returns `NOT_FOUND`.
|
|
358
|
+
rpc SendMessage(SendMessageRequest) returns (SendMessageResponse) {}
|
|
359
|
+
|
|
360
|
+
// Queries the assigned route info of a topic for current consumer,
|
|
361
|
+
// the returned assignment result is decided by server-side load balancer.
|
|
362
|
+
//
|
|
363
|
+
// If the corresponding topic doesn't exist, returns `NOT_FOUND`.
|
|
364
|
+
// If the specific endpoints is empty, returns `INVALID_ARGUMENT`.
|
|
365
|
+
rpc QueryAssignment(QueryAssignmentRequest) returns (QueryAssignmentResponse) {
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// Receives messages from the server in batch manner, returns a set of
|
|
369
|
+
// messages if success. The received messages should be acked or redelivered
|
|
370
|
+
// after processed.
|
|
371
|
+
//
|
|
372
|
+
// If the pending concurrent receive requests exceed the quota of the given
|
|
373
|
+
// consumer group, returns `UNAVAILABLE`. If the upstream store server hangs,
|
|
374
|
+
// return `DEADLINE_EXCEEDED` in a timely manner. If the corresponding topic
|
|
375
|
+
// or consumer group doesn't exist, returns `NOT_FOUND`. If there is no new
|
|
376
|
+
// message in the specific topic, returns `OK` with an empty message set.
|
|
377
|
+
// Please note that client may suffer from false empty responses.
|
|
378
|
+
//
|
|
379
|
+
// If failed to receive message from remote, server must return only one
|
|
380
|
+
// `ReceiveMessageResponse` as the reply to the request, whose `Status` indicates
|
|
381
|
+
// the specific reason of failure, otherwise, the reply is considered successful.
|
|
382
|
+
rpc ReceiveMessage(ReceiveMessageRequest) returns (stream ReceiveMessageResponse) {
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// Acknowledges the message associated with the `receipt_handle` or `offset`
|
|
386
|
+
// in the `AckMessageRequest`, it means the message has been successfully
|
|
387
|
+
// processed. Returns `OK` if the message server remove the relevant message
|
|
388
|
+
// successfully.
|
|
389
|
+
//
|
|
390
|
+
// If the given receipt_handle is illegal or out of date, returns
|
|
391
|
+
// `INVALID_ARGUMENT`.
|
|
392
|
+
rpc AckMessage(AckMessageRequest) returns (AckMessageResponse) {}
|
|
393
|
+
|
|
394
|
+
// Forwards one message to dead letter queue if the max delivery attempts is
|
|
395
|
+
// exceeded by this message at client-side, return `OK` if success.
|
|
396
|
+
rpc ForwardMessageToDeadLetterQueue(ForwardMessageToDeadLetterQueueRequest)
|
|
397
|
+
returns (ForwardMessageToDeadLetterQueueResponse) {}
|
|
398
|
+
|
|
399
|
+
// PullMessage and ReceiveMessage RPCs serve a similar purpose,
|
|
400
|
+
// which is to attempt to get messages from the server, but with different semantics.
|
|
401
|
+
rpc PullMessage(PullMessageRequest) returns (stream PullMessageResponse) {}
|
|
402
|
+
|
|
403
|
+
// Update the consumption progress of the designated queue of the
|
|
404
|
+
// consumer group to the remote.
|
|
405
|
+
rpc UpdateOffset(UpdateOffsetRequest) returns (UpdateOffsetResponse) {}
|
|
406
|
+
|
|
407
|
+
// Query the consumption progress of the designated queue of the
|
|
408
|
+
// consumer group to the remote.
|
|
409
|
+
rpc GetOffset(GetOffsetRequest) returns (GetOffsetResponse) {}
|
|
410
|
+
|
|
411
|
+
// Query the offset of the designated queue by the query offset policy.
|
|
412
|
+
rpc QueryOffset(QueryOffsetRequest) returns (QueryOffsetResponse) {}
|
|
413
|
+
|
|
414
|
+
// Commits or rollback one transactional message.
|
|
415
|
+
rpc EndTransaction(EndTransactionRequest) returns (EndTransactionResponse) {}
|
|
416
|
+
|
|
417
|
+
// Once a client starts, it would immediately establishes bi-lateral stream
|
|
418
|
+
// RPCs with brokers, reporting its settings as the initiative command.
|
|
419
|
+
//
|
|
420
|
+
// When servers have need of inspecting client status, they would issue
|
|
421
|
+
// telemetry commands to clients. After executing received instructions,
|
|
422
|
+
// clients shall report command execution results through client-side streams.
|
|
423
|
+
rpc Telemetry(stream TelemetryCommand) returns (stream TelemetryCommand) {}
|
|
424
|
+
|
|
425
|
+
// Notify the server that the client is terminated.
|
|
426
|
+
rpc NotifyClientTermination(NotifyClientTerminationRequest) returns (NotifyClientTerminationResponse) {
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// Once a message is retrieved from consume queue on behalf of the group, it
|
|
430
|
+
// will be kept invisible to other clients of the same group for a period of
|
|
431
|
+
// time. The message is supposed to be processed within the invisible
|
|
432
|
+
// duration. If the client, which is in charge of the invisible message, is
|
|
433
|
+
// not capable of processing the message timely, it may use
|
|
434
|
+
// ChangeInvisibleDuration to lengthen invisible duration.
|
|
435
|
+
rpc ChangeInvisibleDuration(ChangeInvisibleDurationRequest) returns (ChangeInvisibleDurationResponse) {
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// Recall a message,
|
|
439
|
+
// for delay message, should recall before delivery time, like the rollback operation of transaction message,
|
|
440
|
+
// for normal message, not supported for now.
|
|
441
|
+
rpc RecallMessage(RecallMessageRequest) returns (RecallMessageResponse) {
|
|
442
|
+
}
|
|
443
|
+
}
|