Tuesday, 26 May 2020

Command-line Runner vs Application Runner

They both may be useful for writing init, admin tasks. 

We use Command-line runner interface to wrap a set of work, and bring it into the Spring boot, and let it is carried out immediately after the application context is all up and running. We may inject application arguments into a command-line run method. We may have more than one command-line runner in one spring boot application and their orders can be controlled by an annotation @Order.  Otherwise, Spring will select a default order for them.

ApplicationRunner is a cousin of Command-line runner. 

No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...