Skip to content

Commit 186aada

Browse files
authored
3984 Describe more Scheduled properties (helidon-io#4043)
* Describe more Scheduled properties * Minor fixes
1 parent ec4cabd commit 186aada

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

docs/mp/scheduling/01_introduction.adoc

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
///////////////////////////////////////////////////////////////////////////////
22

3-
Copyright (c) 2021 Oracle and/or its affiliates.
3+
Copyright (c) 2021, 2022 Oracle and/or its affiliates.
44

55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -83,7 +83,7 @@ For more complicated interval definition, cron expression can be leveraged with
8383
[source,java]
8484
.Example of scheduling with cron expression
8585
----
86-
@Scheduled("0 15 8 ? * *")
86+
@Scheduled("0 15 8 ? * *", concurrentExecution = false)
8787
public void methodName() {
8888
System.out.println("Executer every day at 8:15");
8989
}
@@ -95,10 +95,29 @@ Metadata like human-readable interval description or configured values are avail
9595
CronInvocation injected as method parameter.
9696
9797
[source,java]
98-
.Example with ivocation metadata
98+
.Example with invocation metadata
9999
----
100100
@Scheduled("0 15 8 ? * *")
101101
public void methodName(CronInvocation inv) {
102102
System.out.println("Method invoked " + inv.description());
103103
}
104-
----
104+
----
105+
106+
`Scheduled` annotation properties can be overridden using `application.yaml` properties
107+
108+
[source,yaml]
109+
.Overriding annotated values from config
110+
----
111+
fully.quallified.ClassName.methodName:
112+
schedule:
113+
cron: "* * * * * ?"
114+
concurrent: false
115+
----
116+
117+
.Configuration properties
118+
[width="90%",cols="3,10",frame="topbot",options="header"]
119+
|====
120+
| Property | Description
121+
| cron | String containing cron setup
122+
| concurrent | Boolean, equivalent `concurrentExecution` property of `@Scheduled`. Default `true`.
123+
|====

0 commit comments

Comments
 (0)