Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7760195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:49:06+00:00 2026-06-01T13:49:06+00:00

I am executing below code successfully without any errors but when I am executing

  • 0

I am executing below code successfully without any errors but when I am executing list_queue command it gives me no queue. Dont know where the problem is.

The below code is not giving error at all. My machine is windows 7 64x, installed AMPQ runtime 64bit and using 32x RabbitMq server v.2.8.1 .

private void createExchange(string message)
        {
            var queName = Convert.ToString(ConfigurationManager.AppSettings["clientQueue"]);
            var exchangeName = Convert.ToString(ConfigurationManager.AppSettings["clientExchange"]);
            var hostName = Convert.ToString(ConfigurationManager.AppSettings["host"]);

            _logger.Info("entered in create exchange");
            _logger.Info("queName: " + queName);
            _logger.Info("exchangeName: " + exchangeName);
            _logger.Info("hostName: " + hostName);
            try
            {
                var connectionFactory = new ConnectionFactory();
                connectionFactory.HostName = "localhost";
                connectionFactory.UserName = "user1";
                connectionFactory.Password = "userpassword";

                using (IConnection connection =
                    connectionFactory.CreateConnection())
                {
                    _logger.Info("Conncection created");
                    using (IModel model = connection.CreateModel())
                    {
                        _logger.Info("Model is created");
                        model.ExchangeDeclare(exchangeName, ExchangeType.Fanout, true);
                        model.QueueDeclare(queName, true, true, false, null);
                        model.QueueBind(queName, exchangeName, "", new Dictionary<string, object>());

                        IBasicProperties basicProperties = model.CreateBasicProperties();
                        model.BasicPublish(exchangeName, "", false, false,
                                           basicProperties, Encoding.UTF8.GetBytes(message));
                        _logger.Info("message: " + message);
                        _logger.Info("message published");

                    }
                }
            }
            catch(Exception ex)
            {
                _logger.Info("Error in create exchange");
                _logger.Info("InnerException:" + ex.InnerException);
                _logger.Info("Message:" + ex.Message);
                _logger.Info("StackTrace:" + ex.StackTrace);
            }
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:49:07+00:00Added an answer on June 1, 2026 at 1:49 pm

    It appears as though you are declaring an ‘exclusive’ queue. Exclusive queues are exclusive to the connection and as such cannot be operated upon (including being listed) from another connection.

    Try

    Model.QueueDeclare(queName, true, **false**, false, null)
    

    If you want to be able to list it or do anything else with if from another connection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the code below to notify if there are any problem executing
Executing the below code gives me the following exception on the last line: InvalidOperationException:
Below is the command I tried executing, without success: exec('ln -s ' . PLUGIN_DIR
In the below code if any exception is thrown while executing the the SQL
This code below is for executing ls -l | wc -l. In the code,
the error i get while executing the code below in OleDb Try con.Open() Dim
I have an R code block that generates an image (see below). Executing the
While executing the code below I am getting HTTP 500 Internal Server Error. public
I am executing below C# code - for (; ; ) { Console.WriteLine(Doc# {0},
Please check this below code. After for loop remaining code is not executing. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.