Interface IProducerEndpointBuilder<TBuilder>
Builds the ProducerEndpoint.
Inherited Members
Namespace: Silverback.Messaging.Configuration
Assembly: Silverback.Integration.dll
Syntax
public interface IProducerEndpointBuilder<out TBuilder> : IEndpointBuilder<TBuilder> where TBuilder : IProducerEndpointBuilder<out TBuilder>
Type Parameters
Name | Description |
---|---|
TBuilder | The actual builder type. |
Methods
| Improve this doc View sourceAddHeader(string, object?)
Adds the specified header to all produced messages.
Declaration
TBuilder AddHeader(string name, object? value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The header name. |
object | value | The header value. |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
AddHeader<TMessage>(string, Func<IOutboundEnvelope<TMessage>, object?>)
Adds the specified header to all produced messages of the specified type, using a value provider function to determine the header value for each message.
Declaration
TBuilder AddHeader<TMessage>(string name, Func<IOutboundEnvelope<TMessage>, object?> valueProvider) where TMessage : class
Parameters
Type | Name | Description |
---|---|---|
string | name | The header name. |
Func<IOutboundEnvelope<TMessage>, object> | valueProvider | The value provider function. |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages to be enriched with this header. |
AddHeader<TMessage>(string, object?)
Adds the specified header to all produced messages of the specified type.
Declaration
TBuilder AddHeader<TMessage>(string name, object? value) where TMessage : class
Parameters
Type | Name | Description |
---|---|---|
string | name | The header name. |
object | value | The header value. |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages to be enriched with this header. |
EnableChunking(int, bool)
Enables chunking, splitting the larger messages into smaller chunks.
Declaration
TBuilder EnableChunking(int chunkSize, bool alwaysAddHeaders = true)
Parameters
Type | Name | Description |
---|---|---|
int | chunkSize | The maximum chunk size in bytes. |
bool | alwaysAddHeaders | A value indicating whether the |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
Encrypt(EncryptionSettings)
Specifies the EncryptionSettings to be used to encrypt the messages.
Declaration
TBuilder Encrypt(EncryptionSettings encryptionSettings)
Parameters
Type | Name | Description |
---|---|---|
EncryptionSettings | encryptionSettings | The EncryptionSettings. |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
ProduceDirectly()
Specifies that the DefaultProduceStrategy has to be used, producing directly to the message broker.
Declaration
TBuilder ProduceDirectly()
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
ProduceToOutbox()
Specifies that theOutboxProduceStrategy has to be used, storing the messages into the transactional outbox table. The operation is therefore included in the database transaction applying the message side effects to the local database. The IOutboxWorker takes care of asynchronously sending the messages to the message broker.
Declaration
TBuilder ProduceToOutbox()
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
SerializeUsing(IMessageSerializer)
Specifies the IMessageSerializer to be used to serialize the messages.
Declaration
TBuilder SerializeUsing(IMessageSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
IMessageSerializer | serializer | The IMessageSerializer. |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
UseStrategy(IProduceStrategy)
Specifies the strategy to be used to produce the messages.
Declaration
TBuilder UseStrategy(IProduceStrategy strategy)
Parameters
Type | Name | Description |
---|---|---|
IProduceStrategy | strategy | The IProduceStrategy. |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
WithMessageId<TMessage>(Func<IOutboundEnvelope<TMessage>, object?>)
Uses the specified value provider function to set the message id header for each produced message.
Declaration
TBuilder WithMessageId<TMessage>(Func<IOutboundEnvelope<TMessage>, object?> valueProvider) where TMessage : class
Parameters
Type | Name | Description |
---|---|---|
Func<IOutboundEnvelope<TMessage>, object> | valueProvider | The value provider function. |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages to be enriched with this header. |