Skip to content

WebClient .retrieve() + bodyToMono() causes "Only one connection receive subscriber allowed" on 4xx and 5xx [SPR-17615] #22147

Closed
@spring-projects-issues

Description

@spring-projects-issues

Vladislav Kisel opened SPR-17615 and commented

On 4xx and 5xx status, using WebClient "retrieve" + "bodyTo..." causes swallowed exception:

java.lang.IllegalStateException: Only one connection receive subscriber allowed. 

Example (kotlin):

WebClient.builder().build().get()
        .uri("https://jira.atlassian.com/rest/api/latest/issue/QWERTY-123")
        .retrieve()
        .bodyToMono(String::class.java)
        .test()
        .expectError(WebClientResponseException::class.java)
        .verify()

 

Probably exception handler subscribes to the connection itself so "bodyTo..." causes this exception. 

Anyway, WebClientResponseException is being correctly thrown and IllegalStateException is just swallowed and printed to the output


Affects: 5.1.3

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions