Skip to content

Commit 27c6f9f

Browse files
committed
Added documentation for natively using Single Instance Enabled
1 parent b0525c7 commit 27c6f9f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/src/main/asciidoc/features.adoc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,29 @@ application:
389389
NOTE: The exit code for the application will be 1 if the task fails because this feature
390390
is enabled and another task is running with the same task name.
391391

392+
==== Single Instance Usage for Spring AOT And Native Compilation
393+
To utilize Spring Cloud Task's single instance feature when creating a natively compiled app, the feature needs to enabled at build time.
394+
This is done by adding the `process-aot` execution and setting the `spring.cloud.task.single-step-instance-enabled=true` as a JVM argument as shown below:
395+
396+
[source,xml]
397+
<plugin>
398+
<groupId>org.springframework.boot</groupId>
399+
<artifactId>spring-boot-maven-plugin</artifactId>
400+
<executions>
401+
<execution>
402+
<id>process-aot</id>
403+
<goals>
404+
<goal>process-aot</goal>
405+
</goals>
406+
<configuration>
407+
<jvmArguments>
408+
-Dspring.cloud.task.single-instance-enabled=true
409+
</jvmArguments>
410+
</configuration>
411+
</execution>
412+
</executions>
413+
</plugin>
414+
392415
=== Enabling Micrometer Metrics and Observations for Spring Cloud Task
393416

394417
Spring Cloud Task captures the following metrics with the following fields:

0 commit comments

Comments
 (0)