当前位置: 首页>>代码示例>>C#>>正文


C# MessagePayload类代码示例

本文整理汇总了C#中MessagePayload的典型用法代码示例。如果您正苦于以下问题:C# MessagePayload类的具体用法?C# MessagePayload怎么用?C# MessagePayload使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MessagePayload类属于命名空间,在下文中一共展示了MessagePayload类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Should_support_delivery

        public void Should_support_delivery()
        {
            Vane<Message> vane = VaneFactory.New<Message>(x =>
                {
                    x.Consumer(() => new TestConsumer(), xc =>
                        {
                            xc.Consume<A>(c => c.Consume);
                            xc.Consume<B>(c => c.Consume);
                        });
                });

            var a = new A {Value = "Hello"};
            Payload<Message> payload = new MessagePayload<A>(a);

            vane.Execute(payload, CancellationToken.None);

            var b = new B {Value = "World"};
            payload = new MessagePayload<B>(b);

            vane.Execute(payload, CancellationToken.None);

            var visitor = new StringVaneVisitor();
            visitor.Visit(vane);
            Console.WriteLine(visitor.ToString());
        }
开发者ID:TheOrangeBook,项目名称:FeatherVane,代码行数:25,代码来源:Consumer_Specs.cs

示例2: ReceiveAcknowledgementFor

 public void ReceiveAcknowledgementFor(MessagePayload messagePayload)
 {
     ReceiveMessage(
         new MessagePayload()
             .AsAcknowlegement(messagePayload.GetPersistenceId())
             .SetToChannel(messagePayload.GetFromAddress().Channel));
 }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:TestInProcessMessageServer.cs

示例3: InputMessage

        public override void InputMessage(MessagePayload toInput)
        {
            if(!toInput.HasBody()) return;
            if(toInput.GetToAddress() != address) return;

            OnMessageProcessed(toInput);
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:BodyMessageFilter.cs

示例4: PersistMessage

        void PersistMessage(MessagePayload toInput)
        {
            Logger.Debug("Caching message payload {0}", toInput.Id);

            toInput.SetPersistenceId(messageCache.Address, messageCache.UseType);
            messageCache.AddMessageAndIncrementSequence(toInput);
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:SendChannelMessageCacher.cs

示例5: PerformLogging

 void PerformLogging(MessagePayload toInput)
 {
     Logger.Debug(
         "Attaching session {0} for message: {0}", 
         cache.GetCurrentSessionFor(GetServer()).Id, 
         toInput.Id);
 }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:AuthenticationSessionAttacher.cs

示例6: HandleMessage

        public void HandleMessage(MessagePayload toHandle, List<MessagePayload> outgoingMessages)
        {
            if (!toHandle.IsLongPollRequest())
                return;

            outgoingMessages.AddRange(outgoingQueue.DequeueAll(toHandle.GetLongPollRequestServerPath()));
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:LongPollHandler.cs

示例7: InputMessage

        public override void InputMessage(MessagePayload toInput)
        {
            Logger.Debug("Recording message persistence source on payload {0}", toInput.Id);

            toInput.SetSourcePersistenceId(toInput.GetPersistenceId());
            OnMessageProcessed(toInput);
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:PersistenceSourceRecorder.cs

示例8: LogWithAddress

 static void LogWithAddress(MessagePayload toHandle)
 {
     Logger.Debug("Handling sent message {0} for {1} from {2}",
         toHandle.Id,
         toHandle.GetToAddress().Channel,
         toHandle.GetToAddress().Server.Address);
 }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:SentMessageHandler.cs

示例9: CreateLongPollPayload

        MessagePayload CreateLongPollPayload(MessageServer toListenFor)
        {
            var payload = new MessagePayload();
            payload.SetLongPollRequest(toListenFor);

            return payload;
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:LongPoller.cs

示例10: CacheMessage

 void CacheMessage(MessagePayload toInput)
 {
     if(messageCache.ContainsMessage(toInput))
         messageCache.UpdateMessage(toInput);
     else 
         messageCache.AddMessage(toInput);
 }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:ReceiveChannelMessageCacher.cs

示例11: InputMessage

        public override void InputMessage(MessagePayload toInput)
        {
            Logger.Debug("Recording the last time sent on message payload {0}", toInput.Id);

            SetTimeOnMessage(toInput);
            OnMessageProcessed(toInput);
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:TimeSentRecorder.cs

示例12: InputMessage

        public override void InputMessage(MessagePayload toInput)
        {
            if (messageCache.ResetOn < toInput.GetSequenceOriginSetOn())
                messageCache.Reset(toInput.GetFirstSequence(), toInput.GetSequenceOriginSetOn());

            OnMessageProcessed(toInput);
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:7,代码来源:SequenceOriginApplier.cs

示例13: InputMessage

        public override void InputMessage(MessagePayload toInput)
        {
            SetCurentSenderAddress(toInput);
            SetCurrentReceiverAddress(toInput);
            SetCurrentCorrelationId(toInput);

            OnMessageProcessed(toInput);
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:8,代码来源:ReplyChannelSelector.cs

示例14: InputMessage

        public override void InputMessage(MessagePayload toInput)
        {
            Logger.Debug("Addressing message payload {0} to {1}", toInput.Id, toAddress);

            toInput.SetFromAddress(fromAddress);
            toInput.SetToAddress(toAddress);
            OnMessageProcessed(toInput);
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:8,代码来源:MessageAddresser.cs

示例15: Enqueue

        public void Enqueue(MessagePayload toEnqueue)
        {
            Contract.Requires(toEnqueue != null);

            CreateQueueIfNonExistant(toEnqueue.GetToAddress().Server);

            queues[toEnqueue.GetToAddress().Server].Enqueue(toEnqueue);
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:8,代码来源:MessagePayloadQueue.cs


注:本文中的MessagePayload类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。