internal static Message Load(SqlDataReader reader) { var message = new Message { ConversationGroupId = reader.GetGuid(0), ConversationHandle = reader.GetGuid(1), MessageSequenceNumber = reader.GetInt64(2), ServiceName = reader.GetString(3), ServiceContractName = reader.GetString(4), MessageTypeName = reader.GetString(5), Body = reader.IsDBNull(7) ? new byte[0] : reader.GetSqlBytes(7).Buffer }; return message; }
internal static Message Load(SqlDataReader reader) { var message = new Message(); // RECEIVE conversation_group_id, conversation_handle, // message_sequence_number, service_name, service_contract_name, // message_type_name, validation, message_body // FROM Queue message.ConversationGroupId = reader.GetGuid(0); message.ConversationHandle = reader.GetGuid(1); message.MessageSequenceNumber = reader.GetInt64(2); message.ServiceName = reader.GetString(3); message.ServiceContractName = reader.GetString(4); message.MessageTypeName = reader.GetString(5); //m_validation = reader.GetString(6); if (!reader.IsDBNull(7)) { message.Body = reader.GetSqlBytes(7).Buffer; } else message.Body = new byte[0]; return message; }
private void MoveToErrorService(Message message) { GetSqlTransactionManager().RunInTransaction(transaction => { var conversationHandle = ServiceBrokerWrapper.BeginConversation(transaction, ReturnService, ErrorService, NServiceBusTransportMessageContract); ServiceBrokerWrapper.Send(transaction, conversationHandle, NServiceBusTransportMessage, message.Body); ServiceBrokerWrapper.EndConversation(transaction, conversationHandle); }); }