Docs updated to reflect 3.0.x boot and task

This commit is contained in:
Glenn Renfro
2022-11-15 09:48:29 -05:00
parent 3b914046b1
commit 3069f3806c
5 changed files with 19 additions and 14 deletions

View File

@@ -20,9 +20,9 @@ Stores the task execution information.
|TASK_EXECUTION_ID |TRUE |BIGINT | X |
Spring Cloud Task Framework at app startup establishes the next available id as obtained from the `TASK_SEQ`. Or if the record is created outside of task then the value must be populated at record creation time.
|START_TIME |FALSE | DATETIME | X | Spring Cloud Task Framework at app startup establishes the value.
|START_TIME |FALSE | DATETIME(6) | X | Spring Cloud Task Framework at app startup establishes the value.
|END_TIME |FALSE | DATETIME | X | Spring Cloud Task Framework at app exit establishes the value.
|END_TIME |FALSE | DATETIME(6) | X | Spring Cloud Task Framework at app exit establishes the value.
|TASK_NAME |FALSE | VARCHAR | 100 | Spring Cloud Task Framework at app startup will set this to "Application" unless user establish the name using the `spring.application.name`.
@@ -32,7 +32,7 @@ Spring Cloud Task Framework at app startup establishes the next available id as
|ERROR_MESSAGE |FALSE | VARCHAR | 2500 | Spring Cloud Task Framework at app exit establishes the value.
|LAST_UPDATED |TRUE | DATETIME | X | Spring Cloud Task Framework at app startup establishes the value. Or if the record is created outside of task then the value must be populated at record creation time.
|LAST_UPDATED |TRUE | TIMESTAMP | X | Spring Cloud Task Framework at app startup establishes the value. Or if the record is created outside of task then the value must be populated at record creation time.
|EXTERNAL_EXECUTION_ID |FALSE | VARCHAR | 250 | If the `spring.cloud.task.external-execution-id` property is set then Spring Cloud Task Framework at app startup will set this to the value specified. More information can be found <<features-external_task_id,here>>

View File

@@ -92,7 +92,7 @@ You can read from a queue or topic with AMQP by using the `AmqpItemReader`. The
autoconfiguration for this `ItemReader` implementation is dependent upon two sets of
configuration. The first is the configuration of an `AmqpTemplate`. You can either
configure this yourself or use the autoconfiguration provided by Spring Boot. See the
https://docs.spring.io/spring-boot/docs/2.4.x/reference/htmlsingle/#boot-features-amqp[Spring Boot AMQP documentation].
https://docs.spring.io/spring-boot/docs/3.0.x/reference/htmlsingle/#messaging.amqp.rabbitmq[Spring Boot AMQP documentation].
Once you have configured the `AmqpTemplate`, you can enable the batch capabilities to support it
by setting the following properties:
@@ -412,7 +412,8 @@ covers how to use autoconfiguration to configure a supported `ItemWriter`.
To write to a RabbitMQ queue, you need two sets of configuration. First, you need an
`AmqpTemplate`. The easiest way to get this is by using Spring Boot's
RabbitMQ autoconfiguration. See the https://docs.spring.io/spring-boot/docs/2.4.x/reference/htmlsingle/#boot-features-amqp[Spring Boot RabbitMQ documentation].
RabbitMQ autoconfiguration. See the https://docs.spring.io/spring-boot/docs/3.0.x/reference/htmlsingle/#messaging.amqp.rabbitmq[Spring Boot AMQP documentation].
Once you have configured the `AmqpTemplate`, you can configure the `AmqpItemWriter` by setting the
following properties:

View File

@@ -399,7 +399,7 @@ To do so, add the process-aot execution and set `spring.cloud.task.single-step-i
To Enable Task Observations for `ApplicationRunner` or `CommandLineRunner` set `spring.cloud.task.observation.enabled` to true.
An example task application with observations enables using the `SimpleMeterRegistry` can be found https://github.com/spring-cloud/spring-cloud-task/tree/main/spring-cloud-task-samples/task-metrics[here].
An example task application with observations enables using the `SimpleMeterRegistry` can be found https://github.com/spring-cloud/spring-cloud-task/tree/main/spring-cloud-task-samples/task-observations[here].
=== Disabling Spring Cloud Task Auto Configuration

View File

@@ -14,13 +14,13 @@ discussing some core principles as we go.
== Introducing Spring Cloud Task
Spring Cloud Task makes it easy to create short-lived microservices. It provides
capabilities that let short lived JVM processes be executed on demand in a production
capabilities that let short-lived JVM processes be executed on demand in a production
environment.
[[getting-started-system-requirements]]
== System Requirements
You need to have Java installed (Java 8 or better). To build, you need to have Maven
You need to have Java installed (Java 17 or better). To build, you need to have Maven
installed as well.
=== Database Requirements
@@ -72,11 +72,14 @@ To do so:
To finish our application, we need to update the generated `HelloworldApplication` with the following contents so that it launches a Task.
[source,java]
----
package io.spring.demo.helloworld;
package io.spring.Helloworld;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.task.configuration.EnableTask;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
@@ -84,19 +87,20 @@ import org.springframework.context.annotation.Bean;
public class HelloworldApplication {
@Bean
public CommandLineRunner commandLineRunner() {
return new HelloWorldCommandLineRunner();
public ApplicationRunner applicationRunner() {
return new HelloWorldApplicationRunner();
}
public static void main(String[] args) {
SpringApplication.run(HelloworldApplication.class, args);
}
public static class HelloWorldCommandLineRunner implements CommandLineRunner {
public static class HelloWorldApplicationRunner implements ApplicationRunner {
@Override
public void run(String... strings) throws Exception {
public void run(ApplicationArguments args) throws Exception {
System.out.println("Hello, World!");
}
}
}
@@ -147,7 +151,7 @@ The main method serves as the entry point to any java application. Our main met
delegates to Spring Boot's https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-spring-application.html[SpringApplication] class.
[[getting-started-clr]]
==== The CommandLineRunner
==== The ApplicationRunner
Spring includes many ways to bootstrap an application's logic. Spring Boot provides
a convenient method of doing so in an organized manner through its `*Runner` interfaces

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 51 KiB