Пример #1
0
        public override async Task <bool> ProcessRunAsync(SQSAttribute message, string messageKey, TraceContext traceContext)
        {
            string methodName = MethodInfo.GetCurrentMethod().ReflectedType.FullName + "." + MethodInfo.GetCurrentMethod().Name;

            try
            {
                _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Begin of Transcode Service in Worker for Executionstep: ", message.ExecutionStepID));

                TransocdeService transcode = new TransocdeService();
                switch (message.ProcessType)
                {
                case "Launch":
                    _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transcode Service as Launcher for Executionstep: ", message.ExecutionStepID));
                    await transcode.ValidateAndExecute(message.ExecutionStepID);

                    break;

                case "GetStatus":
                    _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transcode Service as GetStatus for Executionstep: ", message.ExecutionStepID));
                    await transcode.GetStatus(message.ExecutionStepID);

                    break;

                case "ReceiveStatus":
                    _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transcode Service as ReceiveStatus for Executionstep: ", message.ExecutionStepID));
                    //await transcode.ReceiveStatus(JsonConvert.DeserializeObject<ExternalStatus>(message.message));
                    break;

                case "PostStatus":
                    _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transcode Service as PostStatus for Executionstep: ", message.ExecutionStepID));
                    await transcode.PostStatus(message.ExecutionStepID);

                    break;

                case "ExceptionStatus":
                    _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transcode Service as GetStatus for Executionstep: ", message.ExecutionStepID));
                    await transcode.ProcessException(message.ExecutionStepID);

                    break;

                default:
                    break;
                }

                _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Begin of Transcode Service in Worker for Executionstep: ", message.ExecutionStepID));
            }
            catch (Exception ex)
            {
                _traceService.Write(traceContext, TraceLevel.Error, methodName, ex);
            }
            return(true);
        }
Пример #2
0
        public override async Task <bool> ProcessRunAsync(SQSAttribute message, string messageKey, TraceContext traceContext)
        {
            string methodName = MethodInfo.GetCurrentMethod().ReflectedType.FullName + "." + MethodInfo.GetCurrentMethod().Name;

            try
            {
                TransocdeService transcode = new TransocdeService();
                _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transocde Service as GetStatus for Executionstep: ", message.ExecutionStepID));
                await transcode.GetStatus(message.ExecutionStepID);
            }
            catch (Exception ex)
            {
                _traceService.Write(traceContext, TraceLevel.Error, methodName, ex);
            }
            return(true);
        }