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

Fix #518 Rely on configurers for Configuration classes instead of using #647

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

ppalaga
Copy link
Contributor

@ppalaga ppalaga commented Jan 21, 2020

reflection

Removal of NettyConfiguration, NettyServerBootstrapConfiguration, PdfConfiguration registration led to native failures so these need a separate investigation.

@lburgazzoli
Copy link
Contributor

ok to test

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 22, 2020

Strange, the Consul test is passing for me locally. Let me figure out what is different here.

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 22, 2020

A race for the configurers set on the component is my first theory.

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 22, 2020

A race for the configurers set on the component is my first theory.

Much simpler: stale deployment modules in my local Maven repo

Jenkins was right and I can reproduce.

Looks like this change needs to wait for Camel 3.1.0 because https://issues.apache.org/jira/browse/CAMEL-14263 was not fixed for all components in 3.0.1.

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 23, 2020

36102f2 rebased and tested properly

"org.apache.camel.component.fhir.FhirHistoryEndpointConfiguration",
"org.apache.camel.component.fhir.FhirMetaEndpointConfiguration",
"org.apache.camel.component.fhir.FhirPatchEndpointConfiguration",
"org.apache.camel.component.fhir.FhirDeleteEndpointConfiguration",
Copy link
Contributor

@lburgazzoli lburgazzoli Jan 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would' be better to have a build item generated by the respective extensions ? developer writing custom camel component extension outside this repo could also leverage that build item if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'd prefer a central location to see better what is whitelisted. I hope the list will gradually disappear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But external extension won't have a way to make it working

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I was thinking of creating a dedicated extension for this (let's call it "policy extension") that would only be pulled by our tests. This would allow us to enforce the policy for our extensions and let 3rd party extensions do what they want. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really do not like to have to touch core to make an extension working so if it were me to decide, I'd go for a simple build item also, I do not know it it really make sense to put such enforcement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really do not like to have to touch core to make an extension working so if it were me to decide, I'd go for a simple build item.

I still think policy definitions are better to keep centrally, but OK, let me try to implement this with a build item.

also, I do not know it it really make sense to put such enforcement

Well, I think this is the most effective, scalable (and sustainable) way to reduce the use of reflection. I do not think it is possible to be able to keep control once we will have 100+ extensions.

.collect(Collectors.toSet());

if (!violations.isEmpty()) {
throw new IllegalStateException(
Copy link
Contributor

@lburgazzoli lburgazzoli Jan 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the camel components have a property that can control if the generated configurer have to be used or not so as long as the property is there, I feel we should log a warning but I'd rather avoid to fail the build.

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 23, 2020

c4c1663 introduces a build item as requested by @lburgazzoli

.collect(Collectors.toSet());

if (!violations.isEmpty()) {
throw new IllegalStateException(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we really fail the build ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is only with our tests. It won't happen at runtime (unless the user explictly depends on the new policy extension)

"org.apache.camel.component.consul.ConsulConfiguration",
"org.apache.camel.component.consul.ConsulClientConfiguration",
"org.apache.camel.component.consul.health.ConsulHealthCheckRepositoryConfiguration",
"org.apache.camel.component.consul.cloud.ConsulServiceRegistryConfiguration");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not change much from the previous implementation as when we'll remove i.e. PdfConfiguration from the pdf extension we have to remember to get to this artefact and change it.

I really don't get why this should not be side-by-side with the code declaring the need for the reflective classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the anomalies we need to tackle. They will hopefully disappear soon. If some of these turns out to be more stable, the item can be moved to the respective extension.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I give up :)

@lburgazzoli lburgazzoli merged commit 2dfafe3 into apache:master Jan 23, 2020
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.

None yet

3 participants