xxljob maven
时间: 2023-08-25 17:18:18 浏览: 184
引用提供了一个xxl-job的maven依赖的地址和具体配置信息。可以在该地址下载xxl-job-core的jar包,并在项目的pom文件中添加如下依赖配置:
```xml
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.3.0</version>
</dependency>
```
引用给出了在nacos中对应微服务的配置文件中增加xxl-job参数配置的示例。在配置文件中可以添加如下内容:
```yaml
xxl:
job:
admin:
addresses: http://localhost:8080/xxl-job-admin
accessToken: lgx123456
executor:
appname: dev-bluegrass-coree-service
logretentiondays: 10
```
引用展示了通过aop拦截xxl-job的rpc请求的示例代码。可以将这段代码添加到对应的拦截类中,实现对标记有XxlJob的方法的拦截处理。
```java
import com.xxl.job.core.context.XxlJobHelper;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
@Aspect
@Component
public class XxlJobHandlerMonitor {
// 拦截标记有XxlJob的方法
@Pointcut("@annotation(com.xxl.job.core.handler.annotation.XxlJob)")
public void xxlJobCut() { }
// 进入方法前的前置处理
@Before(value = "xxlJobCut()")
public void permissionCheck(JoinPoint joinPoint){
String param = XxlJobHelper.getJobParam();
System.out.println("\"123\" = " "123");
}
}
```
以上是关于xxljob的maven依赖、配置和拦截rpc请求的相关信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Idea+maven+spring-cloud项目搭建系列--6整合xxl-job](https://blog.csdn.net/l123lgx/article/details/121617833)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文
相关推荐
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)