mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
feat: worker starter use new port config name
This commit is contained in:
parent
789bcb5d10
commit
afdf4a7dc2
@ -3,8 +3,8 @@ spring.jpa.open-in-view=false
|
|||||||
########### PowerJob-worker properties. ###########
|
########### PowerJob-worker properties. ###########
|
||||||
# Whether to enable PowerJob Worker, default is true
|
# Whether to enable PowerJob Worker, default is true
|
||||||
powerjob.worker.enabled=true
|
powerjob.worker.enabled=true
|
||||||
# Akka port, default is 27777
|
# Transport port, default is 27777
|
||||||
powerjob.worker.akka-port=27777
|
powerjob.worker.port=27777
|
||||||
# Application name, used for grouping applications. Recommend to set the same value as project name.
|
# Application name, used for grouping applications. Recommend to set the same value as project name.
|
||||||
powerjob.worker.app-name=powerjob-worker-samples
|
powerjob.worker.app-name=powerjob-worker-samples
|
||||||
# Address of PowerJob-server node(s). Ip:port or domain. Multiple addresses should be separated with comma.
|
# Address of PowerJob-server node(s). Ip:port or domain. Multiple addresses should be separated with comma.
|
||||||
|
@ -46,11 +46,15 @@ public class PowerJobAutoConfiguration {
|
|||||||
/*
|
/*
|
||||||
* Configuration of worker port. Random port is enabled when port is set with non-positive number.
|
* Configuration of worker port. Random port is enabled when port is set with non-positive number.
|
||||||
*/
|
*/
|
||||||
|
if (worker.getPort() != null) {
|
||||||
|
config.setPort(worker.getPort());
|
||||||
|
} else {
|
||||||
int port = worker.getAkkaPort();
|
int port = worker.getAkkaPort();
|
||||||
if (port <= 0) {
|
if (port <= 0) {
|
||||||
port = NetUtils.getRandomPort();
|
port = NetUtils.getRandomPort();
|
||||||
}
|
}
|
||||||
config.setPort(port);
|
config.setPort(port);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* appName, name of the application. Applications should be registered in advance to prevent
|
* appName, name of the application. Applications should be registered in advance to prevent
|
||||||
* error. This property should be the same with what you entered for appName when getting
|
* error. This property should be the same with what you entered for appName when getting
|
||||||
|
@ -112,8 +112,14 @@ public class PowerJobProperties {
|
|||||||
/**
|
/**
|
||||||
* Akka port of Powerjob-worker, optional value. Default value of this property is 27777.
|
* Akka port of Powerjob-worker, optional value. Default value of this property is 27777.
|
||||||
* If multiple PowerJob-worker nodes were deployed, different, unique ports should be assigned.
|
* If multiple PowerJob-worker nodes were deployed, different, unique ports should be assigned.
|
||||||
|
* Deprecated, please use 'port'
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
private int akkaPort = RemoteConstant.DEFAULT_WORKER_PORT;
|
private int akkaPort = RemoteConstant.DEFAULT_WORKER_PORT;
|
||||||
|
/**
|
||||||
|
* port
|
||||||
|
*/
|
||||||
|
private Integer port;
|
||||||
/**
|
/**
|
||||||
* Address(es) of Powerjob-server node(s). Ip:port or domain.
|
* Address(es) of Powerjob-server node(s). Ip:port or domain.
|
||||||
* Example of single Powerjob-server node:
|
* Example of single Powerjob-server node:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user