Example #1
0
        public void startResponse(object objMessage, OfacStatus ofacStatus)
        {
            try
            {
                OfacResponse response = (OfacResponse)objMessage;

                _manager.processResponse(response.requestId, _interfaceId, response.name, response.message, ofacStatus);
                updateStatistics();
                lock (syncLock)
                {
                    currentMessagesToBeProcessed--;
                }
            }
            catch (Exception e)
            {
                LogUtil.log("startReponse", e);
            }
        }
Example #2
0
        private void handleResponseMessage(MQMessage message, OfacStatus status)
        {
            try
            {
                String requestId   = System.Text.ASCIIEncoding.ASCII.GetString(message.CorrelationId);
                String name        = System.Text.ASCIIEncoding.ASCII.GetString(message.MessageId);
                String messageText = message.ReadString(message.DataLength);


                OfacResponse response = new OfacResponse();
                response.message   = messageText;
                response.requestId = Convert.ToInt32(requestId);
                response.name      = name;


                _dbUtils.addOfacResponse(response.requestId, name, messageText, status);

                lock (syncLock)
                {
                    currentMessagesToBeProcessed++;
                }

                //queue the work with the thread pool
                if (status == OfacStatus.Confirm)
                {
                    ThreadPool.QueueUserWorkItem(new WaitCallback(startConfirmResponse), response);
                }
                else
                {
                    ThreadPool.QueueUserWorkItem(new WaitCallback(startOkResponse), response);
                }
            }
            catch (MQException e)
            {
                LogUtil.log("Error while adding response after watchlist filtering check:", e);
            }
        }