-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug
Milestone
Description
Anton Brok-Volchansky opened SPR-16744 and commented
First element is decoded correct, but stream fails on the second element:
@Test
public void sseAsEventOfObject() {
ParameterizedTypeReference<ServerSentEvent<Person>> type = new ParameterizedTypeReference<ServerSentEvent<Person>>() {};
Flux<ServerSentEvent<Person>> result = this.webClient.get()
.uri("/sseeventperson")
.accept(TEXT_EVENT_STREAM)
.retrieve()
.bodyToFlux(type);
StepVerifier.create(result)
.consumeNextWith( event -> {
assertEquals("1", event.id());
assertEquals(new Person("Jonathan", "Smith"), event.data());
})
.consumeNextWith( event -> {
assertEquals("2", event.id());
assertEquals(new Person("Jonathan", "Doe"), event.data());
})
.expectComplete()
.verify(Duration.ofSeconds(5555L));
}(Other code is ommited)
When using String as generic parameter, there is no problem at all (as well as in your tests there are no problem when they run). But when I debug the SSE reader and SSE writer in case of use Person, I see two new line between elements instead of one.
Affects: 5.0.4, 5.0.5
Issue Links:
- Parsing of ServerSentEvents not working correctly when using reactive WebClient [SPR-16735] #21276 Parsing of ServerSentEvents not working correctly when using reactive WebClient ("is duplicated by")
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug