private void ExchangeClientAck(MessageAck messageACK) { _thAckResponse.AddThreadData(new AFTEnableDisableThreadDataResponse() { MessageID = messageACK.MessageID, Ack = messageACK.ACK, }); LogManager.WriteLog("ExchangeClientAck(AFT) | MessageID: " + messageACK.MessageID.ToString() + ", ACK Status: " + messageACK.ACK.ToString() , LogManager.enumLogLevel.Info); }
void _exchangeClient_EMP_DATA_ACK(MessageAck messageACK) { _thAckResponse.AddThreadData(new EmployeeMasterCardThreadDataResponse() { MessageID = messageACK.MessageID, Ack = messageACK.ACK, }); LogManager.WriteLog("ExchangeClientAck(Employee card event) | MessageID: " + messageACK.MessageID.ToString() + ", ACK Status: " + messageACK.ACK.ToString() , LogManager.enumLogLevel.Info); }
private void OnMessageAck(JsonMessageAck arg) { var channel = Channels.GetChannel(arg.ChannelId); if (channel is IMessageChannel messageChannel) { messageChannel.LastReadMessageId = arg.MessageId; } // TODO: Channel registration MessageAck?.Invoke(this, new MessageAck(arg, this)); }
public void AfterMessageIsConsumed(MessageDispatch dispatch, bool expired) { if (this.unconsumedMessages.Closed) { return; } if (expired == true) { lock (this.dispatchedMessages) { this.dispatchedMessages.Remove(dispatch); } // TODO - Not sure if we need to ack this in stomp. // AckLater(dispatch, AckType.ConsumedAck); } else { if (this.session.IsTransacted) { // Do nothing. } else if (this.session.IsAutoAcknowledge) { if (this.deliveringAcks.CompareAndSet(false, true)) { lock (this.dispatchedMessages) { MessageAck ack = new MessageAck(); ack.AckType = (byte)AckType.ConsumedAck; ack.ConsumerId = this.info.ConsumerId; ack.Destination = dispatch.Destination; ack.LastMessageId = dispatch.Message.MessageId; ack.MessageCount = 1; this.session.SendAck(ack); } this.deliveringAcks.Value = false; } } else if (this.session.IsClientAcknowledge || this.session.IsIndividualAcknowledge) { // Do nothing. } else { throw new NMSException("Invalid session state."); } } }
public void Run() { Running = true; var ipHost = Dns.GetHostEntry(Dns.GetHostName()); var ipAddress = ipHost.AddressList[0]; var localEndPoint = new IPEndPoint(ipAddress, listening_port); var listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { listener.Bind(localEndPoint); listener.Listen(10); while (Running) { // logger.Info("Waiting for a message..."); var handler = listener.Accept(); data = null; while (true) { buffer = new byte [BUFFER_SIZE]; int bytesRec = handler.Receive(buffer); data += Encoding.ASCII.GetString(buffer, 0, bytesRec); if (data.IndexOf("<EOF>", StringComparison.Ordinal) > -1) { break; } } //logger.Info("Text received: " + data.Remove(data.Length - 5)); var message = Message.FromXML(data.Remove(data.Length - 5)); // logger.Info("Message type: " + message.GetType ()); // logger.Info("Message ID: " + message.MessageId); // logger.Info("Message {0} received ({1})", message.MessageId, message.GetType ()); var ack = new MessageAck(message.MessageId); var ack_str = Message.GetXML(ack) + "<EOF>"; byte[] msg = Encoding.ASCII.GetBytes(ack_str); handler.Send(msg); processor.AddToProcessingQueue(message); handler.Shutdown(SocketShutdown.Both); handler.Close(); } } catch (Exception e) { logger.Error(e.ToString()); } }
private void AckMessage(JObject message) { string MessageId = message["msg_id"].Value <string>(); int DeliveryId = message["delivery_id"].Value <int>(); var ack = new MessageAck() { DeliveryId = DeliveryId, MsgId = MessageId }; sockets.SendMessage(JsonConvert.SerializeObject(ack)); }
protected virtual void WriteMessageAck(MessageAck command, StompFrameStream ss) { ss.WriteCommand(command, "ACK", true); // TODO handle bulk ACKs? ss.WriteHeader("message-id", StompHelper.ToStomp(command.LastMessageId)); if (command.TransactionId != null) { ss.WriteHeader("transaction", StompHelper.ToStomp(command.TransactionId)); } ss.Flush(); }
// // Write a object instance to data output stream // public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { MessageAck info = (MessageAck)o; base.LooseMarshal(wireFormat, o, dataOut); LooseMarshalCachedObject(wireFormat, (DataStructure)info.Destination, dataOut); LooseMarshalCachedObject(wireFormat, (DataStructure)info.TransactionId, dataOut); LooseMarshalCachedObject(wireFormat, (DataStructure)info.ConsumerId, dataOut); dataOut.Write(info.AckType); LooseMarshalNestedObject(wireFormat, (DataStructure)info.FirstMessageId, dataOut); LooseMarshalNestedObject(wireFormat, (DataStructure)info.LastMessageId, dataOut); dataOut.Write(info.MessageCount); }
static void OnSendMsgCompletedCallback(string result, IntPtr ptr) { if (SendSysMsgHandler != null) { MessageArcEventArgs args = null; if (!string.IsNullOrEmpty(result)) { var msg = MessageAck.Deserialize(result); args = new MessageArcEventArgs(msg); } SendSysMsgHandler(null, args); } }
/// <summary> /// Handles the ACK of the given message. /// </summary> /// <param name="dispatch">The message.</param> /// <param name="expired">A value indicating whether the message was expired or not.</param> private void AfterMessageIsConsumed(MessageDispatch dispatch, Boolean expired) { if (_unconsumedMessages.Stopped) { return; } // Message was expired if (expired) { lock (_dispatchedMessages) _dispatchedMessages.Remove(dispatch); return; } // Do noting if (_session.IsClientAcknowledge || _session.IsIndividualAcknowledge || _session.IsTransacted) { return; } if (!_session.IsAutoAcknowledge) { throw new StompException("Invalid session state."); } if (!_deliveringAcks.CompareAndSet(false, true)) { return; } lock (_dispatchedMessages) if (_dispatchedMessages.Count > 0) { var ack = new MessageAck { AckType = (Byte)AckType.ConsumedAck, ConsumerId = ConsumerInfo.ConsumerId, Destination = dispatch.Destination, LastMessageId = dispatch.Message.MessageId, MessageCount = 1 }; _session.SendAck(ack); } _deliveringAcks.Value = false; _dispatchedMessages.Clear(); throw new StompException("Invalid session state."); }
// // Un-marshal an object instance from the data input stream // public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) { base.TightUnmarshal(wireFormat, o, dataIn, bs); MessageAck info = (MessageAck)o; info.Destination = (ActiveMQDestination)TightUnmarshalCachedObject(wireFormat, dataIn, bs); info.TransactionId = (TransactionId)TightUnmarshalCachedObject(wireFormat, dataIn, bs); info.ConsumerId = (ConsumerId)TightUnmarshalCachedObject(wireFormat, dataIn, bs); info.AckType = dataIn.ReadByte(); info.FirstMessageId = (MessageId)TightUnmarshalNestedObject(wireFormat, dataIn, bs); info.LastMessageId = (MessageId)TightUnmarshalNestedObject(wireFormat, dataIn, bs); info.MessageCount = dataIn.ReadInt32(); }
// // Write the booleans that this object uses to a BooleanStream // public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { MessageAck info = (MessageAck)o; int rc = base.TightMarshal1(wireFormat, o, bs); rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.Destination, bs); rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.TransactionId, bs); rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.ConsumerId, bs); rc += TightMarshalNestedObject1(wireFormat, (DataStructure)info.FirstMessageId, bs); rc += TightMarshalNestedObject1(wireFormat, (DataStructure)info.LastMessageId, bs); return(rc + 5); }
// // Write a object instance to data output stream // public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { base.TightMarshal2(wireFormat, o, dataOut, bs); MessageAck info = (MessageAck)o; TightMarshalCachedObject2(wireFormat, (DataStructure)info.Destination, dataOut, bs); TightMarshalCachedObject2(wireFormat, (DataStructure)info.TransactionId, dataOut, bs); TightMarshalCachedObject2(wireFormat, (DataStructure)info.ConsumerId, dataOut, bs); dataOut.Write(info.AckType); TightMarshalNestedObject2(wireFormat, (DataStructure)info.FirstMessageId, dataOut, bs); TightMarshalNestedObject2(wireFormat, (DataStructure)info.LastMessageId, dataOut, bs); dataOut.Write(info.MessageCount); }
protected override void MessageAck(MessageAck message) { try { if (message != null) { HandlerAck?.Invoke(message); } } catch (Exception ex) { Console.WriteLine(ex); } }
protected void DoClientAcknowledge(ActiveMQMessage message) { MessageAck ack = CreateMessageAck(message); Tracer.Debug("Sending Ack: " + ack); lock (closedLock) { if (closed) { throw new ConnectionClosedException(); } session.Connection.OneWay(ack); } }
// // Un-marshal an object instance from the data input stream // public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) { base.LooseUnmarshal(wireFormat, o, dataIn); MessageAck info = (MessageAck)o; info.Destination = (ActiveMQDestination)LooseUnmarshalCachedObject(wireFormat, dataIn); info.TransactionId = (TransactionId)LooseUnmarshalCachedObject(wireFormat, dataIn); info.ConsumerId = (ConsumerId)LooseUnmarshalCachedObject(wireFormat, dataIn); info.AckType = dataIn.ReadByte(); info.FirstMessageId = (MessageId)LooseUnmarshalNestedObject(wireFormat, dataIn); info.LastMessageId = (MessageId)LooseUnmarshalNestedObject(wireFormat, dataIn); info.MessageCount = dataIn.ReadInt32(); info.PoisonCause = LooseUnmarshalBrokerError(wireFormat, dataIn); }
/// <summary> /// Method Dispatch /// </summary> /// <param name="message">An ActiveMQMessage</param> public void Dispatch(ActiveMQMessage message) { lock (this) { if (ackSession != null) { message.Acknowledger += new AcknowledgeHandler(DoNothingAcknowledge); MessageAck ack = CreateMessageAck(message); Tracer.Debug("Sending AutoAck: " + ack); ackSession.Connection.OneWay(ack); } } dispatcher.Enqueue(message); }
public void DeliverAcks() { MessageAck ack = null; if (this.deliveringAcks.CompareAndSet(false, true)) { if (this.IsAutoAcknowledgeEach) { lock (this.dispatchedMessages) { ack = MakeAckForAllDeliveredMessages(AckType.DeliveredAck); if (ack != null) { Tracer.Debug("Consumer - DeliverAcks clearing the Dispatch list"); this.dispatchedMessages.Clear(); } else { ack = this.pendingAck; this.pendingAck = null; } } } else if (pendingAck != null && pendingAck.AckType == (byte)AckType.ConsumedAck) { ack = pendingAck; pendingAck = null; } if (ack != null) { MessageAck ackToSend = ack; try { this.session.SendAck(ackToSend); } catch (Exception e) { Tracer.DebugFormat("{0} : Failed to send ack, {1}", this.info.ConsumerId, e); } } else { this.deliveringAcks.Value = false; } } }
internal void SendAck(MessageAck ack, bool lazy) { if (Tracer.IsDebugEnabled) { Tracer.Debug("Session sending Ack: " + ack); } if (lazy || connection.SendAcksAsync || this.IsTransacted) { this.connection.Oneway(ack); } else { this.connection.SyncRequest(ack); } }
internal async Task SendAckAsync(MessageAck ack, bool lazy) { if (Tracer.IsDebugEnabled) { Tracer.Debug("Session sending Ack: " + ack); } if (lazy || connection.SendAcksAsync || this.IsTransacted) { this.connection.Oneway(ack); } else { await this.connection.SyncRequestAsync(ack).Await(); } }
private void AckLater(MessageDispatch dispatch) { // Don't acknowledge now, but we may need to let the broker know the // consumer got the message to expand the pre-fetch window if (_session.IsTransacted) { _session.DoStartTransaction(); if (!_synchronizationRegistered) { _synchronizationRegistered = true; _session.TransactionContext.AddSynchronization(new MessageConsumerSynchronization(this)); } } _deliveredCounter++; var oldPendingAck = _pendingAck; _pendingAck = new MessageAck { AckType = (Byte)AckType.ConsumedAck, ConsumerId = ConsumerInfo.ConsumerId, Destination = dispatch.Destination, LastMessageId = dispatch.Message.MessageId, MessageCount = _deliveredCounter }; if (_session.IsTransacted && _session.TransactionContext.InTransaction) { _pendingAck.TransactionId = _session.TransactionContext.TransactionId; } if (oldPendingAck == null) { _pendingAck.FirstMessageId = _pendingAck.LastMessageId; } if (!(0.5 * ConsumerInfo.PrefetchSize <= _deliveredCounter - _additionalWindowSize)) { return; } _session.SendAck(_pendingAck); _pendingAck = null; _deliveredCounter = 0; _additionalWindowSize = 0; }
private void ExchangeClientVoucherAck(MessageAck messageACK) { try { _thTicketExpireAckResponse.AddThreadData(new TITOThreadDataResponse() { MessageID = messageACK.MessageID, Ack = messageACK.ACK, }); LogManager.WriteLog("ExchangeClientVoucherAck | MessageID: " + messageACK.MessageID.ToString() + ", ACK Status: " + messageACK.ACK.ToString(), LogManager.enumLogLevel.Info); } catch (Exception ex) { LogManager.WriteLog("ExchangeClientVoucherAck | Exception Occured." + ex.Message, LogManager.enumLogLevel.Info); ExceptionManager.Publish(ex); } }
private void ExchangeClientAck(MessageAck messageACK) { try { _thAckResponse.AddThreadData(new EnableDisableThreadDataResponse() { MessageID = messageACK.MessageID, Ack = messageACK.ACK, }); LogManager.WriteLog("ExchangeClientAck | MessageID: " + messageACK.MessageID.ToString() + ", ACK Status: " + messageACK.ACK.ToString() , LogManager.enumLogLevel.Info); } catch (Exception ex) { LogManager.WriteLog("ExchangeClientAck | Exception Occurred", LogManager.enumLogLevel.Info); ExceptionManager.Publish(ex); } }
private void ExchangeClientAck(MessageAck messageACK) { try { _thAckResponse.AddThreadData(new EnableDisableThreadDataResponse() { MessageID = messageACK.MessageID, Ack = messageACK.ACK, }); LogManager.WriteLog("ExchangeClientAck | MessageID: " + messageACK.MessageID.ToString() + ", ACK Status: " + messageACK.ACK.ToString() , LogManager.enumLogLevel.Info); } catch (Exception ex) { LogManager.WriteLog("ExchangeClientAck | Exception Occurred", LogManager.enumLogLevel.Info); ExceptionManager.Publish(ex); } }
private void AckLater(MessageDispatch dispatch) { // Don't acknowledge now, but we may need to let the broker know the // consumer got the message to expand the pre-fetch window if (this.session.IsTransacted) { this.session.DoStartTransaction(); if (!synchronizationRegistered) { this.synchronizationRegistered = true; this.session.TransactionContext.AddSynchronization(new MessageConsumerSynchronization(this)); } } this.deliveredCounter++; MessageAck oldPendingAck = pendingAck; pendingAck = new MessageAck(); pendingAck.AckType = (byte)AckType.ConsumedAck; pendingAck.ConsumerId = this.info.ConsumerId; pendingAck.Destination = dispatch.Destination; pendingAck.LastMessageId = dispatch.Message.MessageId; pendingAck.MessageCount = deliveredCounter; if (this.session.IsTransacted && this.session.TransactionContext.InTransaction) { pendingAck.TransactionId = this.session.TransactionContext.TransactionId; } if (oldPendingAck == null) { pendingAck.FirstMessageId = pendingAck.LastMessageId; } if ((0.5 * this.info.PrefetchSize) <= (this.deliveredCounter - this.additionalWindowSize)) { this.session.SendAck(pendingAck); this.pendingAck = null; this.deliveredCounter = 0; this.additionalWindowSize = 0; } }
private void SendMessageAck(int messageId) { var builder = new FlatBuffers.FlatBufferBuilder(1024); MessageAck.StartMessageAck(builder); MessageAck.AddMessageId(builder, messageId); var ack = MessageAck.EndMessageAck(builder); Message.StartMessage(builder); Message.AddDataType(builder, MessageType.MessageAck); Message.AddData(builder, ack.Value); var message = NetworkedPhysics.Message.EndMessage(builder); builder.Finish(message.Value); byte[] bytes = builder.SizedByteArray(); _udpClient.Send(bytes, bytes.Length); //Debug.Log("Sent MessageAck message " + messageId + " " + bytes.Length); }
protected virtual void WriteMessageAck(MessageAck command, BinaryWriter dataOut) { var frame = new StompFrame("ACK", _encodeHeaders); if (command.ResponseRequired) { frame.SetProperty(PropertyKeys.Receipt, "ignore:" + command.CommandId); } frame.SetProperty(PropertyKeys.MessageId, command.LastMessageId.ToString()); frame.SetProperty(PropertyKeys.Subscription, command.ConsumerId.ToString()); if (command.TransactionId != null) { frame.SetProperty(PropertyKeys.Transaction, command.TransactionId.ToString()); } frame.ToStream(dataOut); }
protected virtual MessageAck CreateMessageAck(Message message) { MessageAck ack = new MessageAck(); ack.AckType = (int)AckType.ConsumedAck; ack.ConsumerId = info.ConsumerId; ack.Destination = message.Destination; ack.FirstMessageId = message.MessageId; ack.LastMessageId = message.MessageId; ack.MessageCount = 1; if (session.Transacted) { session.DoStartTransaction(); ack.TransactionId = session.TransactionContext.TransactionId; session.TransactionContext.AddSynchronization(new MessageConsumerSynchronization(this, message)); } return(ack); }
protected virtual void WriteMessageAck(MessageAck command, BinaryWriter dataOut) { StompFrame frame = new StompFrame("ACK"); if (command.ResponseRequired) { frame.SetProperty("receipt", "ignore:" + command.CommandId); } frame.SetProperty("message-id", StompHelper.ToStomp(command.LastMessageId)); Tracer.Debug("ACK - Outbound MessageId = " + frame.GetProperty("message-id")); if (command.TransactionId != null) { frame.SetProperty("transaction", StompHelper.ToStomp(command.TransactionId)); } frame.ToStream(dataOut); }
protected override void MessageAck(MessageAck message) { try { if (message != null) { HandlerAck?.Invoke(message); //if (result.HasValue && result.Value) //{ // using (var c = new ConfirmMessage(this.keyAccess, this.privateKey)) // { // c.Ok(message.ID, message.To); // } //} } } catch (Exception ex) { Console.WriteLine(ex); } }
/// <summary> /// Method Dispatch /// </summary> /// <param name="message">An ActiveMQMessage</param> public void Dispatch(ActiveMQMessage message) { if (AcknowledgementMode.AutoAcknowledge == this.acknowledgementMode) { MessageAck ack = CreateMessageAck(message); Tracer.Debug("Sending AutoAck: " + ack); message.Acknowledger += new AcknowledgeHandler(DoNothingAcknowledge); lock (closedLock) { if (closed) { throw new ConnectionClosedException(); } ackSession.Connection.OneWay(ack); } } dispatcher.Enqueue(message); }
public override Response processMessageAck(MessageAck ack) { if (TrackTransactions && ack != null && ack.TransactionId != null) { ConnectionId connectionId = ack.ConsumerId.ParentId.ParentId; if (connectionId != null) { ConnectionState cs = connectionStates[connectionId]; if (cs != null) { TransactionState transactionState = cs[ack.TransactionId]; if (transactionState != null) { transactionState.addCommand(ack); } } } return(TRACKED_RESPONSE_MARKER); } return(null); }
public void AfterRollback(ActiveMQMessage message) { // lets redeliver the message again message.RedeliveryCounter += 1; if (message.RedeliveryCounter > MaximumRedeliveryCount) { // lets send back a poisoned pill MessageAck ack = new MessageAck(); ack.AckType = (int)AckType.PoisonAck; ack.ConsumerId = info.ConsumerId; ack.Destination = message.Destination; ack.FirstMessageId = message.MessageId; ack.LastMessageId = message.MessageId; ack.MessageCount = 1; session.Connection.OneWay(ack); } else { dispatcher.Redeliver(message); } }
void _exchangeClient_MacEnable_DATA_ACK(MessageAck messageACK) { _thAckResponse.AddThreadData(new EnableMachineThreadDataResponse() { MessageID = messageACK.MessageID, Ack = messageACK.ACK, }); LogManager.WriteLog("ExchangeClientAck(Machine Enable event) | MessageID: " + messageACK.MessageID.ToString() + ", ACK Status: " + messageACK.ACK.ToString() , LogManager.enumLogLevel.Info); }
void ExchangeClientAck(MessageAck messageAck) { try { LogManager.WriteLog("MessageID " + messageAck.MessageID + " MessageAckResult = " + messageAck.ACK, LogManager.enumLogLevel.Info); lock (HoldingObject) { var memoryList = MessageStore.Where(message => message.messageId == messageAck.MessageID); LogManager.WriteLog("Memory List" + MessageStore.Count, LogManager.enumLogLevel.Info); //below is for AFT var aftMemoryList = AFTMessages.Where(aftmessage => aftmessage.MessageID == messageAck.MessageID); LogManager.WriteLog("AFT Memory List" + AFTMessages.Count, LogManager.enumLogLevel.Info); if (memoryList != null) { foreach (var store in memoryList) { if (store != null) { LogManager.WriteLog("store.GamePosition = " + store.GamePosition.ToString(), LogManager.enumLogLevel.Info); if (Int32.Parse(store.GamePosition) == 0) { if (messageAck.ACK) { if (store.Reason == NetworkService.MessageStore.ReasonType.AAMS) { //if (store.ExportHistoryID != 0) //{ // var _proxy = GetWebService(); // _proxy.UpdateBarPositionCentralStatusBySiteID(store.ExportHistoryID); //} DBBuilder.UpdateAAMSStatus(store.badId, store.datapakCurrentState.ToString(), "", store.entityType, store.installationNo, store.updateDate); LogManager.WriteLog( "Message ID: " + messageAck.MessageID + " --- ACK Status was True", LogManager.enumLogLevel.Info); } else { LogManager.WriteLog( "This enable/disable was called due to enterprise connectivity.", LogManager.enumLogLevel.Info); dBarPositions = new Dictionary<string, string> { {"BarPosName", store.barpositionName}, {"isMachine", "true"} }; LogManager.WriteLog( "datapack number and Message ID : " + store.installationNo + " " + store.messageId, LogManager.enumLogLevel.Info); LogManager.WriteLog("Current machine Status " + store.datapakCurrentState, LogManager.enumLogLevel.Info); if (store.datapakCurrentState == 1) dBarPositions.Add("Status", "1"); else dBarPositions.Add("Status", "0"); LogManager.WriteLog("Enabled Machine " + dBarPositions["isMachine"], LogManager.enumLogLevel.Info); LogManager.WriteLog("Enabled Position " + dBarPositions["BarPosName"], LogManager.enumLogLevel.Info); LogManager.WriteLog("Set Status " + dBarPositions["Status"], LogManager.enumLogLevel.Info); var bUpdatedResult = DBBuilder.UpdateBarPosition(dBarPositions); if (bUpdatedResult) { LogManager.WriteLog("Updated Bar Position status", LogManager.enumLogLevel.Info); lFaults = new List<string> { store.installationNo.ToString(), "300" }; if (store.datapakCurrentState == 1) lFaults.Add("Machine Auto Enabled"); else lFaults.Add("Machine Auto Disabled"); lFaults.Add("true"); if (store.datapakCurrentState == 1) lFaults.Add("101"); else lFaults.Add("100"); dFaultEvents = GetFaults(lFaults); DBBuilder.CreateFaultEvents(dFaultEvents); if (store.datapakCurrentState == 1) LogManager.WriteLog("Machine Auto Enabled - fault event created", LogManager.enumLogLevel.Info); else LogManager.WriteLog("Machine Auto Disabled - fault event created", LogManager.enumLogLevel.Info); } } } else LogManager.WriteLog( "Message ID: " + messageAck.MessageID + " --- ACK Status was Failure", LogManager.enumLogLevel.Info); } else { LogManager.WriteLog(" Before Updating Store Nack or ack. store ", LogManager.enumLogLevel.Info); store.GameACKorNACK = messageAck.ACK; LogManager.WriteLog( " Update GameAcK or Nack to Message ID: " + messageAck.MessageID + "Game Position = " + store.GamePosition + " Installation No=" + store.installationNo, LogManager.enumLogLevel.Info); } } else { LogManager.WriteLog("Store value is null", LogManager.enumLogLevel.Info); } } } if (aftMemoryList != null) { LogManager.WriteLog("Inside aftmemory list check", LogManager.enumLogLevel.Info); foreach (var store in aftMemoryList) { LogManager.WriteLog("Ack status " + messageAck.ACK, LogManager.enumLogLevel.Info); if (messageAck.ACK) { DBBuilder.UpdateAFTPolling(store.Installation_No); LogManager.WriteLog("AFT enabled/disabled for the installation no :- " + store.Installation_No.ToString(), LogManager.enumLogLevel.Info); } else LogManager.WriteLog("Message ID: " + messageAck.MessageID + " --- ACK Status was Failure for AFT Enable/Disable", LogManager.enumLogLevel.Info); } } else { LogManager.WriteLog(" MessageId " + messageAck.MessageID + "Could not be found", LogManager.enumLogLevel.Info); } LogManager.WriteLog("Removing Messages. MessageAck = " + messageAck.MessageID, LogManager.enumLogLevel.Info); MessageStore.RemoveAll(x => x.messageId == messageAck.MessageID); AFTMessages.RemoveAll(x => x.MessageID == messageAck.MessageID); LogManager.WriteLog("Removed Sucessfully. MessageAck = " + messageAck.MessageID, LogManager.enumLogLevel.Info); } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void ExchangeClientVoucherAck(MessageAck messageACK) { try { _thTicketExpireAckResponse.AddThreadData(new TITOThreadDataResponse() { MessageID = messageACK.MessageID, Ack = messageACK.ACK, }); LogManager.WriteLog("ExchangeClientVoucherAck | MessageID: " + messageACK.MessageID.ToString() + ", ACK Status: " + messageACK.ACK.ToString(), LogManager.enumLogLevel.Info); } catch (Exception ex) { LogManager.WriteLog("ExchangeClientVoucherAck | Exception Occured." + ex.Message, LogManager.enumLogLevel.Info); ExceptionManager.Publish(ex); } }
void ExchangeClientAck(MessageAck messageAck) { lock (HoldingObject) { _ackMessage = messageAck.ACK; Thread.MemoryBarrier(); Monitor.Pulse(HoldingObject); } }