Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-13591

SseEmitter cannot use "send(SseEventBuilder builder)" method with custom SseEventBuilder implementation

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 4.2.1
    • Fix Version/s: 4.2.3
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              rstoya05-aop Rossen Stoyanchev
              Reporter:
              mshalak Maksym Shalak
              Last updater:
              St├ęphane Nicoll
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 42 weeks, 5 days ago