forked from apache/pulsar-client-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix topic not shown correctly in the consumer string (apache#329)
### Motivation `ConsumerImpl::getName()` returns a string that is used in logs to represent the consumer. However, the topic part does not show correctly: ``` ConsumerImpl:283 | [0x6000001c88b8, consumer-1, 0] Created consumer on broker [127.0.0.1:60399 -> 127.0.0.1:6650] ``` It's because after apache#218, the `ConsumerImpl::topic_` field becomes `std::shared_ptr` rather than a `std::string` but it is still used to construct the `consumerStr_`. ### Modifications Construct the `consumerStr_` using the `topic` argument in the constructor and make `consumerStr_` const because it is never changed. Now the logs will be like: ``` ConsumerImpl:280 | [persistent://public/default/my-topic, consumer-1, 0] Created consumer on broker [127.0.0.1:60647 -> 127.0.0.1:6650] ```
- Loading branch information
1 parent
5c77648
commit 33085eb
Showing
4 changed files
with
4 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters