Class GrpcProducer
gRPC producer (client). Calls the method address carried by the endpoint URI — by default the
built-in generic RedbService/Process, or any typed /package.Service/Method.
Messages are marshalled as raw bytes, so the producer can call a typed .proto service whose
stubs it has never seen: in envelope mode the body is wrapped in a RedbMessage, in raw mode
the exchange body goes on the wire as-is.
public class GrpcProducer : ConnectableProducer, IProducer, IProcessor
Inheritance
Implements
Inherited Members
ConnectableProducer.ConnectAsync(CancellationToken),ConnectableProducer.DisconnectAsync(CancellationToken),ConnectableProducer.EnsureConnectedAsync(CancellationToken),ConnectableProducer.EnsureStarted(),ConnectableProducer.IsStarted,ConnectableProducer.Logger,ConnectableProducer.MarkConnectionLost(Exception),ConnectableProducer.OnConnectionLost(Exception),ConnectableProducer.Process(IExchange, CancellationToken),ConnectableProducer.ProducerEndpoint,ConnectableProducer.ProducerName,ConnectableProducer.Start(CancellationToken),ConnectableProducer.Stop(CancellationToken),ConnectableProducer.Supervisor
Properties
ProducerEndpoint
The endpoint this producer sends to.
protected override IEndpoint ProducerEndpoint { get; }
ProducerName
Display name for logging (e.g. "http:https://api.example.com", "kafka:orders").
protected override string ProducerName { get; }
Methods
ConnectAsync(CancellationToken)
Set up connection/resources. Awaited by Start() to completion before IsStarted flips to
protected override Task ConnectAsync(CancellationToken ct)
DisconnectAsync(CancellationToken)
Tear down connection/resources. Called from Stop() after the started flag is cleared.
protected override Task DisconnectAsync(CancellationToken ct)
Process(IExchange, CancellationToken)
Processes the exchange asynchronously.
public override Task Process(IExchange exchange, CancellationToken ct = default)
Constructors
GrpcProducer(GrpcEndpoint, GrpcEndpointOptions)
Creates a gRPC producer.