mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
chore: worker http support
This commit is contained in:
parent
5b78204beb
commit
789bcb5d10
@ -39,6 +39,6 @@ class CSInitializerFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new PowerJobException(String.format("can't load CSInitializer[%s], ensure your package name start with 'tech.powerjob'!", targetType));
|
throw new PowerJobException(String.format("can't load CSInitializer[%s], ensure your package name start with 'tech.powerjob' and import the dependencies!", targetType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
akka {
|
|
||||||
|
|
||||||
loggers = ["akka.event.slf4j.Slf4jLogger"]
|
|
||||||
loglevel = "WARNING"
|
|
||||||
|
|
||||||
actor {
|
|
||||||
# cluster is better(recommend by official document), but I prefer remote
|
|
||||||
provider = remote
|
|
||||||
allow-java-serialization = off
|
|
||||||
|
|
||||||
serializers {
|
|
||||||
power-serializer = "tech.powerjob.common.serialize.PowerAkkaSerializer"
|
|
||||||
}
|
|
||||||
|
|
||||||
serialization-bindings {
|
|
||||||
"tech.powerjob.common.PowerSerializable" = power-serializer
|
|
||||||
}
|
|
||||||
}
|
|
||||||
remote {
|
|
||||||
artery {
|
|
||||||
transport = tcp # See Selecting a transport below
|
|
||||||
# over write by code
|
|
||||||
canonical.hostname = "127.0.0.1"
|
|
||||||
canonical.port = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# worker-request-core-dispatcher
|
|
||||||
w-r-c-d {
|
|
||||||
# Dispatcher is the name of the event-based dispatcher
|
|
||||||
type = Dispatcher
|
|
||||||
# What kind of ExecutionService to use
|
|
||||||
executor = "fork-join-executor"
|
|
||||||
# Configuration for the fork join pool
|
|
||||||
fork-join-executor {
|
|
||||||
# Min number of threads to cap factor-based parallelism number to
|
|
||||||
parallelism-min = 2
|
|
||||||
# Parallelism (threads) ... ceil(available processors * factor)
|
|
||||||
parallelism-factor = 4.0
|
|
||||||
# Max number of threads to cap factor-based parallelism number to
|
|
||||||
parallelism-max = 128
|
|
||||||
}
|
|
||||||
# Throughput defines the maximum number of messages to be
|
|
||||||
# processed per actor before the thread jumps to the next actor.
|
|
||||||
# Set to 1 for as fair as possible.
|
|
||||||
throughput = 10
|
|
||||||
}
|
|
||||||
|
|
||||||
friend-request-actor-dispatcher {
|
|
||||||
# Dispatcher is the name of the event-based dispatcher
|
|
||||||
type = Dispatcher
|
|
||||||
# What kind of ExecutionService to use
|
|
||||||
executor = "fork-join-executor"
|
|
||||||
# Configuration for the fork join pool
|
|
||||||
fork-join-executor {
|
|
||||||
# Min number of threads to cap factor-based parallelism number to
|
|
||||||
parallelism-min = 2
|
|
||||||
# Parallelism (threads) ... ceil(available processors * factor)
|
|
||||||
parallelism-factor = 4.0
|
|
||||||
# Max number of threads to cap factor-based parallelism number to
|
|
||||||
parallelism-max = 128
|
|
||||||
}
|
|
||||||
# Throughput defines the maximum number of messages to be
|
|
||||||
# processed per actor before the thread jumps to the next actor.
|
|
||||||
# Set to 1 for as fair as possible.
|
|
||||||
throughput = 5
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,6 +9,8 @@ powerjob.worker.akka-port=27777
|
|||||||
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.
|
||||||
powerjob.worker.server-address=127.0.0.1:7700,127.0.0.1:7701
|
powerjob.worker.server-address=127.0.0.1:7700,127.0.0.1:7701
|
||||||
|
# transport protocol between server and worker
|
||||||
|
powerjob.worker.protocol=http
|
||||||
# Store strategy of H2 database. disk or memory. Default value is disk.
|
# Store strategy of H2 database. disk or memory. Default value is disk.
|
||||||
powerjob.worker.store-strategy=disk
|
powerjob.worker.store-strategy=disk
|
||||||
# Max length of result. Results that are longer than the value will be truncated.
|
# Max length of result. Results that are longer than the value will be truncated.
|
||||||
|
@ -43,19 +43,17 @@
|
|||||||
<version>${powerjob-remote-framework.version}</version>
|
<version>${powerjob-remote-framework.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- PowerJob 通讯层具体实现,按需选择自己需要的通讯器即可。如果包冲突可尝试更换通讯器实现。 -->
|
<!-- PowerJob 通讯层具体实现,按需选择自己需要的通讯器即可。如果包冲突可尝试更换通讯器实现,并排除未使用的通讯器包 -->
|
||||||
<!-- 4.3.x 版本前 AKKA 都是 PowerJob 通讯层的唯一实现,考虑到兼容性 4.3.x 默认仍为 AKKA,但由于 AKKA 后续收费,最终会废弃该模块 -->
|
<!-- 4.3.x 版本前 AKKA 都是 PowerJob 通讯层的唯一实现,考虑到兼容性 4.3.x 默认仍为 AKKA,但由于 AKKA 后续收费,最终会废弃该模块,扶正太子(HTTP)上位 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>tech.powerjob</groupId>
|
<groupId>tech.powerjob</groupId>
|
||||||
<artifactId>powerjob-remote-impl-akka</artifactId>
|
<artifactId>powerjob-remote-impl-akka</artifactId>
|
||||||
<version>${powerjob-remote-impl-akka.version}</version>
|
<version>${powerjob-remote-impl-akka.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- 4.3.x 版本考虑到兼容性,官方默认实现仍为 akka,如需使用 HTTP 请自行引入依赖并修改 worker 启动配置 -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>tech.powerjob</groupId>
|
<groupId>tech.powerjob</groupId>
|
||||||
<artifactId>powerjob-remote-impl-http</artifactId>
|
<artifactId>powerjob-remote-impl-http</artifactId>
|
||||||
<version>${powerjob-remote-impl-http.version}</version>
|
<version>${powerjob-remote-impl-http.version}</version>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- h2 database -->
|
<!-- h2 database -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user