internal static void LogAction(MessageState state, string message) { if ((int)state < 100) { QLogger.Info("State:{0}, Message:{1}", state.ToString(), message); } else { QLogger.Error("State:{0}, Message:{1}", state.ToString(), message); } }
public static QueueItem Ack(MessageState state, QueueCmd cmd, Exception ex) { return(new QueueItem() { Command = cmd, Label = ex == null?state.ToString() : ex.Message, MessageState = state }); }
public static QueueItem Ack(MessageState state, QueueCmd cmd) { return(new QueueItem() { Command = cmd, Label = state.ToString(), MessageState = state }); }
public Task UpdateMessageState(NpgsqlConnection connection, Guid queueMessageId, string stateDescription, MessageState messageState) { var sql = $"UPDATE {_schemaName}.queuemessages " + " SET state =:messageState, Updated = clock_timestamp(), StateDescription = :stateDescription " + " WHERE queuemessageid = :queueMessageId"; return(connection.QueryAsync(sql, new { messageState = messageState.ToString(), stateDescription, queueMessageId })); }
public static void WriteAck(Stream pipeStream, MessageState state, QueueCmd cmd, string label) { if (pipeStream == null) { throw new MessageException(MessageState.PipeError, "Invalid stream to write ack"); } string lbl = label == null?state.ToString() : label; QueueItem response = QueueItem.Ack(state, cmd, lbl, null); using (NetStream stream = new NetStream()) { response.EntityWrite(stream, null); WriteReponse(pipeStream, stream.ToArray()); } QLogger.Debug("Server Ack State:{0}, Label: {1}", state, label); }
void changeMessageInc() { Debug.Log("changeMessage from" + m.ToString("F") + " to " + (++m).ToString("F")); }
void changeMessage(MessageState ms) { m = ms; Debug.Log("Message is " + m.ToString("F")); }