Skip to content

fix: add body_json and content_type to queue messages - #1048

Open
SameerVers3 wants to merge 1 commit into
cloudflare:mainfrom
SameerVers3:fix/queue-body-json
Open

fix: add body_json and content_type to queue messages#1048
SameerVers3 wants to merge 1 commit into
cloudflare:mainfrom
SameerVers3:fix/queue-body-json

Conversation

@SameerVers3

Copy link
Copy Markdown

Closes #1013

serde_wasm_bindgen::from_value is unreliable for types like serde_json::Value and tuples. This adds an escape hatch:

for msg in batch.raw_iter() {
    let body: MyPayload = msg.body_json()?;
}

Also exposes content_type() on Message and RawMessage so consumers can inspect the producer's format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Queue: typed MessageBatch<T> deserialize via serde_wasm_bindgen::from_value mangles payloads — offer a JSON-based path

1 participant