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,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { Status, Code } from '../../proto/apache/rocketmq/v2/definition_pb';
|
|
19
|
+
import { BadRequestException } from './BadRequestException';
|
|
20
|
+
import { ForbiddenException } from './ForbiddenException';
|
|
21
|
+
import { InternalErrorException } from './InternalErrorException';
|
|
22
|
+
import { NotFoundException } from './NotFoundException';
|
|
23
|
+
import { PayloadTooLargeException } from './PayloadTooLargeException';
|
|
24
|
+
import { PaymentRequiredException } from './PaymentRequiredException';
|
|
25
|
+
import { ProxyTimeoutException } from './ProxyTimeoutException';
|
|
26
|
+
import { RequestHeaderFieldsTooLargeException } from './RequestHeaderFieldsTooLargeException';
|
|
27
|
+
import { TooManyRequestsException } from './TooManyRequestsException';
|
|
28
|
+
import { UnauthorizedException } from './UnauthorizedException';
|
|
29
|
+
import { UnsupportedException } from './UnsupportedException';
|
|
30
|
+
|
|
31
|
+
export class StatusChecker {
|
|
32
|
+
static check(status?: Status.AsObject, requestId?: string) {
|
|
33
|
+
if (!status) return;
|
|
34
|
+
switch (status.code) {
|
|
35
|
+
case Code.OK:
|
|
36
|
+
case Code.MULTIPLE_RESULTS:
|
|
37
|
+
return;
|
|
38
|
+
case Code.BAD_REQUEST:
|
|
39
|
+
case Code.ILLEGAL_ACCESS_POINT:
|
|
40
|
+
case Code.ILLEGAL_TOPIC:
|
|
41
|
+
case Code.ILLEGAL_CONSUMER_GROUP:
|
|
42
|
+
case Code.ILLEGAL_MESSAGE_TAG:
|
|
43
|
+
case Code.ILLEGAL_MESSAGE_KEY:
|
|
44
|
+
case Code.ILLEGAL_MESSAGE_GROUP:
|
|
45
|
+
case Code.ILLEGAL_MESSAGE_PROPERTY_KEY:
|
|
46
|
+
case Code.INVALID_TRANSACTION_ID:
|
|
47
|
+
case Code.ILLEGAL_MESSAGE_ID:
|
|
48
|
+
case Code.ILLEGAL_FILTER_EXPRESSION:
|
|
49
|
+
case Code.ILLEGAL_INVISIBLE_TIME:
|
|
50
|
+
case Code.ILLEGAL_DELIVERY_TIME:
|
|
51
|
+
case Code.INVALID_RECEIPT_HANDLE:
|
|
52
|
+
case Code.MESSAGE_PROPERTY_CONFLICT_WITH_TYPE:
|
|
53
|
+
case Code.UNRECOGNIZED_CLIENT_TYPE:
|
|
54
|
+
case Code.MESSAGE_CORRUPTED:
|
|
55
|
+
case Code.CLIENT_ID_REQUIRED:
|
|
56
|
+
case Code.ILLEGAL_POLLING_TIME:
|
|
57
|
+
throw new BadRequestException(status.code, status.message, requestId);
|
|
58
|
+
case Code.UNAUTHORIZED:
|
|
59
|
+
throw new UnauthorizedException(status.code, status.message, requestId);
|
|
60
|
+
case Code.PAYMENT_REQUIRED:
|
|
61
|
+
throw new PaymentRequiredException(status.code, status.message, requestId);
|
|
62
|
+
case Code.FORBIDDEN:
|
|
63
|
+
throw new ForbiddenException(status.code, status.message, requestId);
|
|
64
|
+
case Code.MESSAGE_NOT_FOUND:
|
|
65
|
+
return;
|
|
66
|
+
case Code.NOT_FOUND:
|
|
67
|
+
case Code.TOPIC_NOT_FOUND:
|
|
68
|
+
case Code.CONSUMER_GROUP_NOT_FOUND:
|
|
69
|
+
throw new NotFoundException(status.code, status.message, requestId);
|
|
70
|
+
case Code.PAYLOAD_TOO_LARGE:
|
|
71
|
+
case Code.MESSAGE_BODY_TOO_LARGE:
|
|
72
|
+
throw new PayloadTooLargeException(status.code, status.message, requestId);
|
|
73
|
+
case Code.TOO_MANY_REQUESTS:
|
|
74
|
+
throw new TooManyRequestsException(status.code, status.message, requestId);
|
|
75
|
+
case Code.REQUEST_HEADER_FIELDS_TOO_LARGE:
|
|
76
|
+
case Code.MESSAGE_PROPERTIES_TOO_LARGE:
|
|
77
|
+
throw new RequestHeaderFieldsTooLargeException(status.code, status.message, requestId);
|
|
78
|
+
case Code.INTERNAL_ERROR:
|
|
79
|
+
case Code.INTERNAL_SERVER_ERROR:
|
|
80
|
+
case Code.HA_NOT_AVAILABLE:
|
|
81
|
+
throw new InternalErrorException(status.code, status.message, requestId);
|
|
82
|
+
case Code.PROXY_TIMEOUT:
|
|
83
|
+
case Code.MASTER_PERSISTENCE_TIMEOUT:
|
|
84
|
+
case Code.SLAVE_PERSISTENCE_TIMEOUT:
|
|
85
|
+
throw new ProxyTimeoutException(status.code, status.message, requestId);
|
|
86
|
+
case Code.UNSUPPORTED:
|
|
87
|
+
case Code.VERSION_UNSUPPORTED:
|
|
88
|
+
case Code.VERIFY_FIFO_MESSAGE_UNSUPPORTED:
|
|
89
|
+
throw new UnsupportedException(status.code, status.message, requestId);
|
|
90
|
+
default:
|
|
91
|
+
throw new UnsupportedException(status.code, status.message, requestId);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { ClientException } from './ClientException';
|
|
19
|
+
|
|
20
|
+
export class TooManyRequestsException extends ClientException {
|
|
21
|
+
constructor(code: number, message: string, requestId?: string) {
|
|
22
|
+
super(code, message, requestId);
|
|
23
|
+
this.name = 'TooManyRequestsException';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { ClientException } from './ClientException';
|
|
19
|
+
|
|
20
|
+
export class UnauthorizedException extends ClientException {
|
|
21
|
+
constructor(code: number, message: string, requestId?: string) {
|
|
22
|
+
super(code, message, requestId);
|
|
23
|
+
this.name = 'UnauthorizedException';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { ClientException } from './ClientException';
|
|
19
|
+
|
|
20
|
+
export class UnsupportedException extends ClientException {
|
|
21
|
+
constructor(code: number, message: string, requestId?: string) {
|
|
22
|
+
super(code, message, requestId);
|
|
23
|
+
this.name = 'UnsupportedException';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export * from './BadRequestException';
|
|
19
|
+
export * from './ClientException';
|
|
20
|
+
export * from './ForbiddenException';
|
|
21
|
+
export * from './InternalErrorException';
|
|
22
|
+
export * from './NotFoundException';
|
|
23
|
+
export * from './PayloadTooLargeException';
|
|
24
|
+
export * from './PaymentRequiredException';
|
|
25
|
+
export * from './ProxyTimeoutException';
|
|
26
|
+
export * from './RequestHeaderFieldsTooLargeException';
|
|
27
|
+
export * from './StatusChecker';
|
|
28
|
+
export * from './TooManyRequestsException';
|
|
29
|
+
export * from './UnauthorizedException';
|
|
30
|
+
export * from './UnsupportedException';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export * from './consumer';
|
|
19
|
+
export * from './exception';
|
|
20
|
+
export * from './message';
|
|
21
|
+
export * from './producer';
|
|
22
|
+
export * from './retry';
|
|
23
|
+
export * from './route';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export interface MessageOptions {
|
|
19
|
+
topic: string;
|
|
20
|
+
body: Buffer;
|
|
21
|
+
tag?: string;
|
|
22
|
+
messageGroup?: string;
|
|
23
|
+
keys?: string[];
|
|
24
|
+
properties?: Map<string, string>;
|
|
25
|
+
delay?: number;
|
|
26
|
+
deliveryTimestamp?: Date;
|
|
27
|
+
priority?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class Message {
|
|
31
|
+
topic: string;
|
|
32
|
+
body: Buffer;
|
|
33
|
+
tag?: string;
|
|
34
|
+
messageGroup?: string;
|
|
35
|
+
keys: string[];
|
|
36
|
+
properties?: Map<string, string>;
|
|
37
|
+
deliveryTimestamp?: Date;
|
|
38
|
+
priority?: number;
|
|
39
|
+
|
|
40
|
+
constructor(options: MessageOptions) {
|
|
41
|
+
// Validate priority and mutual exclusivity
|
|
42
|
+
if (options.priority !== undefined) {
|
|
43
|
+
if (options.priority < 0) {
|
|
44
|
+
throw new Error('priority must be greater than or equal to 0');
|
|
45
|
+
}
|
|
46
|
+
if (options.deliveryTimestamp) {
|
|
47
|
+
throw new Error('priority and deliveryTimestamp should not be set at same time');
|
|
48
|
+
}
|
|
49
|
+
if (options.messageGroup) {
|
|
50
|
+
throw new Error('priority and messageGroup should not be set at same time');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
this.topic = options.topic;
|
|
55
|
+
this.body = options.body;
|
|
56
|
+
this.tag = options.tag;
|
|
57
|
+
this.messageGroup = options.messageGroup;
|
|
58
|
+
this.keys = options.keys ?? [];
|
|
59
|
+
this.properties = options.properties;
|
|
60
|
+
let deliveryTimestamp = options.deliveryTimestamp;
|
|
61
|
+
if (options.delay && !deliveryTimestamp) {
|
|
62
|
+
deliveryTimestamp = new Date(Date.now() + options.delay);
|
|
63
|
+
}
|
|
64
|
+
this.deliveryTimestamp = deliveryTimestamp;
|
|
65
|
+
this.priority = options.priority;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import address from 'address';
|
|
19
|
+
|
|
20
|
+
export enum MESSAGE_VERSION {
|
|
21
|
+
V0 = 0x00,
|
|
22
|
+
V1 = 0x01,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class MessageId {
|
|
26
|
+
id: string;
|
|
27
|
+
/**
|
|
28
|
+
* e.g.: 0x01: fixed 1 byte for current version
|
|
29
|
+
* offset = 0
|
|
30
|
+
*/
|
|
31
|
+
version: MESSAGE_VERSION;
|
|
32
|
+
/**
|
|
33
|
+
* e.g.: 0x56F7E71C361B: lower 6 bytes of local mac address
|
|
34
|
+
* offset = 1
|
|
35
|
+
*/
|
|
36
|
+
macAddress: string;
|
|
37
|
+
/**
|
|
38
|
+
* e.g.: 0x21BC: lower 2 bytes of process id
|
|
39
|
+
* offset = 7
|
|
40
|
+
*/
|
|
41
|
+
processId: number;
|
|
42
|
+
/**
|
|
43
|
+
* e.g: 0x024CCDBE: seconds since 2021-01-01 00:00:00(UTC+0, lower 4 bytes)
|
|
44
|
+
* offset = 9
|
|
45
|
+
*/
|
|
46
|
+
timestamp: number;
|
|
47
|
+
/**
|
|
48
|
+
* e.g.: 0x00000000: sequence number(4 bytes)
|
|
49
|
+
* offset = 13
|
|
50
|
+
*/
|
|
51
|
+
sequence: number;
|
|
52
|
+
|
|
53
|
+
toString() {
|
|
54
|
+
return this.id;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const MAX_UINT32 = 0xFFFFFFFF;
|
|
59
|
+
const MAX_UINT16 = 0xFFFF;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Message Identifier
|
|
63
|
+
* https://github.com/apache/rocketmq-clients/blob/master/docs/message_id.md
|
|
64
|
+
*/
|
|
65
|
+
export class MessageIdFactory {
|
|
66
|
+
// static #hostname = hostname();
|
|
67
|
+
static #sequence = 0;
|
|
68
|
+
static #buf = Buffer.alloc(1 + 6 + 2 + 4 + 4);
|
|
69
|
+
// 2021-01-01 00:00:00(UTC+0), 1609459200000
|
|
70
|
+
static #sinceTimestamp = new Date('2021-01-01T00:00:00Z').getTime() / 1000;
|
|
71
|
+
// lower 2 bytes of process id
|
|
72
|
+
static #processId = process.pid % MAX_UINT16;
|
|
73
|
+
static MAC = '000000000000';
|
|
74
|
+
|
|
75
|
+
static create() {
|
|
76
|
+
const messageId = new MessageId();
|
|
77
|
+
messageId.version = MESSAGE_VERSION.V1;
|
|
78
|
+
messageId.macAddress = this.MAC;
|
|
79
|
+
messageId.processId = this.#processId;
|
|
80
|
+
messageId.timestamp = this.#getCurrentTimestamp();
|
|
81
|
+
messageId.sequence = this.#sequence++;
|
|
82
|
+
if (this.#sequence > MAX_UINT32) {
|
|
83
|
+
this.#sequence = 0;
|
|
84
|
+
}
|
|
85
|
+
this.#buf.writeUInt8(messageId.version, 0);
|
|
86
|
+
this.#buf.write(messageId.macAddress, 1, 'hex');
|
|
87
|
+
this.#buf.writeUInt16BE(messageId.processId, 7);
|
|
88
|
+
this.#buf.writeUInt32BE(messageId.timestamp, 9);
|
|
89
|
+
this.#buf.writeUInt32BE(messageId.sequence, 13);
|
|
90
|
+
messageId.id = this.#buf.toString('hex').toUpperCase();
|
|
91
|
+
return messageId;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
static decode(id: string) {
|
|
95
|
+
const messageId = new MessageId();
|
|
96
|
+
messageId.id = id;
|
|
97
|
+
this.#buf.write(id, 0, 'hex');
|
|
98
|
+
messageId.version = this.#buf.readUInt8(0);
|
|
99
|
+
messageId.macAddress = this.#buf.subarray(1, 7).toString('hex');
|
|
100
|
+
messageId.processId = this.#buf.readUInt16BE(7);
|
|
101
|
+
messageId.timestamp = this.#buf.readUInt32BE(9);
|
|
102
|
+
messageId.sequence = this.#buf.readUInt32BE(13);
|
|
103
|
+
return messageId;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
static #getCurrentTimestamp() {
|
|
107
|
+
// use lower 4 bytes
|
|
108
|
+
return Math.floor(Date.now() / 1000 - this.#sinceTimestamp) % MAX_UINT32;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// set current mac address
|
|
113
|
+
address.mac((err, mac) => {
|
|
114
|
+
if (err) {
|
|
115
|
+
console.warn('[rocketmq-client-nodejs] can\'t get mac address, %s', err.message);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (!mac) {
|
|
119
|
+
console.warn('[rocketmq-client-nodejs] can\'t get mac address');
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
MessageIdFactory.MAC = mac.replaceAll(':', '');
|
|
123
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { gunzipSync } from 'node:zlib';
|
|
19
|
+
import {
|
|
20
|
+
DigestType,
|
|
21
|
+
Encoding,
|
|
22
|
+
Message as MessagePB,
|
|
23
|
+
} from '../../proto/apache/rocketmq/v2/definition_pb';
|
|
24
|
+
import { crc32CheckSum, md5CheckSum, sha1CheckSum } from '../util';
|
|
25
|
+
import { Endpoints, MessageQueue } from '../route';
|
|
26
|
+
|
|
27
|
+
export class MessageView {
|
|
28
|
+
readonly messageId: string;
|
|
29
|
+
readonly topic: string;
|
|
30
|
+
readonly body: Buffer;
|
|
31
|
+
readonly corrupted: boolean;
|
|
32
|
+
readonly transportDeliveryTimestamp?: Date;
|
|
33
|
+
readonly tag?: string;
|
|
34
|
+
readonly messageGroup?: string;
|
|
35
|
+
readonly deliveryTimestamp?: Date;
|
|
36
|
+
readonly keys: string[];
|
|
37
|
+
readonly bornHost: string;
|
|
38
|
+
readonly bornTimestamp?: Date;
|
|
39
|
+
readonly deliveryAttempt?: number;
|
|
40
|
+
readonly endpoints: Endpoints;
|
|
41
|
+
readonly receiptHandle: string;
|
|
42
|
+
readonly offset?: number;
|
|
43
|
+
readonly decodeTimestamp: Date;
|
|
44
|
+
readonly properties = new Map<string, string>();
|
|
45
|
+
|
|
46
|
+
constructor(message: MessagePB, messageQueue?: MessageQueue, transportDeliveryTimestamp?: Date) {
|
|
47
|
+
const systemProperties = message.getSystemProperties()!;
|
|
48
|
+
const bodyDigest = systemProperties.getBodyDigest()!.toObject();
|
|
49
|
+
const digestType = bodyDigest.type;
|
|
50
|
+
const checksum = bodyDigest.checksum;
|
|
51
|
+
let expectedChecksum = '';
|
|
52
|
+
let bodyBytes = Buffer.from(message.getBody_asU8());
|
|
53
|
+
switch (digestType) {
|
|
54
|
+
case DigestType.CRC32:
|
|
55
|
+
expectedChecksum = crc32CheckSum(bodyBytes);
|
|
56
|
+
break;
|
|
57
|
+
case DigestType.MD5:
|
|
58
|
+
expectedChecksum = md5CheckSum(bodyBytes);
|
|
59
|
+
break;
|
|
60
|
+
case DigestType.SHA1:
|
|
61
|
+
expectedChecksum = sha1CheckSum(bodyBytes);
|
|
62
|
+
break;
|
|
63
|
+
default:
|
|
64
|
+
// log.error("Unsupported message body digest algorithm, digestType={}, topic={}, messageId={}",
|
|
65
|
+
// digestType, topic, messageId);
|
|
66
|
+
}
|
|
67
|
+
if (expectedChecksum && expectedChecksum !== checksum) {
|
|
68
|
+
this.corrupted = true;
|
|
69
|
+
}
|
|
70
|
+
if (systemProperties.getBodyEncoding() === Encoding.GZIP) {
|
|
71
|
+
bodyBytes = gunzipSync(bodyBytes);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
for (const [ key, value ] of message.getUserPropertiesMap().entries()) {
|
|
75
|
+
this.properties.set(key, value);
|
|
76
|
+
}
|
|
77
|
+
this.messageId = systemProperties.getMessageId();
|
|
78
|
+
this.topic = message.getTopic()!.getName();
|
|
79
|
+
this.tag = systemProperties.getTag();
|
|
80
|
+
this.messageGroup = systemProperties.getMessageGroup();
|
|
81
|
+
this.deliveryTimestamp = systemProperties.getDeliveryTimestamp()?.toDate();
|
|
82
|
+
this.keys = systemProperties.getKeysList();
|
|
83
|
+
this.bornHost = systemProperties.getBornHost();
|
|
84
|
+
this.bornTimestamp = systemProperties.getBornTimestamp()?.toDate();
|
|
85
|
+
this.deliveryAttempt = systemProperties.getDeliveryAttempt();
|
|
86
|
+
this.offset = systemProperties.getQueueOffset();
|
|
87
|
+
this.receiptHandle = systemProperties.getReceiptHandle()!;
|
|
88
|
+
this.transportDeliveryTimestamp = transportDeliveryTimestamp;
|
|
89
|
+
if (messageQueue) {
|
|
90
|
+
this.endpoints = messageQueue.broker.endpoints;
|
|
91
|
+
}
|
|
92
|
+
this.body = bodyBytes;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
|
|
19
|
+
import {
|
|
20
|
+
MessageType, Message as MessagePB, SystemProperties, Encoding,
|
|
21
|
+
} from '../../proto/apache/rocketmq/v2/definition_pb';
|
|
22
|
+
import { PublishingSettings } from '../producer';
|
|
23
|
+
import { createResource } from '../util';
|
|
24
|
+
import { MessageQueue } from '../route';
|
|
25
|
+
import { UserAgent } from '../client';
|
|
26
|
+
import { Message, MessageOptions } from './Message';
|
|
27
|
+
import { MessageIdFactory } from './MessageId';
|
|
28
|
+
|
|
29
|
+
export class PublishingMessage extends Message {
|
|
30
|
+
readonly messageId: string;
|
|
31
|
+
readonly messageType: MessageType;
|
|
32
|
+
|
|
33
|
+
constructor(options: MessageOptions, publishingSettings: PublishingSettings, txEnabled: boolean) {
|
|
34
|
+
super(options);
|
|
35
|
+
const length = this.body.length;
|
|
36
|
+
const maxBodySizeBytes = publishingSettings.maxBodySizeBytes;
|
|
37
|
+
if (length > maxBodySizeBytes) {
|
|
38
|
+
throw new TypeError(`Message body size exceeds the threshold, max size=${maxBodySizeBytes} bytes`);
|
|
39
|
+
}
|
|
40
|
+
// Generate message id.
|
|
41
|
+
this.messageId = MessageIdFactory.create().toString();
|
|
42
|
+
// Normal message.
|
|
43
|
+
if (!this.messageGroup && !this.deliveryTimestamp && !txEnabled) {
|
|
44
|
+
this.messageType = MessageType.NORMAL;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// Fifo message.
|
|
48
|
+
if (this.messageGroup && !txEnabled) {
|
|
49
|
+
this.messageType = MessageType.FIFO;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// Delay message.
|
|
53
|
+
if (this.deliveryTimestamp && !txEnabled) {
|
|
54
|
+
this.messageType = MessageType.DELAY;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
// Transaction message.
|
|
58
|
+
if (!this.messageGroup &&
|
|
59
|
+
!this.deliveryTimestamp && txEnabled) {
|
|
60
|
+
this.messageType = MessageType.TRANSACTION;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
// Transaction semantics is conflicted with fifo/delay.
|
|
64
|
+
throw new TypeError('Transactional message should not set messageGroup or deliveryTimestamp');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* This method should be invoked before each message sending, because the born time is reset before each
|
|
69
|
+
* invocation, which means that it should not be invoked ahead of time.
|
|
70
|
+
*/
|
|
71
|
+
toProtobuf(namespace: string, mq: MessageQueue) {
|
|
72
|
+
const systemProperties = new SystemProperties()
|
|
73
|
+
.setKeysList(this.keys)
|
|
74
|
+
.setMessageId(this.messageId)
|
|
75
|
+
.setBornTimestamp(Timestamp.fromDate(new Date()))
|
|
76
|
+
.setBornHost(UserAgent.INSTANCE.hostname)
|
|
77
|
+
.setBodyEncoding(Encoding.IDENTITY)
|
|
78
|
+
.setQueueId(mq.queueId)
|
|
79
|
+
.setMessageType(this.messageType);
|
|
80
|
+
if (this.tag) {
|
|
81
|
+
systemProperties.setTag(this.tag);
|
|
82
|
+
}
|
|
83
|
+
if (this.deliveryTimestamp) {
|
|
84
|
+
systemProperties.setDeliveryTimestamp(Timestamp.fromDate(this.deliveryTimestamp));
|
|
85
|
+
}
|
|
86
|
+
if (this.messageGroup) {
|
|
87
|
+
systemProperties.setMessageGroup(this.messageGroup);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const resource = createResource(this.topic);
|
|
91
|
+
resource.setResourceNamespace(namespace);
|
|
92
|
+
const message = new MessagePB()
|
|
93
|
+
.setTopic(resource)
|
|
94
|
+
.setBody(this.body)
|
|
95
|
+
.setSystemProperties(systemProperties);
|
|
96
|
+
if (this.properties) {
|
|
97
|
+
const userProperties = message.getUserPropertiesMap();
|
|
98
|
+
for (const [ key, value ] of this.properties.entries()) {
|
|
99
|
+
userProperties.set(key, value);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return message;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export * from './Message';
|
|
19
|
+
export * from './MessageId';
|
|
20
|
+
export * from './MessageView';
|
|
21
|
+
export * from './PublishingMessage';
|