rocketmq-client-nodejs 1.0.3 → 1.0.5

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.
Files changed (153) hide show
  1. package/README.md +84 -1
  2. package/dist/client/BaseClient.d.ts +24 -2
  3. package/dist/client/BaseClient.js +173 -28
  4. package/dist/client/ClientId.js +2 -2
  5. package/dist/client/Logger.d.ts +1 -0
  6. package/dist/client/Logger.js +1 -1
  7. package/dist/client/RpcClient.d.ts +3 -1
  8. package/dist/client/RpcClient.js +23 -1
  9. package/dist/client/RpcClientManager.d.ts +3 -1
  10. package/dist/client/RpcClientManager.js +23 -4
  11. package/dist/client/TelemetrySession.d.ts +1 -0
  12. package/dist/client/TelemetrySession.js +47 -9
  13. package/dist/consumer/Assignment.d.ts +24 -0
  14. package/dist/consumer/Assignment.js +40 -0
  15. package/dist/consumer/Assignments.d.ts +25 -0
  16. package/dist/consumer/Assignments.js +55 -0
  17. package/dist/consumer/ConsumeResult.d.ts +20 -0
  18. package/dist/consumer/ConsumeResult.js +25 -0
  19. package/dist/consumer/ConsumeService.d.ts +28 -0
  20. package/dist/consumer/ConsumeService.js +53 -0
  21. package/dist/consumer/ConsumeTask.d.ts +24 -0
  22. package/dist/consumer/ConsumeTask.js +39 -0
  23. package/dist/consumer/Consumer.d.ts +19 -1
  24. package/dist/consumer/Consumer.js +64 -21
  25. package/dist/consumer/FifoConsumeService.d.ts +25 -0
  26. package/dist/consumer/FifoConsumeService.js +130 -0
  27. package/dist/consumer/FilterExpression.d.ts +2 -0
  28. package/dist/consumer/FilterExpression.js +18 -1
  29. package/dist/consumer/LitePushConsumer.d.ts +161 -0
  30. package/dist/consumer/LitePushConsumer.js +172 -0
  31. package/dist/consumer/LitePushConsumerImpl.d.ts +167 -0
  32. package/dist/consumer/LitePushConsumerImpl.js +193 -0
  33. package/dist/consumer/LiteSubscriptionManager.d.ts +97 -0
  34. package/dist/consumer/LiteSubscriptionManager.js +236 -0
  35. package/dist/consumer/MessageListener.d.ts +21 -0
  36. package/dist/consumer/MessageListener.js +19 -0
  37. package/dist/consumer/OffsetOption.d.ts +109 -0
  38. package/dist/consumer/OffsetOption.js +191 -0
  39. package/dist/consumer/ProcessQueue.d.ts +39 -0
  40. package/dist/consumer/ProcessQueue.js +293 -0
  41. package/dist/consumer/PushConsumer.d.ts +88 -0
  42. package/dist/consumer/PushConsumer.js +449 -0
  43. package/dist/consumer/PushSubscriptionSettings.d.ts +31 -0
  44. package/dist/consumer/PushSubscriptionSettings.js +97 -0
  45. package/dist/consumer/SimpleConsumer.d.ts +12 -1
  46. package/dist/consumer/SimpleConsumer.js +54 -10
  47. package/dist/consumer/SimpleSubscriptionSettings.d.ts +2 -2
  48. package/dist/consumer/SimpleSubscriptionSettings.js +3 -3
  49. package/dist/consumer/StandardConsumeService.d.ts +25 -0
  50. package/dist/consumer/StandardConsumeService.js +50 -0
  51. package/dist/consumer/index.d.ts +15 -0
  52. package/dist/consumer/index.js +19 -1
  53. package/dist/exception/InternalErrorException.d.ts +5 -0
  54. package/dist/exception/InternalErrorException.js +10 -1
  55. package/dist/exception/LiteSubscriptionQuotaExceededException.d.ts +23 -0
  56. package/dist/exception/LiteSubscriptionQuotaExceededException.js +31 -0
  57. package/dist/exception/LiteTopicQuotaExceededException.d.ts +23 -0
  58. package/dist/exception/LiteTopicQuotaExceededException.js +31 -0
  59. package/dist/exception/StatusChecker.js +4 -1
  60. package/dist/exception/index.d.ts +2 -0
  61. package/dist/exception/index.js +3 -1
  62. package/dist/index.d.ts +1 -0
  63. package/dist/index.js +2 -1
  64. package/dist/message/Message.d.ts +8 -0
  65. package/dist/message/Message.js +39 -6
  66. package/dist/message/MessageId.d.ts +2 -0
  67. package/dist/message/MessageId.js +17 -1
  68. package/dist/message/MessageView.d.ts +86 -0
  69. package/dist/message/MessageView.js +115 -1
  70. package/dist/message/PublishingMessage.js +21 -5
  71. package/dist/producer/Producer.d.ts +21 -2
  72. package/dist/producer/Producer.js +120 -25
  73. package/dist/producer/PublishingLoadBalancer.d.ts +2 -0
  74. package/dist/producer/PublishingLoadBalancer.js +23 -1
  75. package/dist/producer/RecallReceipt.d.ts +25 -0
  76. package/dist/producer/RecallReceipt.js +34 -0
  77. package/dist/producer/SendReceipt.d.ts +2 -1
  78. package/dist/producer/SendReceipt.js +6 -3
  79. package/dist/producer/Transaction.js +7 -1
  80. package/dist/producer/index.d.ts +1 -0
  81. package/dist/producer/index.js +2 -1
  82. package/dist/route/Broker.d.ts +2 -0
  83. package/dist/route/Broker.js +21 -1
  84. package/dist/route/Endpoints.d.ts +2 -0
  85. package/dist/route/Endpoints.js +36 -1
  86. package/dist/route/MessageQueue.d.ts +2 -0
  87. package/dist/route/MessageQueue.js +23 -1
  88. package/dist/route/Resource.d.ts +54 -0
  89. package/dist/route/Resource.js +100 -0
  90. package/dist/route/TopicRouteData.d.ts +12 -0
  91. package/dist/route/TopicRouteData.js +37 -1
  92. package/dist/route/index.d.ts +1 -0
  93. package/dist/route/index.js +2 -1
  94. package/dist/util/index.d.ts +8 -0
  95. package/dist/util/index.js +20 -1
  96. package/package.json +2 -2
  97. package/proto/apache/rocketmq/v2/definition.proto +56 -0
  98. package/proto/apache/rocketmq/v2/definition_pb.d.ts +100 -0
  99. package/proto/apache/rocketmq/v2/definition_pb.js +570 -4
  100. package/proto/apache/rocketmq/v2/service.proto +65 -0
  101. package/proto/apache/rocketmq/v2/service_grpc_pb.d.ts +34 -0
  102. package/proto/apache/rocketmq/v2/service_grpc_pb.js +81 -4
  103. package/proto/apache/rocketmq/v2/service_pb.d.ts +211 -0
  104. package/proto/apache/rocketmq/v2/service_pb.js +1691 -25
  105. package/src/client/BaseClient.ts +196 -28
  106. package/src/client/ClientId.ts +1 -1
  107. package/src/client/Logger.ts +1 -0
  108. package/src/client/RpcClient.ts +26 -0
  109. package/src/client/RpcClientManager.ts +27 -3
  110. package/src/client/TelemetrySession.ts +54 -8
  111. package/src/consumer/Assignment.ts +40 -0
  112. package/src/consumer/Assignments.ts +55 -0
  113. package/src/consumer/ConsumeResult.ts +21 -0
  114. package/src/consumer/ConsumeService.ts +72 -0
  115. package/src/consumer/ConsumeTask.ts +39 -0
  116. package/src/consumer/Consumer.ts +76 -20
  117. package/src/consumer/FifoConsumeService.ts +146 -0
  118. package/src/consumer/FilterExpression.ts +17 -0
  119. package/src/consumer/LitePushConsumer.ts +256 -0
  120. package/src/consumer/LitePushConsumerImpl.ts +245 -0
  121. package/src/consumer/LiteSubscriptionManager.ts +352 -0
  122. package/src/consumer/MessageListener.ts +23 -0
  123. package/src/consumer/OffsetOption.ts +203 -0
  124. package/src/consumer/ProcessQueue.ts +339 -0
  125. package/src/consumer/PushConsumer.ts +563 -0
  126. package/src/consumer/PushSubscriptionSettings.ts +124 -0
  127. package/src/consumer/SimpleConsumer.ts +68 -11
  128. package/src/consumer/SimpleSubscriptionSettings.ts +2 -2
  129. package/src/consumer/StandardConsumeService.ts +57 -0
  130. package/src/consumer/index.ts +15 -0
  131. package/src/exception/InternalErrorException.ts +10 -0
  132. package/src/exception/LiteSubscriptionQuotaExceededException.ts +28 -0
  133. package/src/exception/LiteTopicQuotaExceededException.ts +28 -0
  134. package/src/exception/StatusChecker.ts +3 -0
  135. package/src/exception/index.ts +2 -0
  136. package/src/index.ts +1 -0
  137. package/src/message/Message.ts +46 -5
  138. package/src/message/MessageId.ts +16 -0
  139. package/src/message/MessageView.ts +127 -0
  140. package/src/message/PublishingMessage.ts +20 -4
  141. package/src/producer/Producer.ts +144 -24
  142. package/src/producer/PublishingLoadBalancer.ts +21 -0
  143. package/src/producer/RecallReceipt.ts +32 -0
  144. package/src/producer/SendReceipt.ts +5 -2
  145. package/src/producer/Transaction.ts +16 -0
  146. package/src/producer/index.ts +1 -0
  147. package/src/route/Broker.ts +20 -0
  148. package/src/route/Endpoints.ts +32 -0
  149. package/src/route/MessageQueue.ts +23 -1
  150. package/src/route/Resource.ts +104 -0
  151. package/src/route/TopicRouteData.ts +37 -0
  152. package/src/route/index.ts +1 -0
  153. package/src/util/index.ts +19 -0
@@ -401,6 +401,16 @@ export class SystemProperties extends jspb.Message {
401
401
  getDeadLetterQueue(): DeadLetterQueue | undefined;
402
402
  setDeadLetterQueue(value?: DeadLetterQueue): SystemProperties;
403
403
 
404
+ hasLiteTopic(): boolean;
405
+ clearLiteTopic(): void;
406
+ getLiteTopic(): string | undefined;
407
+ setLiteTopic(value: string): SystemProperties;
408
+
409
+ hasPriority(): boolean;
410
+ clearPriority(): void;
411
+ getPriority(): number | undefined;
412
+ setPriority(value: number): SystemProperties;
413
+
404
414
  serializeBinary(): Uint8Array;
405
415
  toObject(includeInstance?: boolean): SystemProperties.AsObject;
406
416
  static toObject(includeInstance: boolean, msg: SystemProperties): SystemProperties.AsObject;
@@ -433,6 +443,8 @@ export namespace SystemProperties {
433
443
  traceContext?: string,
434
444
  orphanedTransactionRecoveryDuration?: google_protobuf_duration_pb.Duration.AsObject,
435
445
  deadLetterQueue?: DeadLetterQueue.AsObject,
446
+ liteTopic?: string,
447
+ priority?: number,
436
448
  }
437
449
  }
438
450
 
@@ -701,6 +713,16 @@ export class Subscription extends jspb.Message {
701
713
  getLongPollingTimeout(): google_protobuf_duration_pb.Duration | undefined;
702
714
  setLongPollingTimeout(value?: google_protobuf_duration_pb.Duration): Subscription;
703
715
 
716
+ hasLiteSubscriptionQuota(): boolean;
717
+ clearLiteSubscriptionQuota(): void;
718
+ getLiteSubscriptionQuota(): number | undefined;
719
+ setLiteSubscriptionQuota(value: number): Subscription;
720
+
721
+ hasMaxLiteTopicSize(): boolean;
722
+ clearMaxLiteTopicSize(): void;
723
+ getMaxLiteTopicSize(): number | undefined;
724
+ setMaxLiteTopicSize(value: number): Subscription;
725
+
704
726
  serializeBinary(): Uint8Array;
705
727
  toObject(includeInstance?: boolean): Subscription.AsObject;
706
728
  static toObject(includeInstance: boolean, msg: Subscription): Subscription.AsObject;
@@ -718,6 +740,8 @@ export namespace Subscription {
718
740
  fifo?: boolean,
719
741
  receiveBatchSize?: number,
720
742
  longPollingTimeout?: google_protobuf_duration_pb.Duration.AsObject,
743
+ liteSubscriptionQuota?: number,
744
+ maxLiteTopicSize?: number,
721
745
  }
722
746
  }
723
747
 
@@ -747,6 +771,65 @@ export namespace Metric {
747
771
  }
748
772
  }
749
773
 
774
+ export class OffsetOption extends jspb.Message {
775
+
776
+ hasPolicy(): boolean;
777
+ clearPolicy(): void;
778
+ getPolicy(): OffsetOption.Policy;
779
+ setPolicy(value: OffsetOption.Policy): OffsetOption;
780
+
781
+ hasOffset(): boolean;
782
+ clearOffset(): void;
783
+ getOffset(): number;
784
+ setOffset(value: number): OffsetOption;
785
+
786
+ hasTailN(): boolean;
787
+ clearTailN(): void;
788
+ getTailN(): number;
789
+ setTailN(value: number): OffsetOption;
790
+
791
+ hasTimestamp(): boolean;
792
+ clearTimestamp(): void;
793
+ getTimestamp(): number;
794
+ setTimestamp(value: number): OffsetOption;
795
+
796
+ getOffsetTypeCase(): OffsetOption.OffsetTypeCase;
797
+
798
+ serializeBinary(): Uint8Array;
799
+ toObject(includeInstance?: boolean): OffsetOption.AsObject;
800
+ static toObject(includeInstance: boolean, msg: OffsetOption): OffsetOption.AsObject;
801
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
802
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
803
+ static serializeBinaryToWriter(message: OffsetOption, writer: jspb.BinaryWriter): void;
804
+ static deserializeBinary(bytes: Uint8Array): OffsetOption;
805
+ static deserializeBinaryFromReader(message: OffsetOption, reader: jspb.BinaryReader): OffsetOption;
806
+ }
807
+
808
+ export namespace OffsetOption {
809
+ export type AsObject = {
810
+ policy: OffsetOption.Policy,
811
+ offset: number,
812
+ tailN: number,
813
+ timestamp: number,
814
+ }
815
+
816
+ export enum Policy {
817
+ LAST = 0,
818
+ MIN = 1,
819
+ MAX = 2,
820
+ }
821
+
822
+
823
+ export enum OffsetTypeCase {
824
+ OFFSET_TYPE_NOT_SET = 0,
825
+ POLICY = 1,
826
+ OFFSET = 2,
827
+ TAIL_N = 3,
828
+ TIMESTAMP = 4,
829
+ }
830
+
831
+ }
832
+
750
833
  export enum TransactionResolution {
751
834
  TRANSACTION_RESOLUTION_UNSPECIFIED = 0,
752
835
  COMMIT = 1,
@@ -786,6 +869,8 @@ export enum MessageType {
786
869
  FIFO = 2,
787
870
  DELAY = 3,
788
871
  TRANSACTION = 4,
872
+ LITE = 5,
873
+ PRIORITY = 6,
789
874
  }
790
875
 
791
876
  export enum DigestType {
@@ -801,6 +886,8 @@ export enum ClientType {
801
886
  PUSH_CONSUMER = 2,
802
887
  SIMPLE_CONSUMER = 3,
803
888
  PULL_CONSUMER = 4,
889
+ LITE_PUSH_CONSUMER = 5,
890
+ LITE_SIMPLE_CONSUMER = 6,
804
891
  }
805
892
 
806
893
  export enum Encoding {
@@ -832,6 +919,8 @@ export enum Code {
832
919
  MESSAGE_CORRUPTED = 40016,
833
920
  CLIENT_ID_REQUIRED = 40017,
834
921
  ILLEGAL_POLLING_TIME = 40018,
922
+ ILLEGAL_OFFSET = 40019,
923
+ ILLEGAL_LITE_TOPIC = 40020,
835
924
  UNAUTHORIZED = 40100,
836
925
  PAYMENT_REQUIRED = 40200,
837
926
  FORBIDDEN = 40300,
@@ -839,11 +928,15 @@ export enum Code {
839
928
  MESSAGE_NOT_FOUND = 40401,
840
929
  TOPIC_NOT_FOUND = 40402,
841
930
  CONSUMER_GROUP_NOT_FOUND = 40403,
931
+ OFFSET_NOT_FOUND = 40404,
842
932
  REQUEST_TIMEOUT = 40800,
843
933
  PAYLOAD_TOO_LARGE = 41300,
844
934
  MESSAGE_BODY_TOO_LARGE = 41301,
935
+ MESSAGE_BODY_EMPTY = 41302,
845
936
  PRECONDITION_FAILED = 42800,
846
937
  TOO_MANY_REQUESTS = 42900,
938
+ LITE_TOPIC_QUOTA_EXCEEDED = 42901,
939
+ LITE_SUBSCRIPTION_QUOTA_EXCEEDED = 42902,
847
940
  REQUEST_HEADER_FIELDS_TOO_LARGE = 43100,
848
941
  MESSAGE_PROPERTIES_TOO_LARGE = 43101,
849
942
  INTERNAL_ERROR = 50000,
@@ -875,6 +968,13 @@ export enum Language {
875
968
  KOTLIN = 12,
876
969
  }
877
970
 
971
+ export enum LiteSubscriptionAction {
972
+ PARTIAL_ADD = 0,
973
+ PARTIAL_REMOVE = 1,
974
+ COMPLETE_ADD = 2,
975
+ COMPLETE_REMOVE = 3,
976
+ }
977
+
878
978
  export enum QueryOffsetPolicy {
879
979
  BEGINNING = 0,
880
980
  END = 1,