Table of Contents

Class RabbitMqPipelineSource<T>

Namespace
Pipelinez.RabbitMQ.Source
Assembly
Pipelinez.RabbitMQ.dll

Consumes records from a RabbitMQ queue and publishes them into a Pipelinez pipeline.

public class RabbitMqPipelineSource<T> : PipelineSourceBase<T>, IPipelineExecutionConfigurable, IDistributedPipelineSource<T>, IPipelineSource<T>, IFlowSource<PipelineContainer<T>> where T : PipelineRecord

Type Parameters

T

The pipeline record type.

Inheritance
RabbitMqPipelineSource<T>
Implements
Inherited Members

Constructors

RabbitMqPipelineSource(RabbitMqSourceOptions, Func<RabbitMqDeliveryContext, T>)

Initializes a new RabbitMQ-backed pipeline source.

public RabbitMqPipelineSource(RabbitMqSourceOptions options, Func<RabbitMqDeliveryContext, T> recordMapper)

Parameters

options RabbitMqSourceOptions

The RabbitMQ source options.

recordMapper Func<RabbitMqDeliveryContext, T>

Maps a RabbitMQ delivery into a pipeline record.

Properties

SupportsDistributedExecution

Gets a value indicating whether the source supports distributed execution.

public bool SupportsDistributedExecution { get; }

Property Value

bool

TransportName

Gets the transport name reported in distributed metadata.

public string TransportName { get; }

Property Value

string

Methods

GetOwnedPartitions()

Gets the partitions currently owned by the source.

public IReadOnlyList<PipelinePartitionLease> GetOwnedPartitions()

Returns

IReadOnlyList<PipelinePartitionLease>

The owned partition leases.

GetPartitionExecutionStates()

Gets the current execution state for owned partitions.

public IReadOnlyList<PipelinePartitionExecutionState> GetPartitionExecutionStates()

Returns

IReadOnlyList<PipelinePartitionExecutionState>

The partition execution state snapshots.

Initialize()

Provides an opportunity for the source to initialize transport-specific state.

protected override void Initialize()

MainLoop(CancellationTokenSource)

Executes the main source loop.

protected override Task MainLoop(CancellationTokenSource cancellationToken)

Parameters

cancellationToken CancellationTokenSource

The runtime cancellation source used to stop the source.

Returns

Task

A task that completes when the source loop exits.

OnPipelineContainerComplete(object, PipelineContainerCompletedEventHandlerArgs<PipelineContainer<T>>)

Handles notification that a published container completed successfully.

public override void OnPipelineContainerComplete(object sender, PipelineContainerCompletedEventHandlerArgs<PipelineContainer<T>> e)

Parameters

sender object

The event sender.

e PipelineContainerCompletedEventHandlerArgs<PipelineContainer<T>>

The completed container event arguments.