Skip to content

Application state information 4657#5261

Open
Gavrilov-Ivan wants to merge 2 commits into
masterfrom
4657-application-state-information
Open

Application state information 4657#5261
Gavrilov-Ivan wants to merge 2 commits into
masterfrom
4657-application-state-information

Conversation

@Gavrilov-Ivan
Copy link
Copy Markdown
Collaborator

See #4657

  • Added compile only dependency org.springframework.boot:spring-boot-web-server to be able to get effective port number in case of randomly assigned one.
  • Consider to also add logging to output application info to console on startup instead of logging in project side in main application class (created from template) which is not accurate rignt now.

@Gavrilov-Ivan Gavrilov-Ivan requested a review from knstvk May 7, 2026 12:52
@Gavrilov-Ivan Gavrilov-Ivan linked an issue May 7, 2026 that may be closed by this pull request
}

protected Path resolveAppInfoFileLocation() {
String confDir = coreProperties.getConfDir();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you using conf dir intentionally, to be cleaned on startup?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

File is stored to <conf>/app-info/app-info.json according to request from Studio.
This file is explicitly removed on shutdown via shutdown hook - cleanConf task can be disabled.

return root;
}

protected void writeFile(Path fileLocation, JsonObject json) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As far as I understand, in the current implementation the file will be written even in production when using an embedded web server. I think we need an application property to disable writing the file. For example jmix.application-info-file.enabled

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added jmix.core.application-info-file-enabled property to fit current core properties structure. true by default.

@Gavrilov-Ivan Gavrilov-Ivan requested a review from knstvk May 12, 2026 11:43

@Component("core_ApplicationInfoProvider")
@ConditionalOnClass(WebServerApplicationContext.class)
public class ApplicationInfoProvider {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If it's a public class, add some Javadocs. Or maybe move it to impl or make internal otherwise? Does it make sense to make it a public API?

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.

Application state information

2 participants