springboot2.6.13使用的rocketmq版本
时间: 2023-10-18 11:54:35 浏览: 50
Spring Boot 2.6.13并没有固定使用特定版本的RocketMQ。RocketMQ是一个独立的消息中间件,您可以根据自己的需求选择合适的版本。通常来说,您可以通过在您的项目的构建管理工具(如Maven或Gradle)中添加RocketMQ的依赖来引入RocketMQ。然后,您可以选择您希望使用的RocketMQ版本,并在构建配置中指定该版本的依赖。在您的代码中,您可以使用RocketMQ的API进行消息的发送和接收。
相关问题
springboot 2.6.13WebMvcConfigurer和WebSecurityConfigurerAdapter都生效
根据提供的引用内容,可以看出在Spring Boot 2.6.13中,可以通过配置`spring.mvc.pathmatch.matching-strategy`来指定路径匹配策略。而在第一个引用中,配置的是`ant_path_matcher`策略,而在第二个引用中,也是配置的相同的策略。
因此,可以得出结论,在Spring Boot 2.6.13中,无论是WebMvcConfigurer还是WebSecurityConfigurerAdapter都会生效,并且都会使用`ant_path_matcher`作为路径匹配策略。
springboot 2.6.13WebMvcConfigurer和WebSecurityConfigurerAdapter 实现方法都生效
根据提供的引用内容,可以使用Spring Boot 2.6.13中的WebMvcConfigurer和WebSecurityConfigurerAdapter来实现方法的生效。
首先,我们需要创建一个类,实现WebMvcConfigurer接口,并重写addInterceptors方法。在该方法中,我们可以添加自定义的拦截器。
```java
@Configuration
public class MyWebMvcConfigurer implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 添加自定义的拦截器
registry.addInterceptor(new MyInterceptor());
}
}
```
接下来,我们需要创建一个类,继承WebSecurityConfigurerAdapter,并重写configure方法。在该方法中,我们可以配置安全相关的设置,例如身份验证和授权。
```java
@Configuration
@EnableWebSecurity
public class MyWebSecurityConfigurer extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
// 配置安全相关的设置
http.authorizeRequests()
.antMatchers("/admin/**").hasRole("ADMIN")
.antMatchers("/user/**").hasRole("USER")
.anyRequest().authenticated()
.and()
.formLogin();
}
}
```
最后,我们需要在应用程序的入口类上添加@EnableWebMvc和@EnableWebSecurity注解,以启用WebMvcConfigurer和WebSecurityConfigurerAdapter。
```java
@SpringBootApplication
@EnableWebMvc
@EnableWebSecurity
public class MyApp {
public static void main(String[] args) {
SpringApplication.run(MyApp.class, args);
}
}
```
通过以上步骤,我们可以同时实现WebMvcConfigurer和WebSecurityConfigurerAdapter中的方法生效。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.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)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)