-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[PIP 95][Issue 12040][web] Topic lookup with listener header #12072
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
[PIP 95][Issue 12040][web] Topic lookup with listener header #12072
Conversation
|
I think it's not enough to only add the listener head to |
|
@wangjialing218 I agree, the advertised listener configuration does not apply to web service endpoints, it applies only to the Pulsar protocol endpoints. This PR is limited in scope. Let's discuss on the dev mailing list about whether #12040 should include this aspect. |
codelipenghui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, could you please also help add a test for the new change?
hangc0276
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good to me. Would you please add test for listenerName is empty and listenerNameHeader not null ?
|
@codelipenghui since this is a part of PIP-95 feature work, should probably target 2.9 not 2.8.2. Some of the other PRs are just bug fixes that could be in 2.8.2 in my opinion, but not this one. |
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
the failure is about a test related to this PR
|
- ensure that setup/teardown runs when `-Dgroup=broker`
- ensure that setup/teardown runs when `-Dgroup=broker`
- add logging statements
- use setup-per-class not setup-per-method
|
This is ready to merge. The test failure seems unrelated: |
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
* up/master: (37 commits) re-enabling integration tests for Sinks (apache#12307) [PIP 95][Issue 12040][web] Topic lookup with listener header (apache#12072) Fix the master CI broken with update dispatch rate block issue (apache#12360) Fix message being ignored when the non-persistent topic reader reconnect. (apache#12348) Fix log format. (apache#12346) [website][upgrade]feat: docs migration - version-2.7.2 Concepts and Architecture (apache#12354) [website][upgrade] feat: full docs migration for version 2.8.0 (apache#12359) [website][upgrade]feat: dynamic replace version info before build (apache#12337) Fix flaky tests: ElasticSearchClientTests (apache#12347) Use asyncCloseCursorLedger to replace cursorLedger.asyncClose method in the ManagedCursorImpl.VoidCallback#operationComplete (apache#12113) fix-npe-ZkBookieRackAffinityMapping (apache#11947) [pulsar-admin] Allow setting --forward-source-message-property to false when updating a pulsar function (apache#12128) [website][upgrade]feat: docs migration - Development (apache#12320) Update delete inactive topic configuration documentation (apache#12350) [PIP 95][Issue 12040][broker] Multiple bind addresses for Pulsar protocol (apache#12056) Added Debezium Source for MS SQL Server (apache#12256) Fix: flaky oracle tests (apache#12306) [C++] Use URL encoded content type for OAuth 2.0 authentication (apache#12341) [C++] Handle OAuth 2.0 exceptional cases gracefully (apache#12335) feat(cli): add restart command to pulsar-daemon (apache#12279) ... # Conflicts: # site2/website-next/docusaurus.config.js # site2/website-next/versioned_sidebars/version-2.7.2-sidebars.json # site2/website-next/versions.json
…12072) Master Issue: apache#12040 ### Motivation This PR introduces an optional HTTP header `X-Pulsar-ListenerName` to the `TopicLookup` operation of the Pulsar REST API. The header supplies the listener name to use when the broker has multiple advertised listeners. Today the `TopicLookup` operation accepts a query parameter `listenerName` for that same purpose. The motivation for adding a header-based alternative is to improve support smart listener selection via HTTP gateways or proxies that are capable of rewriting headers (see: [Istio VirtualService](https://istio.io/latest/docs/reference/config/networking/virtual-service/#Headers)). See apache#12040 for more background. ### Modifications - Modify `TopicLookup` operation (V1 + V2) to use a header (query string takes precedence).
Master Issue: #12040
Motivation
This PR introduces an optional HTTP header
X-Pulsar-ListenerNameto theTopicLookupoperation of the Pulsar REST API. The header supplies the listener name to use when the broker has multiple advertised listeners. Today theTopicLookupoperation accepts a query parameterlistenerNamefor that same purpose.The motivation for adding a header-based alternative is to improve support smart listener selection via HTTP gateways or proxies that are capable of rewriting headers (see: Istio VirtualService).
See #12040 for more background.
Modifications
TopicLookupoperation (V1 + V2) to use a header (query string takes precedence).Verifying this change
The
TopicLookupoperation doesn't seem to have any unit tests.Tested using ad-hoc queries, for example against a cluster that has a
gatewaylistener.Does this pull request potentially affect one of the following parts:
Documentation
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
doc
(javadocs)