slowness when starting JHIPSTER application - spring

I created a jhipster application and many entities, but the problem is when starting the application, it remains stuck for 6 min, the last message in the console is "started swagger", then continues the startup. is there a solution to this problem please?

Related

Spring batch application freezes abtruptly without log and error

I am facing strange issue with my application.
I have Spring boot + batch application which is internally calling API to get some data and we are calling API using GraphQL.
It is working fine 9/10 times for same set of data but getting freezed one time without giving any error/warning in the logs.
Logs are half processed and freezed when calling API. I need help to fix this issue as I am not able to figure out how to debug this issue.

Launch Mongock faster so when changelog fails the application crashes before a heath check can pass

We recently added MongoCk to our Spring 5 app (using the Spring runner), but are having some issues during our deploys. Our final step in the deploy process is a health check where the deployment server checks a health page every 5s for 5 minutes. Once it gets the correct response the deployment is considered successful and it finishes.
The issue is that MongoCk seems to only start the migration around 30s after the application context loads, resulting in the health check passing and the migration possibly failing after the service was "successfully" launched.
Using a standalone runner might solve this, but we really like the availability of other beans during the changelogs. So is there a way to enforce the changelogs to be processed as part of loading the application context? Or where is this delay coming from, and how can we reduce it?
You don't provide much information, but you are saying that Mongock starts 30 secs after the application context is loaded. That could be happening for two reasons:
The most likely possibility is that you are using runner-type ApplicationRunner(by default). This means that Spring decides when to run it after the entire context is loaded. From what you are saying runner-type InitializingBean is a better fit for you .
Please try this:
mongock:
runner-type: InitializingBean
You have multiple instances fighting for the lock. There is nothing we can do about it, this process is optimised(Although we are improving even more). However, as said, I believe the issue is related with the runner-type

Nservicebus hosted as a service shutdown immediately after starting

I have written a service to host NServiceBus and for some reason NServiceBus is shutting down almost immediately after starting the service. If I run the executable manually everything works exactly as it should but as a service it decides to shutdown without an error being logged. Below is an example of the log files:
Selected active license from C:\ProgramData\ParticularSoftware\license.xml
Security warnings are reported due to opening up some of the security for testing purposes
Initiating shutdown.
Shutdown complete.
All of this takes place in 0.48 seconds.
This is a .net 4.6.1 application as my organization doesn't allow .net core at this point.
I have finally figured out the answer, I had 2 separate ways of closing the connection with NServiceBus, one was supposed to be used in the case that it was being ran as a console app, while the other was for when a service was running. The problem was that the one for the console app was also being hit by the service before it was supposed to, I have now resolved that issue.

What is a method to determine app health when dealing with continuous integration?

Currently, my jenkinsfile is able to compile, deploy, and start the application on my CI box. But I've no window into if the app started correctly. Technically someone can add code that compiles but doesn't start; ie code was added to reference a config, but the person never updated the config file. I want to catch those types of issues that prevents the app from starting and send an email to the person.
How can I accomplish this?
Current app takes about ~3 minutes to start. When everything successfully starts, it'll output: Started Application in 166.125 seconds (JVM running for 175.714)

Spring boot application freezes after running for multiple days

I have a Spring Boot app which I use to run some Controllers and a Scheduled task. I start the app from the command line (I'm on windows) and it runs there for a couple of days, and then stops responding. There are no errors, the output to the console just stops. I have to hit CTRL+C to stop the app and restart it to start getting responses from it again.
The command line is stuck on the last line of output from the program. The computer is a desktop, does not sleep or hibernate. It's as if Spring Boot stopped accepting requests and stopped the Scheduled task.
Any help debugging this problem would be greatly appreciated.

Resources