Kinoko's TIL Log

gRPC Pusher Pattern

The Point

A gRPC Pusher is a message dispatch intermediary – it pulls messages from a Pub/Sub subscription and proactively pushes them to a target service’s gRPC endpoint. This solves the problem where workers cannot control which consumer processes which message.

Explanation

Why is this needed?

The testing pain point with worker-based services: a PRRC (PR Review Copy) environment and master share the same subscription. There is no way to guarantee that a test message will be consumed by the PRRC pod rather than a master worker – so every test requires manually deploying the commit image to master, which is cumbersome.

The gRPC Pusher solves this as an intermediary:

Pub/Sub Subscription
        ↓  pull
   gRPC Pusher (intermediary layer)
        ↓  push (can control which endpoint to route to)
  Target Service (specified gRPC endpoint)

The Pusher centrally pulls messages, then pushes them to a specified endpoint based on configuration – giving precise control over PRRC traffic without worrying about master workers stealing messages.

Configured via CRD

The Pusher’s behavior is managed through Kubernetes CRD config, which can set:

Knowledge Sugar

Public implementations of this pattern

This “pull then push” message dispatch pattern is common in the industry:

Core design concept: decoupling consume and process

Traditional workers couple “pulling messages from a subscription” and “processing messages” in the same process, making traffic routing hard to control. The Pusher separates the two:

This is also the core idea behind Dapr and Knative – extracting messaging infrastructure out of application logic.

#grpc #architecture #til

← Back to Main Page