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

FISH-10055 Introduce Payara Micro Global Context Root Support #7187

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kalinchan
Copy link
Member

@kalinchan kalinchan commented Feb 11, 2025

Description

A user can specify the payaramicro.globalContextRoot property to specify the global context root for any application deployed.

e.g.
payaramicro.globalContextRoot = portal
application1 context root = app1
application2 context root = app2

Results in /portal/app1 and /portal/app2

Important Info

Blockers

n/a

Testing

New tests

n/a

Testing Performed

Testing performed in separate issue

Testing Environment

Documentation

pending

Notes for Reviewers

@@ -239,4 +249,18 @@ void runJSPC(final DeploymentContext dc) throws DeploymentException {
throw de;
}
}

private String getProperty(String value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this use TranslateConfigView?

@@ -136,6 +136,16 @@ public <V> V loadMetaData(Class<V> type, DeploymentContext dc) {
if (contextRoot == null)
contextRoot = ((GenericHandler)dc.getArchiveHandler()).getDefaultApplicationNameFromArchiveName(dc.getOriginalSource());


if (this.env.getRuntimeType().isMicro()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: I see this kind of code more and more sprinkled throughout the codebase.
This is a code smell. There should be a strategy pattern utilized here to get more cohesion / convergence of code that belongs in Micro / Server / DAS / instance

@Pandrex247
Copy link
Member

Why are we defining this via system or environment property? Shouldn't this just be a Payara Micro boot option?
java -jar payara-micro.jar --globalcontextroot /wibbles --contextRoot /wobbles

@Pandrex247
Copy link
Member

Reading via environment variable seems a logical configuration mechanism, but system property I'm less sure about

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.

3 participants