• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# MessagePayload类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetDelay

        int GetDelay(MessagePayload toGetDelayFor)
        {
            int unlimitedDelay = GetUnlimitedDelay(toGetDelayFor);

            return unlimitedDelay < Peak 
                ? unlimitedDelay 
                : Peak;
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:8,代码来源:EscalatingTimeRepeatStrategy.cs


示例17: InputMessage

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

            toInput.SetFirstSequence(messageCache.GetFirstSequenceInCache());
            toInput.SetSequenceOriginSetOn(messageCache.FirstItemCachedOn);
            OnMessageProcessed(toInput);
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:8,代码来源:SequenceOriginRecorder.cs


示例18: InputMessage

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

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


示例19: LogMessage

 protected static void LogMessage(MessagePayload toInput)
 {
     Logger.Debug(
         "Repeating message: {0} on {1} with sequence {2}",
         toInput.Id,
         toInput.HasHeader<FromAddressHeader>() ? toInput.GetFromAddress().Channel : "n/a",
         toInput.HasSequence() ? toInput.GetSequence().ToString() : "n/a");
 }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:8,代码来源:LoggingRepeatStrategy.cs


示例20: HandleMessage

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

            LogMessage(toHandle);

            this.outgoingQueue.Enqueue(toHandle);
        }
开发者ID:SystemDot,项目名称:SystemDotServiceBus,代码行数:9,代码来源:SentMessageHandler.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MessageProperties类代码示例发布时间:2022-05-24
下一篇:
C# MessagePackObject类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap