-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Bug] Topic Lookup on non-existent topics unexpected response. #13028
Labels
type/bug
The PR fixed a bug or issue reported a bug
Comments
ronfarkash
changed the title
[Bug]
[Bug] Topic Lookup on non-existent topics unexpected response.
Nov 29, 2021
I can help with this problem. |
2.8.1 |
3 tasks
BewareMyPower
pushed a commit
that referenced
this issue
Dec 14, 2021
Fixes #13028 ### Motivation For now, the result of the `lookup` command for a topic not existing by the rest API will return a brokerUrl. This pull request resolves this problem. ### Modifications Add topic exist check before get the brokerUrl 1. if not exist, return a ResetException with status code NOT_FOUND 2. if exist, get the brokerUrl ### Verifying this change This change added tests and can be verified as follows: HttpTopicLookupv2Test.testLookupTopicNotExist
fxbing
pushed a commit
to fxbing/pulsar
that referenced
this issue
Dec 19, 2021
…#13055) Fixes apache#13028 ### Motivation For now, the result of the `lookup` command for a topic not existing by the rest API will return a brokerUrl. This pull request resolves this problem. ### Modifications Add topic exist check before get the brokerUrl 1. if not exist, return a ResetException with status code NOT_FOUND 2. if exist, get the brokerUrl ### Verifying this change This change added tests and can be verified as follows: HttpTopicLookupv2Test.testLookupTopicNotExist
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using the Rest API to look up a topic
http://{broker}/lookup/v2/topic/persistent/{tenant}/{namespace}/{topic}
on a topic that does not exist, two things can happen:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect to receive 404 Topic not found.
Desktop (please complete the following information):
Additional Context
To my understanding when performing Rest API requests for topics/namespaces (anything related to ownership) the broker will first check if it owns the object you were referring to, else it will return a redirect (307) to the broker who owns the topic.
In this case the Topic does not exist, therefore I should not get a 200 with a broker name, I should instead get 404 not found.
The text was updated successfully, but these errors were encountered: