Exemplo n.º 1
0
 /// <summary>
 /// Initializes the specified server context.
 /// </summary>
 /// <param name="serverContext">The server context.</param>
 public void Initialize(IServerContext serverContext)
 {
     try
     {
         //   _azureQueueHelper.CreateTopic(_configuration.Name);  // This is the topic Name
         // _azureQueueHelper.RegisterSubscriber("DefaultSubscriber");  // Register DefaultSubscriber - it is required by Azure
     }
     catch (System.Exception ex)
     {
         _logger.LogError(ex.Message, ex);
         throw;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the specified server context.
        /// </summary>
        /// <param name="serverContext">The server context.</param>
        public void Initialize(IServerContext serverContext)
        {
            try
            {
                _connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings[_configuration.connectionString.Name].ToString();

                _connection.Open();
                _sqlQueueHelper.CreateMessageType(_configuration.messageType.Name, _connection);
                _sqlQueueHelper.CreateContract(_configuration.contract.Name, _configuration.messageType.Name, _connection);
                _sqlQueueHelper.CreateQueue(_configuration.queue.Name, _connection);
                _sqlQueueHelper.CreateService(_configuration.serviceTo.Name, _configuration.queue.Name, _configuration.contract.Name, _connection);
                _sqlQueueHelper.CreateService(_configuration.serviceFrom.Name, _configuration.queue.Name, _configuration.contract.Name, _connection);
            }
            catch (System.Exception ex)
            {
                _logger.LogError(ex.Message, ex);
                throw;
            }
        }