### Start Powerjob Environment with Docker Compose Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud-job/powerjob-solon-cloud-plugin/README.md Clone the PowerJob repository and use Docker Compose to start the Powerjob server and worker environment for local development and testing. ```shell git clone --depth=1 https://github.com/PowerJob/PowerJob.git cd PowerJob docker-compose up ``` -------------------------------- ### Consul Configuration Example Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud/solon-cloud/README.md This YAML snippet shows how to configure Solon Cloud to use Consul for service registration and discovery. It sets the application name, group, and Consul server address. ```yaml solon: app: name: "solon-consul-test" group: "test" solon.cloud.consul: server: "localhost" ``` -------------------------------- ### Basic Consul Configuration Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud-config-and-discovery/consul-solon-cloud-plugin/README.md Minimal configuration for Solon Cloud to use Consul for service discovery and configuration loading. ```yaml solon.app: group: demo #配置服务使用的默认组 name: helloapp #发现服务使用的应用名 solon.cloud.consul: server: localhost #服务地址 config: load: "helloapp.yml" ``` -------------------------------- ### Full Consul Configuration Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud-config-and-discovery/consul-solon-cloud-plugin/README.md Comprehensive configuration for Solon Cloud with Consul, including detailed settings for discovery and configuration. ```yaml solon.app: group: "demo" name: "helloapp" solon.cloud.consul: server: "localhost" discovery: server: "localhost" #发现与注册服务地址(默认为: server) enable: true #是否启用(默认为: 启用) unstable: true #不稳定ip? tags: "test" #添加服务标签 healthCheckInterval: "5s" #健康检测时间间隔(默认为:5s) healthDetector: "" #自定义探测器 refreshInterval: "5s" #发现刷新时间间隔(默认为:5s) config: server: "localhost" #配置服务地址(默认为: server) enable: true #是否启用(默认为: 启用) load: "helloapp.yml" #启动时加载配置 refreshInterval: "5s" #配置刷新时间隔(默认为:5s) ``` -------------------------------- ### Standard Configuration with Detailed FastDFS Properties Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud-file/fastdfs-solon-cloud-plugin/README.md This configuration combines standard Solon Cloud settings with detailed FastDFS properties. It's useful when you need to override or specify advanced FastDFS parameters. ```yaml solon.cloud.fastdfs: file: enable: true #是否启用(默认:启用) bucket: "group1" # group 名称 # fastdfs 详细配置 fastdfs.charset: UTF-8 fastdfs.connect_timeout_in_seconds: 5 fastdfs.network_timeout_in_seconds: 30 fastdfs.http_anti_steal_token: false fastdfs.http_secret_key: FastDFS1234567890 fastdfs.http_tracker_http_port: 80 fastdfs.tracker_servers: 10.0.11.201:22122,10.0.11.202:22122,10.0.11.203:22122 fastdfs.connection_pool.enabled: true fastdfs.connection_pool.max_count_per_entry: 500 fastdfs.connection_pool.max_idle_time: 3600 fastdfs.connection_pool.max_wait_time_in_ms: 1000 ``` -------------------------------- ### Simple RocketMQ Event Configuration Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud-event/rocketmq5-solon-cloud-plugin/README.md Basic configuration for the Solon Cloud RocketMQ Event plugin, setting the application group, name, and server address. ```yaml solon.app: group: demo #配置服务使用的默认组 name: helloapp #发现服务使用的应用名 solon.cloud.rocketmq.event: server: "localhost:9876" #服务地址 ``` -------------------------------- ### Standard FastDFS Configuration with Built-in Properties Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud-file/fastdfs-solon-cloud-plugin/README.md Use this configuration when integrating with FastDFS using standard Solon Cloud properties. It leverages the built-in `fastdfs_def.properties` for default settings. ```yaml solon.cloud.fastdfs: file: enable: true #是否启用(默认:启用) bucket: "group1" #默认 group 名称 endpoint: "10.0.11.201:22122,10.0.11.202:22122" # 相当于 fastdfs.tracker_servers secretKey: "FastDFS1234567890" # 相当于 fastdfs.http_secret_key ``` -------------------------------- ### Configure Powerjob Solon Cloud Plugin Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud-job/powerjob-solon-cloud-plugin/README.md Configure the Powerjob Solon Cloud plugin by specifying the Powerjob server address, password, and job-related transport settings. ```yaml solon.app: name: powerjob-solon group: demo #::server, password 移到了上级;其它属性在 job 下 solon.cloud.powerjob: # Address of PowerJob-server node(s). Ip:port or domain. Multiple addresses should be separated with comma. server: 127.0.0.1:7700 # If use PowerjobClient to submit a job, you need to set this property. password: powerjob123 job: # Transport port, default is 27777 port: 28888 # transport protocol between server and worker protocol: akka # Store strategy of H2 database. disk or memory. Default value is disk. storeStrategy: disk # Max length of result. Results that are longer than the value will be truncated. maxResultLength: 4096 # Max length of appended workflow context . Appended workflow context value that is longer than the value will be ignore. maxAppendedWfContextLength: 4096 ``` -------------------------------- ### Advanced RocketMQ Event Configuration Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud-event/rocketmq5-solon-cloud-plugin/README.md Extended configuration for the Solon Cloud RocketMQ Event plugin, including channel, authentication, timeouts, and consumer/producer group settings. ```yaml solon.app: group: demo #配置服务使用的默认组 name: helloapp #发现服务使用的应用名 solon.cloud.rocketmq.event: channel: "biz" #多个 soon cloud event 插件同用时,才有用 server: "localhost:9876" #rocketmq服务地址 accessKey: "LTAI5t6tC2**********" secretKey: "MLaRt1yTRdfzt2***********" publishTimeout: "3000" #消息发布超时(单位:ms) consumerGroup: "${solon.app.group}_${solon.app.name}" #消费组 consumeThreadNums: 0 #消费线程数,0表示默认 maxReconsumeTimes: 0 #消费消息失败的最大重试次数,0表示默认 producerGroup: "DEFAULT" #生产组 ``` -------------------------------- ### Create a Job using @CloudJob Annotation Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud-job/powerjob-solon-cloud-plugin/README.md Define a job in your Solon application by annotating a method with @CloudJob. This method will be processed by Powerjob and can directly inject TaskContext. ```java import tech.powerjob.worker.core.processor.sdk.BasicProcessor; public class DemoApp { public void main(String[] args) { SolonApp app = Solon.start(DemoApp.class, args); } /** * 会转为 PowerJobProxy implements BasicProcessor 处理 * */ @CloudJob("job2") public void job2(TaskContext taskContext) { System.out.println("xxxxx - job2"); } } ``` -------------------------------- ### Add Powerjob Solon Cloud Plugin Dependency Source: https://github.com/opensolon/solon-cloud/blob/main/solon-cloud-job/powerjob-solon-cloud-plugin/README.md Include the Powerjob Solon Cloud plugin as a Maven dependency to enable Powerjob support in your Solon Cloud application. ```xml org.noear powerjob-solon-cloud-plugin ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.