Skip to content

Fix priority issue.Supports lightweight messaging.#1215

Open
zhaohai666 wants to merge 35 commits intoapache:masterfrom
zhaohai666:fix-priority-issue
Open

Fix priority issue.Supports lightweight messaging.#1215
zhaohai666 wants to merge 35 commits intoapache:masterfrom
zhaohai666:fix-priority-issue

Conversation

@zhaohai666
Copy link
Copy Markdown
Contributor

@zhaohai666 zhaohai666 commented Apr 2, 2026

Fix priority issue.Supports lightweight messaging.

- Add LITE = 5 and PRIORITY = 6 to MessageType enum in definition.proto
- Align Node.js client with the latest protocol specification
- Fix inconsistency between proto definition and generated TypeScript/JS files
- Update protos submodule to include LITE and PRIORITY message types
- Sync nodejs proto definition with protocol changes
- Ensure npm run init preserves LITE and PRIORITY types
- Update definition.proto to include LITE and PRIORITY message types
- Generated from updated protos submodule using npm run init
- Ensures Node.js client stays in sync with protocol changes
- Add PRIORITY message type detection in PublishingMessage
- Set priority field in toProtobuf method
- Validate mutual exclusivity: priority cannot be used with messageGroup, deliveryTimestamp
- Ensure transactional messages cannot have priority set
- Add ProducerPriorityMessageExample demonstrating priority usage
- Align with Java implementation semantics

Key changes:
1. PublishingMessage: Detect PRIORITY message type and set it accordingly
2. PublishingMessage.toProtobuf(): Include priority in SystemProperties
3. Message: Validate priority >= 0 and mutual exclusivity constraints
4. Example: Comprehensive demo showing priority levels and validation
- Use (systemProperties as any).setPriority?.() as workaround
- Avoids TypeScript error when proto definition hasn't been updated yet
- Will work correctly once official proto includes priority field
- Maintains backward compatibility
@zhaohai666 zhaohai666 changed the title Fix priority issue Fix priority issue.Supports lightweight messaging. Apr 8, 2026
Comment thread nodejs/src/consumer/Consumer.ts
Comment thread nodejs/src/consumer/LiteSubscriptionManager.ts Outdated
Comment thread nodejs/src/consumer/OffsetOption.ts
Comment thread nodejs/src/consumer/ProcessQueue.ts Outdated
Comment thread nodejs/src/consumer/PushConsumer.ts Outdated
Comment thread nodejs/src/consumer/PushConsumer.ts
Comment thread nodejs/src/consumer/StandardConsumeService.ts Outdated
Comment thread nodejs/src/message/Message.ts
Comment thread nodejs/src/message/Message.ts
Comment thread nodejs/src/message/Message.ts
Comment thread nodejs/src/producer/Producer.ts
Comment thread nodejs/src/producer/Producer.ts Outdated
Comment thread nodejs/examples/LitePushConsumerExample.ts Outdated
Comment thread nodejs/src/consumer/OffsetOption.ts Outdated
Comment thread nodejs/src/client/TelemetrySession.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants