Skip to content

Commit 4fdf4b6

Browse files
author
salaboy
authored
docs: adding config required for SpringBoot (#1313)
1 parent 6a1eddf commit 4fdf4b6

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

docs/documentation/use-samples.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class Runner {
5454

5555
public static void main(String[] args) {
5656
Operator operator = new Operator(DefaultConfigurationService.instance());
57-
operator.register(new WebServerController());
57+
operator.register(new WebPageReconciler());
5858
operator.start();
5959
}
6060
}
@@ -214,6 +214,28 @@ public class Application {
214214
}
215215
```
216216

217+
You will also need a `@Configuration` to make sure that your reconciler is registered:
218+
219+
```java
220+
221+
@Configuration
222+
public class Config {
223+
224+
@Bean
225+
public WebPageReconciler customServiceController() {
226+
return new WebPageReconciler();
227+
}
228+
229+
@Bean(initMethod = "start", destroyMethod = "stop")
230+
@SuppressWarnings("rawtypes")
231+
public Operator operator(List<Reconciler> controllers) {
232+
Operator operator = new Operator();
233+
controllers.forEach(operator::register);
234+
return operator;
235+
}
236+
}
237+
```
238+
217239
#### Spring Boot test support
218240

219241
Adding the following dependency would let you mock the operator for the tests where loading the spring container is

0 commit comments

Comments
 (0)