本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}