Skip to content

Main server ResourceConfigCustomizers should not apply to management context #17801

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

Closed
raphw opened this issue Aug 7, 2019 · 1 comment
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@raphw
Copy link

raphw commented Aug 7, 2019

Any ResourceConfigCustomizer bean is applied within the JerseyAutoConfiguration but also in the JerseyManagementContextConfiguration. It is not currently possible to exclude the bean's application in the management context. This can be a relevant problem if the management server runs on a different port.

If a singleton resource is registered in both contexts, this breaks the singleton contract as the API is now reachable via two ResourceConfigs on two different ports.

Therefore, it should be possible to restrict the application of ResourceConfigCustomizer to the main server. Currently, it is only possible to register an API exclusively in the management server via @ManagementContextConfiguration.

@raphw raphw changed the title Jersey ResourceConfigContributor is always applied to Jersey ResourceConfigContributor is always applied to the management server Aug 7, 2019
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 7, 2019
@mbhave mbhave added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 7, 2019
@mbhave mbhave added this to the 2.1.x milestone Aug 7, 2019
@mbhave
Copy link
Contributor

mbhave commented Aug 7, 2019

IIRC, the only ResourceConfigCustomizer that's required to be applied by the management context is the one that registers the endpoint resources. Instead of marking the customizers as main server only, we should look at applying that configuration without needing to apply all the other customizers.

@mbhave mbhave changed the title Jersey ResourceConfigContributor is always applied to the management server Main server ResourceConfigCustomizers should not apply to management context Aug 9, 2019
@mbhave mbhave self-assigned this Sep 24, 2019
@philwebb philwebb added for: team-meeting An issue we'd like to discuss as a team to make progress type: blocker An issue that is blocking us from releasing and removed for: team-meeting An issue we'd like to discuss as a team to make progress type: blocker An issue that is blocking us from releasing labels Sep 25, 2019
@philwebb philwebb modified the milestones: 2.1.x, 2.1.9 Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants