Reputation: 1
I am new to SCDF. I would like to embed SCDF server and skipper server to a single existing micro services rather than having dedicate executable jars. Is it possible and do we have sample example?
Upvotes: 0
Views: 417
Reputation: 621
Technically you can run Dataflow embedded in another app but you can not run both Dataflow and Skipper together in the same app.
⚠️ Disclaimer: This mode is not recommended nor officially supported. However, I will share how to theoretically embed the Dataflow server in an existing app.
Add the SCDF sever starter dependency. In maven it would be the following:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-dataflow-server</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
I added H2 in order to avoid dealing w/ the database. You will also need to be sure you have a schema available (something the install normally handles for you).
Add the @EnabledDataFlowServer
to your SBA (note the auto-config exclusions - taken from here).
At this point the app should start successfully.
If you continue the exercise and attempt to add Skipper server, you will see how it breaks.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-skipper-server</artifactId>
<version>2.8.2</version>
</dependency>
@EnableSkipperServer
to your SBA.On startup you will see the bean name clashes. If you attempt to allow bean overriding you will see the next wave of bean mismatches. As pointed out above, the overall system is not architected to run this way.
Summary: You can run Dataflow embedded in another app but you can not run both Dataflow and Skipper together in the same app.
Upvotes: 2