[JAVA] [I tried] Spring tutorial

Summarize the learning in the spring tutorial

What i did

Task Schedule

【environment】

[App to make]

Create an app that outputs the current time every 5 seconds using Spring's @Scheduled annotation

--Move to a suitable directory

$ git clone https://github.com/spring-guides/gs-scheduling-tasks.git
$ cd gs-scheduling-tasks

--Edit: pom.xml --add awaitility dependency (for testing scheduledTasksTest.java)

--Create a scheduled task --Created: New file (src / main / java /.../ schedulingtasks/ScheduledTasks.java)

--Enable scheduling --Edit: (src / main /.../ schedulingtasks/SchedulingTasksApplication.java)

import org.springframework.scheduling.annotation.EnableScheduling;

--Build an executable JAR --Move: Move to maven directory --Run 1: Run the application using "./mvnw spring-boot: run" --Execution 2: Copy and paste the path displayed in the log after "./mvnw clean package".

[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ scheduling-tasks ---
[INFO] Building jar: /Users/#{myname}/projects/gs-scheduling-tasks/initial/target/scheduling-tasks-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.3.2.RELEASE:repackage (repackage) @ scheduling-tasks ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.307 s
[INFO] Finished at: 2020-08-08T21:52:43+09:00
[INFO] ------------------------------------------------------------------------

#Run, launch app
$ /Users/#{myname}/projects/gs-scheduling-tasks/initial/target/scheduling-tasks-0.0.1-SNAPSHOT.jar


--App launch

Reference article (Thank you always)

Task Schedule How to periodically execute tasks in Spring Boot

Recommended Posts

[I tried] Spring tutorial
I tried Spring.
I tried Spring Batch
I tried Spring State machine
I tried the Docker tutorial!
I tried the VueJS tutorial!
I tried Angular tutorial + SpringBoot + PostgreSQL
I tried using Spring + Mybatis + DbUnit
I tried GraphQL with Spring Boot
I tried Flyway with Spring Boot
[Tutorial] Spring Batch
I tried tomcat
I tried youtubeDataApi.
I tried refactoring ①
I tried FizzBuzz.
I tried JHipster 5.1
I tried Lazy Initialization with Spring Boot 2.2.0
I tried Spring Data JDBC 1.0.0.BUILD-SNAPSHOT (-> 1.0.0.RELEASE)
I tried running Autoware
I tried using Gson
I tried QUARKUS immediately
I tried using TestNG
I tried using Galasa
I tried node-jt400 (Programs)
I tried to link JavaFX and Spring Framework.
I tried node-jt400 (execute)
I tried node-jt400 (Transactions)
I tried to implement file upload with Spring MVC
05. I tried to stub the source of Spring Boot
I tried to reduce the capacity of Spring Boot
I tried to get started with Spring Data JPA
I tried node-jt400 (Environment construction)
I tried DI with Ruby
I tried node-jt400 (IFS write)
Spring Boot tutorial task schedule
I tried node-jt400 (SQL Update)
I tried using azure cloud-init
I tried Drools (Java, InputStream)
I tried Rails beginner [Chapter 1]
I tried using Apache Wicket
I tried node-jt400 (SQL query)
I tried using Java REPL
I tried source code analysis
I tried the FizzBuzz problem
I tried node-jt400 (SQL stream)
I tried node-jt400 (IFS read)
I tried putting XcodeGen + SwiftPM
I tried Rails beginner [Chapter 2]
I tried UPSERT with PostgreSQL.
I tried BIND with Docker
I tried to verify yum-cron
I tried Jets (ruby serverless)
Try the Spring WebFlux tutorial
I tried metaprogramming in Java
Spring Boot Introductory Guide I tried [Accessing Data with JPA]
I tried to verify this and that of Spring @ Transactional
I tried to get started with Swagger using Spring Boot
I tried using anakia + Jing now
I tried printing a form with Spring MVC and JasperReports 1/3 (JasperReports settings)
I tried printing a form with Spring MVC and JasperReports 3/3 (Spring MVC control)
I tried to chew C # (indexer)