strive1216 opened a new pull request, #1190:
URL: https://github.com/apache/rocketmq-clients/pull/1190
### Brief Description
This PR adds namespace support for the Rust client with two key changes:
1. Add x-mq-namespace header in session requests (rust/src/session.rs)
- When the namespace is configured and not empty, the client now
includes an x-mq-namespace header in the gRPC metadata
- This ensures the server can properly route requests to the correct
namespace
2. Propagate namespace from ClientOption to SimpleConsumerOption
(rust/src/simple_consumer.rs)
- If SimpleConsumerOption has a namespace set, use it directly
- Otherwise, fall back to the namespace configured in ClientOption
- This provides flexibility for users to configure namespace at either
the client level or the consumer level
These changes align the Rust client behavior with other language clients
(Java, Go, etc.) that already support namespace headers.
### How Did You Test This Change?
- Verified that when namespace is configured, the x-mq-namespace header is
correctly added to gRPC requests
- Tested SimpleConsumer with namespace set at both SimpleConsumerOption
level and ClientOption level to ensure proper fallback behavior
- Confirmed backward compatibility: when namespace is empty/not set, no
header is added and behavior remains unchanged
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]