Skip to content

SseEmitter cannot use "send(SseEventBuilder builder)" method with custom SseEventBuilder implementation [SPR-13591] #18169

@spring-projects-issues

Description

@spring-projects-issues

Maksym Shalak opened SPR-13591 and commented

SseEmitter class contains method "send(SseEventBuilder builder)" which is supposed to be used for custom messages. But the first line of this method contains code

Set<DataWithMediaType> dataToSend = ((SseEventBuilderImpl) builder).build();

That means if we pass SseEventBuilder to the method we receive a ClassCastException since we cannot cast our implementation of interface SseEventBuilder to built-in implementation SseEventBuilderImpl. And SseEventBuilderImpl is a private class, so we will not be able to override it.
So basically that means we cannot create our custom messages at all.


Affects: 4.2.1

Attachments:

Referenced from: commits 1c382be

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions