Skip to content

Fix topic name is shown as a pointer rather than string #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

BewareMyPower
Copy link
Contributor

Motivation

This is an additional fix to #329 because I still observed logs like:

Closing consumer for topic 0x6000028e0648
Closing producer for topic 0x600001210b88

It's because HandlerBase::topic_ field is protected and could be accessed directly from the derived classes.

Motivation

In HandlerBase, make topic_ private and add two methods topic() and getTopicPtr() to get the reference to the string and the shared pointer. getTopicPtr() should only be called when being passed to MessageImpl::setTopicName.

### Motivation

This is an additional fix to apache#329 because I still observed logs like:

```
Closing consumer for topic 0x6000028e0648
Closing producer for topic 0x600001210b88
```

It's because `HandlerBase::topic_` field is protected and could be
accessed directly from the derived classes.

### Motivation

In `HandlerBase`, make `topic_` private and add two methods `topic()`
and `getTopicPtr()` to get the reference to the string and the shared
pointer. `getTopicPtr()` should only be called when being passed to
`MessageImpl::setTopicName`.
@BewareMyPower BewareMyPower added this to the 3.4.0 milestone Oct 20, 2023
@BewareMyPower BewareMyPower self-assigned this Oct 20, 2023
@BewareMyPower BewareMyPower merged commit 7cefe0e into apache:main Oct 20, 2023
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-topic-representation branch October 20, 2023 05:00
BewareMyPower added a commit to streamnative/pulsar-client-cpp that referenced this pull request Oct 20, 2023
### Motivation

This is an additional fix to apache#329 because I still observed logs like:

```
Closing consumer for topic 0x6000028e0648
Closing producer for topic 0x600001210b88
```

It's because `HandlerBase::topic_` field is protected and could be
accessed directly from the derived classes.

### Motivation

In `HandlerBase`, make `topic_` private and add two methods `topic()`
and `getTopicPtr()` to get the reference to the string and the shared
pointer. `getTopicPtr()` should only be called when being passed to
`MessageImpl::setTopicName`.

(cherry picked from commit 7cefe0e)
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.

3 participants