Show / Hide Table of Contents

    Class Producer

    Produces to an endpoint.

    Inheritance
    object
    Producer
    Producer<TBroker, TEndpoint>
    Implements
    IProducer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Broker
    Assembly: Silverback.Integration.dll
    Syntax
    public abstract class Producer : IProducer

    Constructors

    | Improve this doc View source

    Producer(IBroker, IProducerEndpoint, IBrokerBehaviorsProvider<IProducerBehavior>, IServiceProvider, IOutboundLogger<Producer>)

    Initializes a new instance of the Producer class.

    Declaration
    protected Producer(IBroker broker, IProducerEndpoint endpoint, IBrokerBehaviorsProvider<IProducerBehavior> behaviorsProvider, IServiceProvider serviceProvider, IOutboundLogger<Producer> logger)
    Parameters
    Type Name Description
    IBroker broker

    The IBroker that instantiated this producer.

    IProducerEndpoint endpoint

    The endpoint to produce to.

    IBrokerBehaviorsProvider<IProducerBehavior> behaviorsProvider

    The IBrokerBehaviorsProvider<TBehavior>.

    IServiceProvider serviceProvider

    The IServiceProvider to be used to resolve the needed services.

    IOutboundLogger<Producer> logger

    The IOutboundLogger<TCategoryName>.

    Properties

    | Improve this doc View source

    Broker

    Gets the IBroker instance that owns this .

    Declaration
    public IBroker Broker { get; }
    Property Value
    Type Description
    IBroker
    | Improve this doc View source

    Endpoint

    Gets the IProducerEndpoint this instance is connected to.

    Declaration
    public IProducerEndpoint Endpoint { get; }
    Property Value
    Type Description
    IProducerEndpoint
    | Improve this doc View source

    Id

    Gets the InstanceIdentifier uniquely identifying the producer instance.

    Declaration
    public InstanceIdentifier Id { get; }
    Property Value
    Type Description
    InstanceIdentifier
    | Improve this doc View source

    IsConnected

    Gets a value indicating whether this producer is connected to the message broker and ready to produce messages.

    Declaration
    public bool IsConnected { get; }
    Property Value
    Type Description
    bool
    | Improve this doc View source

    IsConnecting

    Gets a value indicating whether this producer is trying to connect to the message broker.

    Declaration
    public bool IsConnecting { get; }
    Property Value
    Type Description
    bool

    Methods

    | Improve this doc View source

    ConnectAsync()

    Initializes the connection to the message broker (if needed).

    Declaration
    public Task ConnectAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    ConnectCoreAsync()

    Connects to the message broker.

    Declaration
    protected virtual Task ConnectCoreAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    DisconnectAsync()

    Disconnects from the message broker (if needed).

    Declaration
    public Task DisconnectAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    DisconnectCoreAsync()

    Disconnects from the message broker.

    Declaration
    protected virtual Task DisconnectCoreAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    Produce(IOutboundEnvelope)

    Publishes the specified message.

    Declaration
    public IBrokerMessageIdentifier? Produce(IOutboundEnvelope envelope)
    Parameters
    Type Name Description
    IOutboundEnvelope envelope

    The envelope containing the message to be delivered.

    Returns
    Type Description
    IBrokerMessageIdentifier

    The IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    Produce(IOutboundEnvelope, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message.

    Declaration
    public void Produce(IOutboundEnvelope envelope, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    IOutboundEnvelope envelope

    The envelope containing the message to be delivered.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Remarks

    In this implementation the message is synchronously enqueued but produced asynchronously. The callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    Produce(object?, IReadOnlyCollection<MessageHeader>?)

    Publishes the specified message.

    Declaration
    public IBrokerMessageIdentifier? Produce(object? message, IReadOnlyCollection<MessageHeader>? headers = null)
    Parameters
    Type Name Description
    object message

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Returns
    Type Description
    IBrokerMessageIdentifier

    The IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    Produce(object?, IReadOnlyCollection<MessageHeader>?, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message.

    Declaration
    public void Produce(object? message, IReadOnlyCollection<MessageHeader>? headers, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    object message

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Remarks

    In this implementation the message is synchronously enqueued but produced asynchronously. The callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    ProduceAsync(IOutboundEnvelope)

    Publishes the specified message.

    Declaration
    public Task<IBrokerMessageIdentifier?> ProduceAsync(IOutboundEnvelope envelope)
    Parameters
    Type Name Description
    IOutboundEnvelope envelope

    The envelope containing the message to be delivered.

    Returns
    Type Description
    Task<IBrokerMessageIdentifier>

    A Task<TResult> representing the asynchronous operation. The task result contains the IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    ProduceAsync(IOutboundEnvelope, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message.

    Declaration
    public Task ProduceAsync(IOutboundEnvelope envelope, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    IOutboundEnvelope envelope

    The envelope containing the message to be delivered.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation. The Task will complete as soon as the message is enqueued.

    Remarks

    The returned Task completes when the message is enqueued while the callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    ProduceAsync(object?, IReadOnlyCollection<MessageHeader>?)

    Publishes the specified message.

    Declaration
    public Task<IBrokerMessageIdentifier?> ProduceAsync(object? message, IReadOnlyCollection<MessageHeader>? headers = null)
    Parameters
    Type Name Description
    object message

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Returns
    Type Description
    Task<IBrokerMessageIdentifier>

    A Task<TResult> representing the asynchronous operation. The task result contains the IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    ProduceAsync(object?, IReadOnlyCollection<MessageHeader>?, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message.

    Declaration
    public Task ProduceAsync(object? message, IReadOnlyCollection<MessageHeader>? headers, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    object message

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation. The Task will complete as soon as the message is enqueued.

    Remarks

    The returned Task completes when the message is enqueued while the callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    ProduceCore(object?, byte[]?, IReadOnlyCollection<MessageHeader>?, string)

    Publishes the specified message and returns its identifier.

    Declaration
    protected abstract IBrokerMessageIdentifier? ProduceCore(object? message, byte[]? messageBytes, IReadOnlyCollection<MessageHeader>? headers, string actualEndpointName)
    Parameters
    Type Name Description
    object message

    The message to be delivered before serialization. This might be null if RawProduce(byte[]?, IReadOnlyCollection<MessageHeader>?), RawProduce(Stream?, IReadOnlyCollection<MessageHeader>?), RawProduceAsync(byte[]?, IReadOnlyCollection<MessageHeader>?) or RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?) have been used to produce.

    byte[] messageBytes

    The actual serialized message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The message headers.

    string actualEndpointName

    The actual endpoint to produce to.

    Returns
    Type Description
    IBrokerMessageIdentifier

    The message identifier assigned by the broker (the Kafka offset or similar).

    | Improve this doc View source

    ProduceCore(object?, byte[]?, IReadOnlyCollection<MessageHeader>?, string, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message and returns its identifier.

    Declaration
    protected abstract void ProduceCore(object? message, byte[]? messageBytes, IReadOnlyCollection<MessageHeader>? headers, string actualEndpointName, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    object message

    The message to be delivered before serialization. This might be null if RawProduce(byte[]?, IReadOnlyCollection<MessageHeader>?), RawProduce(Stream?, IReadOnlyCollection<MessageHeader>?), RawProduceAsync(byte[]?, IReadOnlyCollection<MessageHeader>?) or RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?) have been used to produce.

    byte[] messageBytes

    The actual serialized message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The message headers.

    string actualEndpointName

    The actual endpoint to produce to.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Remarks

    In this implementation the message is synchronously enqueued but produced asynchronously. The callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    ProduceCore(object?, Stream?, IReadOnlyCollection<MessageHeader>?, string)

    Publishes the specified message and returns its identifier.

    Declaration
    protected abstract IBrokerMessageIdentifier? ProduceCore(object? message, Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers, string actualEndpointName)
    Parameters
    Type Name Description
    object message

    The message to be delivered before serialization. This might be null if RawProduce(byte[]?, IReadOnlyCollection<MessageHeader>?), RawProduce(Stream?, IReadOnlyCollection<MessageHeader>?), RawProduceAsync(byte[]?, IReadOnlyCollection<MessageHeader>?) or RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?) have been used to produce.

    Stream messageStream

    The actual serialized message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The message headers.

    string actualEndpointName

    The actual endpoint to produce to.

    Returns
    Type Description
    IBrokerMessageIdentifier

    The message identifier assigned by the broker (the Kafka offset or similar).

    | Improve this doc View source

    ProduceCore(object?, Stream?, IReadOnlyCollection<MessageHeader>?, string, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message and returns its identifier.

    Declaration
    protected abstract void ProduceCore(object? message, Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers, string actualEndpointName, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    object message

    The message to be delivered before serialization. This might be null if RawProduce(byte[]?, IReadOnlyCollection<MessageHeader>?), RawProduce(Stream?, IReadOnlyCollection<MessageHeader>?), RawProduceAsync(byte[]?, IReadOnlyCollection<MessageHeader>?) or RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?) have been used to produce.

    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The message headers.

    string actualEndpointName

    The actual endpoint to produce to.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Remarks

    In this implementation the message is synchronously enqueued but produced asynchronously. The callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    ProduceCoreAsync(object?, byte[]?, IReadOnlyCollection<MessageHeader>?, string)

    Publishes the specified message and returns its identifier.

    Declaration
    protected abstract Task<IBrokerMessageIdentifier?> ProduceCoreAsync(object? message, byte[]? messageBytes, IReadOnlyCollection<MessageHeader>? headers, string actualEndpointName)
    Parameters
    Type Name Description
    object message

    The message to be delivered before serialization. This might be null if RawProduce(byte[]?, IReadOnlyCollection<MessageHeader>?), RawProduce(Stream?, IReadOnlyCollection<MessageHeader>?), RawProduceAsync(byte[]?, IReadOnlyCollection<MessageHeader>?) or RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?) have been used to produce.

    byte[] messageBytes

    The actual serialized message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The message headers.

    string actualEndpointName

    The actual endpoint to produce to.

    Returns
    Type Description
    Task<IBrokerMessageIdentifier>

    A Task<TResult> representing the asynchronous operation. The task result contains the message identifier assigned by the broker (the Kafka offset or similar).

    | Improve this doc View source

    ProduceCoreAsync(object?, byte[]?, IReadOnlyCollection<MessageHeader>?, string, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message and returns its identifier.

    Declaration
    protected abstract Task ProduceCoreAsync(object? message, byte[]? messageBytes, IReadOnlyCollection<MessageHeader>? headers, string actualEndpointName, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    object message

    The message to be delivered before serialization. This might be null if RawProduce(byte[]?, IReadOnlyCollection<MessageHeader>?), RawProduce(Stream?, IReadOnlyCollection<MessageHeader>?), RawProduceAsync(byte[]?, IReadOnlyCollection<MessageHeader>?) or RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?) have been used to produce.

    byte[] messageBytes

    The actual serialized message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The message headers.

    string actualEndpointName

    The actual endpoint to produce to.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation. The Task will complete as soon as the message is enqueued.

    Remarks

    The returned Task completes when the message is enqueued while the callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    ProduceCoreAsync(object?, Stream?, IReadOnlyCollection<MessageHeader>?, string)

    Publishes the specified message and returns its identifier.

    Declaration
    protected abstract Task<IBrokerMessageIdentifier?> ProduceCoreAsync(object? message, Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers, string actualEndpointName)
    Parameters
    Type Name Description
    object message

    The message to be delivered before serialization. This might be null if RawProduce(byte[]?, IReadOnlyCollection<MessageHeader>?), RawProduce(Stream?, IReadOnlyCollection<MessageHeader>?), RawProduceAsync(byte[]?, IReadOnlyCollection<MessageHeader>?) or RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?) have been used to produce.

    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The message headers.

    string actualEndpointName

    The actual endpoint to produce to.

    Returns
    Type Description
    Task<IBrokerMessageIdentifier>

    A Task<TResult> representing the asynchronous operation. The task result contains the message identifier assigned by the broker (the Kafka offset or similar).

    | Improve this doc View source

    ProduceCoreAsync(object?, Stream?, IReadOnlyCollection<MessageHeader>?, string, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message and returns its identifier.

    Declaration
    protected abstract Task ProduceCoreAsync(object? message, Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers, string actualEndpointName, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    object message

    The message to be delivered before serialization. This might be null if RawProduce(byte[]?, IReadOnlyCollection<MessageHeader>?), RawProduce(Stream?, IReadOnlyCollection<MessageHeader>?), RawProduceAsync(byte[]?, IReadOnlyCollection<MessageHeader>?) or RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?) have been used to produce.

    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The message headers.

    string actualEndpointName

    The actual endpoint to produce to.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation. The Task will complete as soon as the message is enqueued.

    Remarks

    The returned Task completes when the message is enqueued while the callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    RawProduce(byte[]?, IReadOnlyCollection<MessageHeader>?)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public IBrokerMessageIdentifier? RawProduce(byte[]? messageContent, IReadOnlyCollection<MessageHeader>? headers = null)
    Parameters
    Type Name Description
    byte[] messageContent

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Returns
    Type Description
    IBrokerMessageIdentifier

    The IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduce(byte[]?, IReadOnlyCollection<MessageHeader>?, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public void RawProduce(byte[]? messageContent, IReadOnlyCollection<MessageHeader>? headers, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    byte[] messageContent

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Remarks

    In this implementation the message is synchronously enqueued but produced asynchronously. The callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    RawProduce(Stream?, IReadOnlyCollection<MessageHeader>?)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public IBrokerMessageIdentifier? RawProduce(Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers = null)
    Parameters
    Type Name Description
    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Returns
    Type Description
    IBrokerMessageIdentifier

    The IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduce(Stream?, IReadOnlyCollection<MessageHeader>?, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public void RawProduce(Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Remarks

    In this implementation the message is synchronously enqueued but produced asynchronously. The callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    RawProduce(string, byte[]?, IReadOnlyCollection<MessageHeader>?)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public IBrokerMessageIdentifier? RawProduce(string actualEndpointName, byte[]? messageContent, IReadOnlyCollection<MessageHeader>? headers = null)
    Parameters
    Type Name Description
    string actualEndpointName

    The actual target endpoint name.

    byte[] messageContent

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Returns
    Type Description
    IBrokerMessageIdentifier

    The IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduce(string, byte[]?, IReadOnlyCollection<MessageHeader>?, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public void RawProduce(string actualEndpointName, byte[]? messageContent, IReadOnlyCollection<MessageHeader>? headers, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    string actualEndpointName

    The actual target endpoint name.

    byte[] messageContent

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Remarks

    In this implementation the message is synchronously enqueued but produced asynchronously. The callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    RawProduce(string, Stream?, IReadOnlyCollection<MessageHeader>?)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public IBrokerMessageIdentifier? RawProduce(string actualEndpointName, Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers = null)
    Parameters
    Type Name Description
    string actualEndpointName

    The actual target endpoint name.

    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Returns
    Type Description
    IBrokerMessageIdentifier

    The IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduce(string, Stream?, IReadOnlyCollection<MessageHeader>?, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public void RawProduce(string actualEndpointName, Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    string actualEndpointName

    The actual target endpoint name.

    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Action<IBrokerMessageIdentifier> onSuccess

    The callback to be invoked when the message is successfully produced.

    Action<Exception> onError

    The callback to be invoked when the produce fails.

    Remarks

    In this implementation the message is synchronously enqueued but produced asynchronously. The callbacks are called when the message is actually produced (or the produce failed).

    | Improve this doc View source

    RawProduceAsync(byte[]?, IReadOnlyCollection<MessageHeader>?)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public Task<IBrokerMessageIdentifier?> RawProduceAsync(byte[]? messageContent, IReadOnlyCollection<MessageHeader>? headers = null)
    Parameters
    Type Name Description
    byte[] messageContent

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Returns
    Type Description
    Task<IBrokerMessageIdentifier>

    A Task<TResult> representing the asynchronous operation. The task result contains the IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduceAsync(byte[]?, IReadOnlyCollection<MessageHeader>?, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public Task RawProduceAsync(byte[]? messageContent, IReadOnlyCollection<MessageHeader>? headers, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    byte[] messageContent

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Action<IBrokerMessageIdentifier> onSuccess
    Action<Exception> onError
    Returns
    Type Description
    Task

    A Task<TResult> representing the asynchronous operation. The task result contains the IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public Task<IBrokerMessageIdentifier?> RawProduceAsync(Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers = null)
    Parameters
    Type Name Description
    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Returns
    Type Description
    Task<IBrokerMessageIdentifier>

    A Task<TResult> representing the asynchronous operation. The task result contains the IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public Task RawProduceAsync(Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Action<IBrokerMessageIdentifier> onSuccess
    Action<Exception> onError
    Returns
    Type Description
    Task

    A Task<TResult> representing the asynchronous operation. The task result contains the IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduceAsync(string, byte[]?, IReadOnlyCollection<MessageHeader>?)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public Task<IBrokerMessageIdentifier?> RawProduceAsync(string actualEndpointName, byte[]? messageContent, IReadOnlyCollection<MessageHeader>? headers = null)
    Parameters
    Type Name Description
    string actualEndpointName

    The actual target endpoint name.

    byte[] messageContent

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Returns
    Type Description
    Task<IBrokerMessageIdentifier>

    A Task<TResult> representing the asynchronous operation. The task result contains the IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduceAsync(string, byte[]?, IReadOnlyCollection<MessageHeader>?, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public Task RawProduceAsync(string actualEndpointName, byte[]? messageContent, IReadOnlyCollection<MessageHeader>? headers, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    string actualEndpointName

    The actual target endpoint name.

    byte[] messageContent

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Action<IBrokerMessageIdentifier> onSuccess
    Action<Exception> onError
    Returns
    Type Description
    Task

    A Task<TResult> representing the asynchronous operation. The task result contains the IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduceAsync(string, Stream?, IReadOnlyCollection<MessageHeader>?)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public Task<IBrokerMessageIdentifier?> RawProduceAsync(string actualEndpointName, Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers = null)
    Parameters
    Type Name Description
    string actualEndpointName

    The actual target endpoint name.

    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Returns
    Type Description
    Task<IBrokerMessageIdentifier>

    A Task<TResult> representing the asynchronous operation. The task result contains the IBrokerMessageIdentifier of the produced record.

    | Improve this doc View source

    RawProduceAsync(string, Stream?, IReadOnlyCollection<MessageHeader>?, Action<IBrokerMessageIdentifier?>, Action<Exception>)

    Publishes the specified message as-is, without sending it through the behaviors pipeline.

    Declaration
    public Task RawProduceAsync(string actualEndpointName, Stream? messageStream, IReadOnlyCollection<MessageHeader>? headers, Action<IBrokerMessageIdentifier?> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    string actualEndpointName

    The actual target endpoint name.

    Stream messageStream

    The message to be delivered.

    IReadOnlyCollection<MessageHeader> headers

    The optional message headers.

    Action<IBrokerMessageIdentifier> onSuccess
    Action<Exception> onError
    Returns
    Type Description
    Task

    A Task<TResult> representing the asynchronous operation. The task result contains the IBrokerMessageIdentifier of the produced record.

    Implements

    IProducer
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini