コード例 #1
0
        /// <summary>
        /// Declare a exchange passively. Throw an exception rather than create the exchange if it doesn't exist
        /// </summary>
        /// <param name="bus">The bus instance</param>
        /// <param name="name">The exchange to declare</param>
        /// <param name="cancellationToken">The cancellation token</param>
        public static void ExchangeDeclarePassive(
            this IAdvancedBus bus,
            string name,
            CancellationToken cancellationToken = default
            )
        {
            Preconditions.CheckNotNull(bus, "bus");

            bus.ExchangeDeclarePassiveAsync(name, cancellationToken)
            .GetAwaiter()
            .GetResult();
        }