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 8940495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:02:51+00:00 2026-06-15T11:02:51+00:00

I am trying to connect to rabbitmq-c in centos 5.6 and test its function

  • 0

I am trying to connect to rabbitmq-c in centos 5.6 and test its function in c client following the steps of the website: http://www.rabbitmq.com/tutorials/tutorial-one-java.html.
However, it fails when I use the default exchange.

For example, I want to send a message, “Hello world”, to a queue named “myqueue” via the default exchange whose name is “(AMQP default)”.

In java, here is the code:

channel.basicPublish("", QUEUE_NAME, null, message.getBytes());

But in c, when I run rmq_new_task.c (almost the same as amqp_sendstring.c) as the examples on https://github.com/liuhaobupt/rabbitmq_work_queues_demo-with-rabbit-c-client-lib.

queuename="myqueue";
......
die_on_error(amqp_basic_publish(conn, amqp_cstring_bytes(exchange),
    amqp_cstring_bytes(routingkey), &props, amqp_cstring_bytes("Hello world")),
    "Publishing");

In the java client, we just set the parameter “exchange” to “” to tell the server that we’d send the message to a specified queue named the same as routingkey via the default exchange.

So what value should I give the second parameter “exchange” in c client (using the default exchange)? I tried to set it to “” or “amq.direct”. It didnot show any error while running and seemed working well.

However, when I checked in the rabbitmq-management(http://localhost:55672/#/queues), the queue named “myqueue” did not exist!

Would someone please point me to the right direction? I’d really appreciate!

  • 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-15T11:02:52+00:00Added an answer on June 15, 2026 at 11:02 am

    Take a look at http://www.rabbitmq.com/tutorials/amqp-concepts.html and specifically look for the section entitled Default Exchange.

    The usage of the default exchange is very simple.

    In java you would do:

    channel.basicPublish("", "hello", null, message.getBytes());
    

    By specifying "" in says to use the default exchange. (There should be no need to use amq.direct)

    As per the article above it states:

    The default exchange is a direct exchange with no name (empty string)
    pre-declared by the broker. It has one special property that makes it
    very useful for simple applications: every queue that is created is
    automatically bound to it with a routing key which is the same as the
    queue name
    .

    So that means publishing to the default exchange will only work if you have already created the queue that you want to publish to.

    So you will need to create your queue before you can publish to the default exchange. Once you’ve done that you will start seeing your messages.

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

Sidebar

Related Questions

Im trying to connect to www.google.com using socket but the result is: HTTP/1.0 302
When trying to connect to a web service using the following $client = new
Trying to connect to sql server 2005 with delphi 2010 gives me the following
When trying to connect to EC2 over SSH I get the following error: joshua-scotts-macbook-pro:.ec2
Trying to connect to a SQL Server 2005 instance remotely but getting the following
I am trying to connect to twitter via TwitterVB and the following code does
I am trying to connect a client (which is behind the company's proxy) to
I am trying connect the asp.net membership tables in to an asp.mvc 3 website.
I have an application that is trying to connect to a rabbitmq-server, but I
Im trying to connect to a POP3 server via imap_open imap_open('{mail.domain.com:995/pop3/tls}INBOX', 'user@domain.com', 'password'); But

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.