Пример #1
0
        private MailboxConnection SetupEnvironment()
        {
            try
            {
                var connection = _mailboxChannel.Connect();

                if (DeadLettering)
                {
                    _deadLettering.DeadLetterSetup(connection.Channel);
                }

                _mailboxQueue.QueueDeclare(connection.Channel);

                if (!DefaultExchange)
                {
                    _mailboxQueue.QueueBind(connection.Channel);
                }

                return(connection);
            }
            catch (Exception ex)
            {
                throw new MailboxSetupException(ex);
            }
        }
Пример #2
0
        private Utility SetupEnvironment()
        {
            try
            {
                _mailboxChannel.Connect(out var channel, out var compositeDisposable);

                if (DeadLettering)
                {
                    _deadLettering.DeadLetterSetup(channel);
                }

                _mailboxQueue.QueueDeclare(channel);

                if (!DefaultExchange)
                {
                    _mailboxQueue.QueueBind(channel);
                }

                return(new Utility
                {
                    Channel = channel,
                    CompositeDisposable = compositeDisposable
                });
            }
            catch (Exception ex)
            {
                throw new MailboxSetupException(ex);
            }
        }