DM CHAU
DM CHAU

Reputation: 67

Duplicated port of child tasks in Spring Cloud Data Flow

When I launch new task (Spring Batch Job) using Spring Cloud Data Flow, I see that SCDF auto initialize Tomcat with some "random" ports but I do not know if there ports are created randomly or following any rule of the framework?

Therefore, I sometime have a trouble that "Web server failed to start. Port 123456 was already in use".

In conclusion, my questions are:
1) How does the framework choose ports for initializing? (randomly or by principle)?
2) Are there anyway to launch task effectively without duplicated ports(fixed configuration or method for choosing unused port at particular time)?

Upvotes: 1

Views: 175

Answers (1)

Ilayaperumal Gopinathan
Ilayaperumal Gopinathan

Reputation: 4179

I don't think SCDF has anything to do with the port assignment etc.,

It is your task application that gets launched. You need to decide whether you really need the web dependency that brings in the tomcat to your application.

Assuming you use Spring Boot, you can either exclude the web starter dependency in your dependencies or pass the command line arg server.port=<?> to a specific port when launching the task (if you really need this task app to be a web app).

Upvotes: 1

Related Questions