Class RabbitMqPipelineSource<T>
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
TThe 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
optionsRabbitMqSourceOptionsThe RabbitMQ source options.
recordMapperFunc<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
TransportName
Gets the transport name reported in distributed metadata.
public string TransportName { get; }
Property Value
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
cancellationTokenCancellationTokenSourceThe 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
senderobjectThe event sender.
ePipelineContainerCompletedEventHandlerArgs<PipelineContainer<T>>The completed container event arguments.