eventmesh
eventmesh copied to clipboard
[ISSUE #5233] Preserve common HTTP JSON payloads
Fixes #5233
Motivation
The HTTP connector common protocol fails when it receives a JSON object body because the request payload is parsed as a Java String. A JSON object such as {"name":"Andy"} cannot be deserialized that way, so the connector rejects a valid request body.
Modifications
The common HTTP protocol now preserves the raw request body string before enqueuing the WebhookRequest. A regression test starts the Vert.x route through CommonProtocol, posts a JSON object, verifies the HTTP 200 response, and checks that the queued request payload is unchanged.
Validation:
docker run --rm -v "$PWD":/workspace -w /workspace eclipse-temurin:8-jdk ./gradlew :eventmesh-connectors:eventmesh-connector-http:test --tests org.apache.eventmesh.connector.http.source.protocol.impl.CommonProtocolTest --no-daemon --stacktrace
BUILD SUCCESSFUL
Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
- If a feature is not applicable for documentation, explain why? This fixes request payload handling for an existing connector protocol.
- If a feature is not documented yet in this PR, please create a followup issue for adding the documentation