public void Build(PointToPointSendChannelSchema schema) { Contract.Requires(schema != null); SendMessageCache cache = CreateCache(schema); RegisterCacheWithAcknowledgementHandler(cache); BuildPipeline(schema, cache); NotifyPointToPointSendChannelBuilt(schema); }
public PointToPointSenderConfiguration( EndpointAddress fromAddress, EndpointAddress toAddress, MessagingConfiguration messagingConfiguration, ISystemTime systemTime) : base(messagingConfiguration) { this.systemTime = systemTime; sendSchema = new PointToPointSendChannelSchema { ExpiryStrategy = new PassthroughMessageExpiryStrategy(), ExpiryAction = () => { }, FilteringStrategy = new PassThroughMessageFilterStategy(), ReceiverAddress = toAddress, FromAddress = fromAddress }; RepeatMessages().WithDefaultEscalationStrategy(); }
void BuildPipeline(PointToPointSendChannelSchema schema, SendMessageCache cache) { MessagePipelineBuilder.Build() .WithBusSendTo(new MessageFilter(schema.FilteringStrategy)) .ToProcessor(new BatchPackager()) .ToConverter(new MessagePayloadPackager(serialiser)) .ToProcessor(new Sequencer(cache)) .ToProcessor(new MessageAddresser(schema.FromAddress, schema.ReceiverAddress)) .ToProcessor(new SendChannelMessageCacher(cache)) .ToMessageRepeater(cache, systemTime, taskRepeater, schema.RepeatStrategy) .ToProcessor(new SendChannelMessageCacheUpdater(cache)) .ToProcessor(new SequenceOriginRecorder(cache)) .ToProcessor(new PersistenceSourceRecorder()) .Queue() .ToProcessor(new MessageExpirer(schema.ExpiryAction, cache, schema.ExpiryStrategy)) .ToProcessor(new LoadBalancer(cache, taskScheduler)) .ToProcessor(new LastSentRecorder(systemTime)) .ToProcessor(authenticationSessionAttacherFactory.Create(schema.ReceiverAddress)) .ToEndPoint(messageSender); }
SendMessageCache CreateCache(PointToPointSendChannelSchema schema) { return messageCacheFactory.BuildSendCache(PersistenceUseType.PointToPointSend, schema.FromAddress, schema); }
static void NotifyPointToPointSendChannelBuilt(PointToPointSendChannelSchema schema) { Messenger.Send(new PointToPointSendChannelBuilt { SenderAddress = schema.FromAddress, ReceiverAddress = schema.ReceiverAddress }); }