Skip to content

feat: wire pydantic serializer through broker.publish - #7

Merged
lesnik512 merged 1 commit into
mainfrom
feat/pydantic-publish
May 20, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
feat/pydantic-publish

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Match FastStream's broker convention: accept a SerializerProto on OutboxBroker, store it in FastDependsConfig, and pass the resolved value to encode_message. The EMPTY default resolves to PydanticSerializer, so broker.publish(pydantic_model, ...) now JSON-encodes instead of raising TypeError from the json_dumps fallback.

Match FastStream's broker convention: accept a SerializerProto on
OutboxBroker, store it in FastDependsConfig, and pass the resolved value
to encode_message. The EMPTY default resolves to PydanticSerializer, so
broker.publish(pydantic_model, ...) now JSON-encodes instead of raising
TypeError from the json_dumps fallback.
@lesnik512 lesnik512 self-assigned this May 20, 2026
@lesnik512
lesnik512 merged commit 8499264 into main May 20, 2026
3 checks passed
@lesnik512
lesnik512 deleted the feat/pydantic-publish branch May 20, 2026 18:43
lesnik512 added a commit that referenced this pull request Jul 17, 2026
architecture/metrics.md §Two-seam layering framed the recorder and native
middleware as purely complementary, omitting that they overlap on the
consume/publish series: both emit the same-named duration+count metrics, so one
Prometheus registry raises Duplicated timeseries and live OTel meters on both
double-count. Record the hazard, the separate-registries / middleware-as-source-
of-truth fix, and why the library does not guard it at construction (the collision
is raised upstream of the broker, and "both seams configured" is indistinguishable
from the correct dual-registry setup). Cross-refs the setup doc, which already
covers the operator side.

Closes the last open item from the architecture review (candidate #7). Docs only.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant