You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry but I've really read the issue notes and asked a question on StackOverflow(Question Link Here) before, but got no answers for 10 days. This problem is really important for me so hope I can get some help here, Thanks!
Below is the question copy:
We have integrated spring-boot-admin into many projects. Now, due to some tricky network reasons, I am unable to access the built-in UI interface of SBA. Therefore, I would like to periodically retrieve the equivalent information from its interface programmatically and write it to the database, so that I can read and present it from another program.
The simplest way seems to be to curl the application interface, but considering the timing logic and SBA are in the same program, I want to minimize unnecessary network calls. After some preliminary research, I wrote the following code(in Kotlin):
//Autowiredprivateval registry:ApplicationRegistryfunrefreshAppRegistry() {
//I want get it synchronously, so Flux etc is not neededval applications = registry.applications.collectList().block()?.filterNotNull().orEmpty()
//Handle data, the way I retrieve fields just like:
appName = app.name,
serviceUrl = it.registration.serviceUrl.orEmpty(),
managementUrl = it.registration.managementUrl,
buildVersion = it.buildVersion?.value,
instanceStatus = it.statusInfo.status,
}
However, I found that the information I retrieved seems to be somewhat delayed: changes in the actuator/info information (such as build.version) of the monitored application are NOT reflected in my program. I have to restart the admin program to get the latest information. Please advise me on what went wrong, thank you!
The text was updated successfully, but these errors were encountered:
using registry.getApplications() should be the correct way to access this information, this is also what the frontend calls to display the data (via ApplicationsController).
First you wrote the changes are delayed (showing up a bit later), then you wrote you have to restart (otherwise there will be no updates at all?).
If the changes are deplayed, then some intervals for updates whithin SBA might be too high (spring.boot.admin.monitor.status-interval, spring.boot.admin.monitor.info-interval). Try to check the logs to see if Spring Boot Admin itself gets the new information.
If the changes are only shown after restart I guess you have an error in your update implementation.
Also check if the data that is not being updated is coming from the monitored applications or from eureka. Maybe the Admin Server itself does not fetch updates from eureka (registryFetchIntervalSeconds)?
As you can see, there could be many reasons. If you do not find a solution please provide more information (logs, configuration, more code, runnable example, ...)
Thanks for your detailed response. From the previous investigation, I can confirm that the information from SBA itself can be updated in a timely manner. Your reply has given me some new insights, and perhaps there are some potential issues in the infinite loop I use for updates. I will focus on investigating this aspect, and will reply here with any progress. 👍
Spring Boot Admin Server information
Version: 2.7.14
Spring Boot version: 2.7.10
Configured Security: NONE
Webflux or Servlet application: Webflux
Client information
Spring Boot versions: 2.7.x
Used discovery mechanism: Eureka
Webflux or Servlet application: Servlet
Description
Sorry but I've really read the issue notes and asked a question on StackOverflow(Question Link Here) before, but got no answers for 10 days. This problem is really important for me so hope I can get some help here, Thanks!
Below is the question copy:
The text was updated successfully, but these errors were encountered: