Show / Hide Table of Contents

    Interface IProducer

    Produces to an endpoint.

    Namespace: Silverback.Messaging.Broker
    Assembly: Silverback.Integration.dll
    Syntax
    public interface IProducer

    Properties

    | Improve this doc View source

    Broker

    Gets the IBroker instance that owns this .

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

    Endpoint

    Gets the IProducerEndpoint this instance is connected to.

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

    Id

    Gets the InstanceIdentifier uniquely identifying the producer instance.

    Declaration
    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
    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
    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
    Task ConnectAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    DisconnectAsync()

    Disconnects from the message broker (if needed).

    Declaration
    Task DisconnectAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    Produce(IOutboundEnvelope)

    Publishes the specified message.

    Declaration
    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
    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
    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
    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
    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
    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
    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
    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

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

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

    Declaration
    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
    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
    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
    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
    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
    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
    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
    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
    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
    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

    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

    RawProduceAsync(Stream?, IReadOnlyCollection<MessageHeader>?)

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

    Declaration
    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
    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

    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

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

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

    Declaration
    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
    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

    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

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

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

    Declaration
    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
    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

    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
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini