rrwright commented on code in PR #744:
URL: https://github.com/apache/pekko-http/pull/744#discussion_r2326612989
##########
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:
It's just the standard pekko dead letter queue. So it's a message sent
inside the same JVM. I'm pretty sure the dead letter queue is event-driven (I
think it's a system actor, but I don't remember if it's actually backed by an
actor or not, but it does have an ActorRef). After it's handled, it'll be
garbage collected when there's no held reference like any other message. The
timing to consume the message wouldn't require any special handling. It would
be like any other pekko message.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]