Skip to content

WebClient throws "java.lang.IllegalStateException: Only one connection receive subscriber allowed" on Post Method with content-type x-www-form-urlencoded  #22284

@awilhelmer

Description

@awilhelmer

Affects: Spring Boot v2.1.2

When I create a REST Controller which delegates POST requests to another web service i get the following exception when setting content-type header to x-www-form-urlencoded:

java.lang.IllegalStateException: Only one connection receive subscriber allowed.
	at reactor.netty.channel.FluxReceive.startReceiver(FluxReceive.java:271) [reactor-netty-0.8.4.RELEASE.jar:0.8.4.RELEASE]
	at reactor.netty.channel.FluxReceive.lambda$subscribe$2(FluxReceive.java:124) [reactor-netty-0.8.4.RELEASE.jar:0.8.4.RELEASE]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-common-4.1.31.Final.jar:4.1.31.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[netty-common-4.1.31.Final.jar:4.1.31.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:466) ~[netty-transport-4.1.31.Final.jar:4.1.31.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897) ~[netty-common-4.1.31.Final.jar:4.1.31.Final]
	at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_121]

Run the test case to reproduce the error or run application and excecute the following cURL:

curl -X POST "http://localhost:8080/test/post" -H "content-type: application/x-www-form-urlencoded"

Attachment:
one-connection.zip

Similar Issue: #22096

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions