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


C# Message.CreateRejectionResponse方法代码示例

本文整理汇总了C#中Orleans.Runtime.Message.CreateRejectionResponse方法的典型用法代码示例。如果您正苦于以下问题:C# Message.CreateRejectionResponse方法的具体用法?C# Message.CreateRejectionResponse怎么用?C# Message.CreateRejectionResponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Orleans.Runtime.Message的用法示例。


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

示例1: RejectMessage

 public void RejectMessage(
     Message message, 
     Message.RejectionTypes rejectType, 
     Exception exc, 
     string rejectInfo = null)
 {
     if (message.Direction == Message.Directions.Request)
     {
         var str = String.Format("{0} {1}", rejectInfo ?? "", exc == null ? "" : exc.ToString());
         MessagingStatisticsGroup.OnRejectedMessage(message);
         Message rejection = message.CreateRejectionResponse(rejectType, str);
         SendRejectionMessage(rejection);
     }
     else
     {
         logger.Warn(ErrorCode.Messaging_Dispatcher_DiscardRejection,
             "Discarding {0} rejection for message {1}. Exc = {2}",
             Enum.GetName(typeof(Message.Directions), message.Direction), message, exc == null ? "" : exc.Message);
     }
 }
开发者ID:andrewalex,项目名称:orleans,代码行数:20,代码来源:Dispatcher.cs

示例2: RejectMessage

        private void RejectMessage(Message msg, string reasonFormat, params object[] reasonParams)
        {
            if (!Running) return;

            var reason = String.Format(reasonFormat, reasonParams);
            if (msg.Direction != Message.Directions.Request)
            {
                if (logger.IsVerbose) logger.Verbose(ErrorCode.ProxyClient_DroppingMsg, "Dropping message: {0}. Reason = {1}", msg, reason);
            }
            else
            {
                if (logger.IsVerbose) logger.Verbose(ErrorCode.ProxyClient_RejectingMsg, "Rejecting message: {0}. Reason = {1}", msg, reason);
                MessagingStatisticsGroup.OnRejectedMessage(msg);
                Message error = msg.CreateRejectionResponse(Message.RejectionTypes.Unrecoverable, reason);
                QueueIncomingMessage(error);
            }
        }
开发者ID:Carlm-MS,项目名称:orleans,代码行数:17,代码来源:ProxiedMessageCenter.cs

示例3: FailMessage

 protected override void FailMessage(Message msg, string reason)
 {
     msg.ReleaseBodyAndHeaderBuffers();
     MessagingStatisticsGroup.OnFailedSentMessage(msg);
     if (MsgCenter.Running && msg.Direction == Message.Directions.Request)
     {
         if (Log.IsVerbose) Log.Verbose(ErrorCode.ProxyClient_RejectingMsg, "Rejecting message: {0}. Reason = {1}", msg, reason);
         MessagingStatisticsGroup.OnRejectedMessage(msg);
         Message error = msg.CreateRejectionResponse(Message.RejectionTypes.Unrecoverable, reason);
         MsgCenter.QueueIncomingMessage(error);
     }
     else
     {
         Log.Warn(ErrorCode.ProxyClient_DroppingMsg, "Dropping message: {0}. Reason = {1}", msg, reason);
         MessagingStatisticsGroup.OnDroppedSentMessage(msg);
     }
 }
开发者ID:Rejendo,项目名称:orleans,代码行数:17,代码来源:GatewayConnection.cs


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