I would like to invoke some code after my application start. Is there any way to handle event:
Started SomeApp in 14.905 seconds (JVM running for 16.268)
I'm going to try if another application is up. I've tried to use Retryable but not its executed before application started and exception is thrown so application exits.
@EventListener
fun handleContextRefresh(event: ContextRefreshedEvent) {
retryableInvokeConnection()
}
@Retryable(
value = [RetryableException::class, ConnectionException::class],
maxAttempts = 100000,
backoff = Backoff(delay = 5)
)
private fun retryableInvokeConnection() {
}
@Recover
private fun retryableInvokeConnectionExceptionHandler(ex: ConnectionException) {
}
Maybe I should use PostConstruct and while loop.