环境:centos , docker-compose , xxl-job-admin-2.1.0.jar
代码工程中:
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.0.1</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> <version>9.4.17.v20190418</version> <exclusions> <exclusion> <artifactId>jetty-http</artifactId> <groupId>org.eclipse.jetty</groupId> </exclusion> <exclusion> <artifactId>jetty-io</artifactId> <groupId>org.eclipse.jetty</groupId> </exclusion> <exclusion> <artifactId>jetty-util</artifactId> <groupId>org.eclipse.jetty</groupId> </exclusion> </exclusions> </dependency>
由于xxl-job-admin版本与工程中xxl-job-core版本不一致,导致了非常奇怪的问题:
工程启动完,可以手动调用任务并成功,过了二十分钟左右,就会报错:request timeout。
最后解决办法就是升级xxl-job-core
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.1.0</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
</exclusion>
</exclusions>
</dependency>