Show / Hide Table of Contents

    Class RabbitProducer

    Produces to an endpoint.

    Inheritance
    System.Object
    Producer
    Producer<RabbitBroker, RabbitProducerEndpoint>
    RabbitProducer
    Implements
    IProducer
    System.IDisposable
    Inherited Members
    Producer<RabbitBroker, RabbitProducerEndpoint>.Broker
    Producer<RabbitBroker, RabbitProducerEndpoint>.Endpoint
    Producer.Id
    Producer.Broker
    Producer.Endpoint
    Producer.IsConnecting
    Producer.IsConnected
    Producer.ConnectAsync()
    Producer.DisconnectAsync()
    Producer.Produce(Object, IReadOnlyCollection<MessageHeader>)
    Producer.Produce(IOutboundEnvelope)
    Producer.Produce(Object, IReadOnlyCollection<MessageHeader>, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.Produce(IOutboundEnvelope, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.RawProduce(Byte[], IReadOnlyCollection<MessageHeader>)
    Producer.RawProduce(Stream, IReadOnlyCollection<MessageHeader>)
    Producer.RawProduce(String, Byte[], IReadOnlyCollection<MessageHeader>)
    Producer.RawProduce(String, Stream, IReadOnlyCollection<MessageHeader>)
    Producer.RawProduce(Byte[], IReadOnlyCollection<MessageHeader>, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.RawProduce(Stream, IReadOnlyCollection<MessageHeader>, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.RawProduce(String, Byte[], IReadOnlyCollection<MessageHeader>, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.RawProduce(String, Stream, IReadOnlyCollection<MessageHeader>, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.ProduceAsync(Object, IReadOnlyCollection<MessageHeader>)
    Producer.ProduceAsync(IOutboundEnvelope)
    Producer.ProduceAsync(Object, IReadOnlyCollection<MessageHeader>, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.ProduceAsync(IOutboundEnvelope, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.RawProduceAsync(Byte[], IReadOnlyCollection<MessageHeader>)
    Producer.RawProduceAsync(Stream, IReadOnlyCollection<MessageHeader>)
    Producer.RawProduceAsync(String, Byte[], IReadOnlyCollection<MessageHeader>)
    Producer.RawProduceAsync(String, Stream, IReadOnlyCollection<MessageHeader>)
    Producer.RawProduceAsync(Byte[], IReadOnlyCollection<MessageHeader>, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.RawProduceAsync(Stream, IReadOnlyCollection<MessageHeader>, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.RawProduceAsync(String, Byte[], IReadOnlyCollection<MessageHeader>, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.RawProduceAsync(String, Stream, IReadOnlyCollection<MessageHeader>, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Producer.ConnectCoreAsync()
    Producer.DisconnectCoreAsync()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Silverback.Messaging.Broker
    Assembly: Silverback.Integration.RabbitMQ.dll
    Syntax
    public sealed class RabbitProducer : Producer<RabbitBroker, RabbitProducerEndpoint>, IProducer, IDisposable

    Constructors

    | Improve this doc View source

    RabbitProducer(RabbitBroker, RabbitProducerEndpoint, IBrokerBehaviorsProvider<IProducerBehavior>, IServiceProvider, IOutboundLogger<Producer>)

    Initializes a new instance of the RabbitProducer class.

    Declaration
    public RabbitProducer(RabbitBroker broker, RabbitProducerEndpoint endpoint, IBrokerBehaviorsProvider<IProducerBehavior> behaviorsProvider, IServiceProvider serviceProvider, IOutboundLogger<Producer> logger)
    Parameters
    Type Name Description
    RabbitBroker broker

    The IBroker that instantiated this producer.

    RabbitProducerEndpoint endpoint

    The endpoint to produce to.

    IBrokerBehaviorsProvider<IProducerBehavior> behaviorsProvider

    The IBrokerBehaviorsProvider<TBehavior>.

    System.IServiceProvider serviceProvider

    The System.IServiceProvider to be used to resolve the needed services.

    IOutboundLogger<Producer> logger

    The ISilverbackLogger.

    Methods

    | Improve this doc View source

    Dispose()

    Declaration
    public void Dispose()
    | Improve this doc View source

    ProduceCore(Object, Byte[], IReadOnlyCollection<MessageHeader>, String)

    Publishes the specified message and returns its identifier.

    Declaration
    protected override IBrokerMessageIdentifier ProduceCore(object message, byte[] messageBytes, IReadOnlyCollection<MessageHeader> headers, string actualEndpointName)
    Parameters
    Type Name Description
    System.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.

    System.Byte[] messageBytes

    The actual serialized message to be delivered.

    System.Collections.Generic.IReadOnlyCollection<MessageHeader> headers

    The message headers.

    System.String actualEndpointName

    The actual endpoint to produce to.

    Returns
    Type Description
    IBrokerMessageIdentifier

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

    Overrides
    Producer.ProduceCore(Object, Byte[], IReadOnlyCollection<MessageHeader>, String)
    | 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 override void ProduceCore(object message, byte[] messageBytes, IReadOnlyCollection<MessageHeader> headers, string actualEndpointName, Action<IBrokerMessageIdentifier> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    System.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.

    System.Byte[] messageBytes

    The actual serialized message to be delivered.

    System.Collections.Generic.IReadOnlyCollection<MessageHeader> headers

    The message headers.

    System.String actualEndpointName

    The actual endpoint to produce to.

    System.Action<IBrokerMessageIdentifier> onSuccess

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

    System.Action<System.Exception> onError

    The callback to be invoked when the produce fails.

    Overrides
    Producer.ProduceCore(Object, Byte[], IReadOnlyCollection<MessageHeader>, String, Action<IBrokerMessageIdentifier>, Action<Exception>)
    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 override IBrokerMessageIdentifier ProduceCore(object message, Stream messageStream, IReadOnlyCollection<MessageHeader> headers, string actualEndpointName)
    Parameters
    Type Name Description
    System.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.

    System.IO.Stream messageStream

    The actual serialized message to be delivered.

    System.Collections.Generic.IReadOnlyCollection<MessageHeader> headers

    The message headers.

    System.String actualEndpointName

    The actual endpoint to produce to.

    Returns
    Type Description
    IBrokerMessageIdentifier

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

    Overrides
    Producer.ProduceCore(Object, Stream, IReadOnlyCollection<MessageHeader>, String)
    | 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 override void ProduceCore(object message, Stream messageStream, IReadOnlyCollection<MessageHeader> headers, string actualEndpointName, Action<IBrokerMessageIdentifier> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    System.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.

    System.IO.Stream messageStream

    The message to be delivered.

    System.Collections.Generic.IReadOnlyCollection<MessageHeader> headers

    The message headers.

    System.String actualEndpointName

    The actual endpoint to produce to.

    System.Action<IBrokerMessageIdentifier> onSuccess

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

    System.Action<System.Exception> onError

    The callback to be invoked when the produce fails.

    Overrides
    Producer.ProduceCore(Object, Stream, IReadOnlyCollection<MessageHeader>, String, Action<IBrokerMessageIdentifier>, Action<Exception>)
    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 override async Task<IBrokerMessageIdentifier> ProduceCoreAsync(object message, byte[] messageBytes, IReadOnlyCollection<MessageHeader> headers, string actualEndpointName)
    Parameters
    Type Name Description
    System.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.

    System.Byte[] messageBytes

    The actual serialized message to be delivered.

    System.Collections.Generic.IReadOnlyCollection<MessageHeader> headers

    The message headers.

    System.String actualEndpointName

    The actual endpoint to produce to.

    Returns
    Type Description
    System.Threading.Tasks.Task<IBrokerMessageIdentifier>

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

    Overrides
    Producer.ProduceCoreAsync(Object, Byte[], IReadOnlyCollection<MessageHeader>, String)
    | 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 override async Task ProduceCoreAsync(object message, byte[] messageBytes, IReadOnlyCollection<MessageHeader> headers, string actualEndpointName, Action<IBrokerMessageIdentifier> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    System.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.

    System.Byte[] messageBytes

    The actual serialized message to be delivered.

    System.Collections.Generic.IReadOnlyCollection<MessageHeader> headers

    The message headers.

    System.String actualEndpointName

    The actual endpoint to produce to.

    System.Action<IBrokerMessageIdentifier> onSuccess

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

    System.Action<System.Exception> onError

    The callback to be invoked when the produce fails.

    Returns
    Type Description
    System.Threading.Tasks.Task

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

    Overrides
    Producer.ProduceCoreAsync(Object, Byte[], IReadOnlyCollection<MessageHeader>, String, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Remarks

    The returned System.Threading.Tasks.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 override async Task<IBrokerMessageIdentifier> ProduceCoreAsync(object message, Stream messageStream, IReadOnlyCollection<MessageHeader> headers, string actualEndpointName)
    Parameters
    Type Name Description
    System.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.

    System.IO.Stream messageStream

    The message to be delivered.

    System.Collections.Generic.IReadOnlyCollection<MessageHeader> headers

    The message headers.

    System.String actualEndpointName

    The actual endpoint to produce to.

    Returns
    Type Description
    System.Threading.Tasks.Task<IBrokerMessageIdentifier>

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

    Overrides
    Producer.ProduceCoreAsync(Object, Stream, IReadOnlyCollection<MessageHeader>, String)
    | 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 override async Task ProduceCoreAsync(object message, Stream messageStream, IReadOnlyCollection<MessageHeader> headers, string actualEndpointName, Action<IBrokerMessageIdentifier> onSuccess, Action<Exception> onError)
    Parameters
    Type Name Description
    System.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.

    System.IO.Stream messageStream

    The message to be delivered.

    System.Collections.Generic.IReadOnlyCollection<MessageHeader> headers

    The message headers.

    System.String actualEndpointName

    The actual endpoint to produce to.

    System.Action<IBrokerMessageIdentifier> onSuccess

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

    System.Action<System.Exception> onError

    The callback to be invoked when the produce fails.

    Returns
    Type Description
    System.Threading.Tasks.Task

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

    Overrides
    Producer.ProduceCoreAsync(Object, Stream, IReadOnlyCollection<MessageHeader>, String, Action<IBrokerMessageIdentifier>, Action<Exception>)
    Remarks

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

    Implements

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