rrwright commented on code in PR #744: URL: https://github.com/apache/pekko-http/pull/744#discussion_r2326549385
########## docs/src/main/paradox/common/sse-support.md: ########## @@ -56,6 +56,49 @@ Scala Java : @@snip [EventStreamMarshallingTest.java](/http-tests/src/test/java/org/apache/pekko/http/javadsl/unmarshalling/sse/EventStreamUnmarshallingTest.java) { #event-stream-unmarshalling-example } +## Configuration + +Apache Pekko HTTP provides several configuration options for Server-Sent Events handling: + +### Message Size Limits + +The SSE client parser has configurable limits to handle various message sizes: + +```hocon +pekko.http.sse { + # The maximum size for parsing received server-sent events. + # This value must be larger than `max-line-size`. Set to 0 to disable limit entirely (unlimited). + max-event-size = 115713 + + # The maximum size for parsing received lines of a server-sent event. Set to 0 to disable limit entirely (unlimited). + max-line-size = 115712 +} +``` + +### Oversized Message Handling + +When SSE messages exceed the configured `max-line-size`, Apache Pekko HTTP provides four handling strategies: + +- **fail-stream** (default): Fails the stream with a clear error message, maintaining backward compatibility +- **log-and-skip**: Logs a warning and skips the oversized message, continuing stream processing +- **truncate**: Logs a warning and truncates the message to the configured limit, continuing processing +- **dead-letter**: Logs a warning and sends the oversized message to the dead letter queue, continuing processing + +```hocon +pekko.http.sse { + # How to handle messages that exceed max-line-size limit + # Options: + # "fail-stream" - Fail the stream with a clear error message (default) + # "log-and-skip" - Log a warning and skip the oversized message + # "truncate" - Log a warning and truncate the message to max-line-size + # "dead-letter" - Log a warning, send oversized message to dead letters + oversized-message-handling = "fail-stream" Review Comment: My thought was that, while dead letters often just get logged, a pekko user can subscribe/intercept the events that go to dead letters and then handle them if some special logic is needed. So the dead letter queue is potentially more than just logging but also a way to add last-ditch error handling. But maybe it should just send to dead letters without explicitly logging; let logging happen naturally for unhandled dead letters. …changes pushed; I removed logging from the dead letter option. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For additional commands, e-mail: notifications-h...@pekko.apache.org