예제 #1
0
        protected override void ProcessMessageImpl(IMessageHeader header, ExtractedFileVerificationMessage message, ulong tag)
        {
            try
            {
                // Check the report contents are valid, but don't do anything else with it for now
                JsonConvert.DeserializeObject <IEnumerable <Failure> >(message.Report);
            }
            catch (JsonException e)
            {
                ErrorAndNack(header, tag, "Could not deserialize message report to Failure object", e);
                return;
            }

            try
            {
                _store.PersistMessageToStore(message, header);
            }
            catch (ApplicationException e)
            {
                // Catch specific exceptions we are aware of, any uncaught will bubble up to the wrapper in ProcessMessage
                ErrorAndNack(header, tag, "Error while processing ExtractedFileVerificationMessage", e);
                return;
            }

            // TODO(rkm 2020-07-23) Forgetting the "return" in either case above could mean that the message gets ackd - can we rearrange the logic to avoid this?
            Ack(header, tag);
        }
예제 #2
0
        protected override void ProcessMessageImpl(IMessageHeader header, ExtractionRequestInfoMessage message, ulong tag)
        {
            try
            {
                _store.PersistMessageToStore(message, header);
            }
            catch (ApplicationException e)
            {
                // Catch specific exceptions we are aware of, any uncaught will bubble up to the wrapper in ProcessMessage
                ErrorAndNack(header, tag, "Error while processing ExtractionRequestInfoMessage", e);
                return;
            }

            Ack(header, tag);
        }