Ejemplo n.º 1
0
        /// <summary>
        /// Helper function used to create an instance of the Neuron ESB Audit service so message failures when publishing to the bus can be forwared
        /// to the Neuron Audit database
        /// </summary>
        /// <returns></returns>
        private bool ConnectAuditService()
        {
            bool retVal = false;

            // if auditing is enabled
            if (AuditOnFailurePublish && this._adapterMode.ModeName.Equals(AdapterModeStringConstants.Publish))
            {
                try
                {
                    if (MessageAuditService == null)
                    {
                        MessageAuditService = new MessageAudit();
                        MessageAuditService.Connect(Configuration);
                    }
                    retVal = true;
                }
                catch (Exception ex)
                {
                    RaiseAdapterError(ErrorLevel.Error, "Failed to create Audit Service", ex);
                }
            }

            return(retVal);
        }