/// <summary>
 /// Стандартная обработка сообщения об ошибке
 /// </summary>
 /// <param name="message"></param>
 public async Task ErrorMessageHandler(SqlConnection dbconnection, SSSBMessage message)
 {
     try
     {
         _logger.LogError($"ErrorMessageHandler: {message.ConversationHandle} {message.MessageType} {message.ServiceName} {message.GetMessageXML()}");
     }
     finally
     {
         await _serviceBrokerHelper.EndConversation(dbconnection, message.ConversationHandle);
     }
 }
Exemple #2
0
        public override async Task Execute(SqlConnection dbconnection, SSSBMessage message, CancellationToken token)
        {
            Guid conversationHandle = _conversationHandle.HasValue ? _conversationHandle.Value : message.ConversationHandle;

            if (!string.IsNullOrEmpty(_error))
            {
                await _serviceBrokerHelper.EndConversationWithError(dbconnection, conversationHandle, _errorCode.HasValue?_errorCode.Value : 1, _error);
            }
            else
            {
                await _serviceBrokerHelper.EndConversation(dbconnection, conversationHandle);
            }
        }
        /// <summary>
        /// Стандартная обработка сообщения об ошибке
        /// </summary>
        /// <param name="receivedMessage"></param>
        public async Task ErrorMessageHandler(SqlConnection dbconnection, SSSBMessage receivedMessage)
        {
            await _serviceBrokerHelper.EndConversation(dbconnection, receivedMessage.ConversationHandle);

            _logger.LogError(string.Format(ServiceBrokerResources.ErrorMessageReceivedErrMsg, receivedMessage.ConversationHandle, Encoding.Unicode.GetString(receivedMessage.Body)));
        }