Workaround for spring-framework#21094

This commit is contained in:
Philippe 2019-04-01 22:22:02 -03:00
parent 29d9159ebf
commit a86c69429b
3 changed files with 87 additions and 52 deletions

View File

@ -16,6 +16,20 @@
<relativePath>../parent-boot-2</relativePath>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<!-- <version>2.0.4.RELEASE</version> --><!-- works -->
<version>2.1.3.RELEASE</version> <!-- Works with workaround applied -->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@ -3,6 +3,12 @@ package org.baeldung.spring.amqp;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.web.filter.reactive.HiddenHttpMethodFilter;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilterChain;
import reactor.core.publisher.Mono;
@SpringBootApplication
@EnableConfigurationProperties(DestinationsConfig.class)
@ -12,4 +18,19 @@ public class SpringWebfluxAmqpApplication {
SpringApplication.run(SpringWebfluxAmqpApplication.class, args);
}
/**
* This is a workaround for https://github.com/spring-projects/spring-framework/issues/21094
* @return
*/
@Bean
public HiddenHttpMethodFilter hiddenHttpMethodFilter() {
return new HiddenHttpMethodFilter() {
@Override
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
return chain.filter(exchange);
}
};
}
}

View File

@ -1,6 +1,6 @@
spring:
rabbitmq:
host: localhost
host: 192.168.99.100
port: 5672
username: guest
password: guest