Ejemplo n.º 1
0
        /// <summary>
        /// Returns a configured connection.
        /// </summary>
        /// <param name="brokerName">The name of the connection to search.</param>
        /// <returns>The found connection configuration or an exception.</returns>
        public BrokerConnectionSettings GetConnection(string brokerName)
        {
            Check.NotNull(brokerName, nameof(brokerName));

            BrokerConnectionSettings conn = Connections.FirstOrDefault(c => c.BrokerName == brokerName);

            if (conn == null)
            {
                throw new BrokerException($"Connection with broker name: {brokerName} not configured.");
            }
            return(conn);
        }
Ejemplo n.º 2
0
        private IEnumerable <QueuePropertiesSettings> GetBrokerQueueProperties(string brokerName)
        {
            BrokerConnectionSettings brokerConn = Connections.FirstOrDefault(c => c.BrokerName == brokerName);

            return(brokerConn?.QueueProperties ?? new QueuePropertiesSettings[] { });
        }