Skip to content
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

Make EndpointRegistry extends Map<NormalizedEndpointUri, Endpoint> #14066

Merged
merged 3 commits into from May 15, 2024

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented May 7, 2024

Change the CamelContext.getEndpointRegistry() to return an EndpointRegistry<NormalizedEndpointUri> instead of an EndpointRegistry<? extends ValueHolder<String>>.

This is a small incompatible change.

Copy link
Contributor

github-actions bot commented May 7, 2024

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet gnodet requested a review from davsclaus May 7, 2024 06:33
@davsclaus
Copy link
Contributor

You can add a note about this API change in the Camel 4.7 upgrade page

@orpiske
Copy link
Contributor

orpiske commented May 7, 2024

Probably a good one to run full tests on.

@davsclaus
Copy link
Contributor

You likely need to update code at places like

camel-rest/src/main/java/org/apache/camel/component/rest/DefaultRestRegistry.java

@davsclaus
Copy link
Contributor

You can do a

cd components
git grep getEndpointRegistry

@davsclaus davsclaus marked this pull request as draft May 8, 2024 11:20
@davsclaus
Copy link
Contributor

this PR needs to fix in the components as commented above

@gnodet gnodet force-pushed the cleanup-endpoint-registry branch from b85f37d to bfcb994 Compare May 13, 2024 22:49
@gnodet
Copy link
Contributor Author

gnodet commented May 14, 2024

this PR needs to fix in the components as commented above

In theory yes, in practice, no component is affected. The reason is that the K generic type in the EnpointRegistry is only used on keySet() and entrySet() methods, which are not used, and components, when they need to access the registry do so without using an intermediate variable which could cause a cast compilation error.

I'm actually wondering if that parameter is needed at all, and while we're changing this method, it may be simpler to just make EndpointRegistry non parameterised and extends Map<NormalizedEndpointUri, Endpoint>. @davsclaus thoughts ?

@gnodet gnodet requested a review from davsclaus May 14, 2024 06:29
@gnodet gnodet changed the title Change EndpointRegistry to use NormalizedEndpointUri Make EndpointRegistry non parameterized May 14, 2024
@gnodet gnodet changed the title Make EndpointRegistry non parameterized Make EndpointRegistry extends Map<NormalizedEndpointUri, Endpoint> May 14, 2024
@davsclaus
Copy link
Contributor

this PR needs to fix in the components as commented above

In theory yes, in practice, no component is affected. The reason is that the K generic type in the EnpointRegistry is only used on keySet() and entrySet() methods, which are not used, and components, when they need to access the registry do so without using an intermediate variable which could cause a cast compilation error.

I'm actually wondering if that parameter is needed at all, and while we're changing this method, it may be simpler to just make EndpointRegistry non parameterised and extends Map<NormalizedEndpointUri, Endpoint>. @davsclaus thoughts ?

Yes that is better as we dont need other kind of parameters at all

@davsclaus
Copy link
Contributor

org.apache.camel.issues.RecipientListUseOriginalMessageEndpointExceptionIssueTest.testRecipientListUseOriginalMessageIssue 1.822s FAILURE
org.apache.camel.builder.xml.XPathTest.testXPathSplitConcurrent 1.763s FAILURE

@gnodet gnodet force-pushed the cleanup-endpoint-registry branch from 67df844 to 8c7bb78 Compare May 14, 2024 13:10
@gnodet gnodet marked this pull request as ready for review May 14, 2024 13:23
@gnodet gnodet force-pushed the cleanup-endpoint-registry branch from 8c7bb78 to c1a676c Compare May 14, 2024 21:48
@gnodet gnodet merged commit 8334ef2 into apache:main May 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants