Repository navigation
v2.0.0
GRPC Streaming producer!
2.0 introduces a new default producer based on the gRPC StreamingPull API.
The previous HTTP pull producer is still fully supported under
BroadwayCloudPubSub.Pull.Producer. See the
2.0 upgrade guide for step-by-step migration
instructions.
Added
-
BroadwayCloudPubSub.Producer: a new Broadway producer that uses the
gRPC StreamingPull API for low-latency, push-based message delivery. This is
the recommended producer going forward.- Persistent bidirectional gRPC stream; messages are pushed by the server
rather than fetched on demand - Server-side flow control via
:max_outstanding_messagesand
:max_outstanding_bytes - Automatic lease extension with adaptive p99 ack deadlines, preventing
premature redelivery without manualackDeadlineSecondstuning - Batched ack/nack via a separate unary gRPC connection, independent of the
streaming connection - Exactly-once delivery support, auto-detected from subscription properties
at runtime - Message ordering via
:enable_message_ordering - Graceful shutdown with configurable drain timeout (
:drain_timeout_ms) - Comprehensive telemetry: stream lifecycle, ack batching, and gRPC spans
- Gun and Mint HTTP/2 adapters via the
:adapteroption - Pub/Sub emulator support via
:grpc_endpointand:use_ssl
- Persistent bidirectional gRPC stream; messages are pushed by the server
-
BroadwayCloudPubSub.Streaming.Client: behaviour for custom gRPC client
implementations, analogous toBroadwayCloudPubSub.Pull.Clienton the pull
side. -
BroadwayCloudPubSub.Streaming.GrpcClient: default gRPC client
implementation using thegrpclibrary.
Changed
- Added
subscriptionandreceivedAtto message metadata on both producers.
receivedAtis aDateTimestamped when the message reaches the pipeline.
Breaking changes
-
Bump minimum Elixir to 1.15.
-
:grpcand:protobufare now required dependencies of this library and are
installed automatically, including for users of
BroadwayCloudPubSub.Pull.Producer. The HTTP/2 adapter (:gun, or:mint
with:castore) remains a dependency you choose and add yourself, and is only
needed byBroadwayCloudPubSub.Producer. Pull-only users therefore also
compilegrpc,grpc_core,googleapisandprotobuf, because the
generated protobuf modules cannot be conditionally compiled. -
:telemetrynow requires~> 1.0(the 0.4 range could not be resolved
together with:grpc). -
BroadwayCloudPubSub.Produceris now the gRPC streaming producer. The
1.x HTTP pull producer has moved toBroadwayCloudPubSub.Pull.Producer.
Update the module name in your pipeline to keep the pull behaviour:# 1.x {BroadwayCloudPubSub.Producer, goth: MyApp.Goth, subscription: "..."} # 2.0, keep pull {BroadwayCloudPubSub.Pull.Producer, goth: MyApp.Goth, subscription: "..."} # 2.0, switch to streaming (recommended) {BroadwayCloudPubSub.Producer, goth: MyApp.Goth, subscription: "...", max_outstanding_messages: 1000}
-
BroadwayCloudPubSub.PullClientrenamed to
BroadwayCloudPubSub.Pull.FinchClient. Only affects you if you referenced
it directly -
BroadwayCloudPubSub.Clientbehaviour renamed to
BroadwayCloudPubSub.Pull.Client. Only affects you if you implemented a
custom HTTP pull client to override the:clientoption.. -
on_failuredefault changed from:noopto{:nack, 0}in both
producers. Failed messages are now immediately made available for redelivery,
matching the behaviour of the official Google Cloud Pub/Sub client libraries.
Seton_failure: :noopexplicitly to preserve the 1.x behaviour.