Creating a Queue

After Creating Your First Messaging Service and Trying Out Your Messaging Service, you may want to create a queue so you can send and receive some guaranteed messages. This tutorial walks you through creating a queue. You will also make sure the queue is working by connecting a publisher and publishing a matching message to that queue.

Goals

The goal of this tutorial is to demonstrate how to create a queue and confirm that it is working. This tutorial will show you how to:

  • create a queue
  • map a topic to a queue
  • publish a message a queue
  • confirm that the message appears in the queue

Step 1: Create a Queue

To create a queue, do the following:

  1. On the left-hand menu, click Messaging Services.
  2. Click your messaging service to navigate to messaging service details.
  3. On the service details page, click the Manage tab.

    ../img/ggs_queue_mgmt_menu.png

    The Manage page displays, providing access to tools for managing your messaging service.

    ../img/ggs_queue_mgmt_window.png

  4. On the Manage page, click the Queues tile.

    ../img/ggs_queue_mgmt_tile.png

    The Queues page opens in a new browser tab.

  5. Click the +Queue button.

    ../img/ggs_queue_add.png

  6. Enter a name for your queue and click Create. You can use most characters in your queue name, including spaces. Some punctuation marks ('<>*?&;) are not allowed. If you use a slash (/) in the name, it cannot be the first character.

    Queue Name Entry

  7. On the Edit Queue Settings page, click Apply to accept all the default settings.

    ../img/ggs_queue_settings_apply.png

  8. Your new queue is displayed on the summary page. The queue is empty, so you will see zeros (0) in both the Messages Queued columns.

    ../img/ggs_queue_queue_summary.png

Step 2: Map a topic to queue

While it is possible to publish directly to a queue by its name, it is common to map a topic to a queue for more flexibility. In this case, mapping a topic to a queue will allow us to use the Try Me! tab to publish a message to our queue to test it out.

To map a topic to a queue, do the following.

  1. From the queue summary, click anywhere in the row describing the queue to open the queue detail view.

    ../img/ggs_queue_queue_click.png

  2. From the queue detail view, click the Subscriptions tab.

    ../img/ggs_queue_subscriptions.png

  3. On the Subscriptions tab, click the +Subscription button.

    ../img/ggs_queue_add_sub.png

  4. Enter the topic "try-me" as the subscription and click the Create button. This is the default topic of the Try Me! tab.

    ../img/ggs_queue_create_sub.png

  5. The topic "try-me" is now mapped to the queue. Messages published to that topic will go into the queue.

Step 3: Publish a message to the queue

We will use the publisher CodePen project on the Try Me! tab to publish a message into our queue. We are not going to use a subscriber connection.

To publish a message to the queue, follow the steps below.

  1. Return to the main Solace Cloud browser tab and click the Try Me! tab.

    ../img/tryMe_1.png

  2. In the Publisher CodePen, click Connect.

    Publisher Connect Button

  3. Validate that the publisher is connected.

    Validate Publisher Button

  4. In the Publisher CodePen, under step 2, publish a message with try-me as the topic name.

    Publisher Publish Button

Step 4: Confirm the message is in the queue

  1. On the Queues page (in the other browser tab), click Queues in the left-hand menu.

    ../img/ggs_queue_after_sub.png

    Your queue is listed on the summary page.

  2. Verify that the the Messages Queued column shows 1 message, and that a non-zero value is shown in the Messages Queued Quota (MB) column.

    ../img/ggs_queue_one_message.png

    Congratulations! Your queue is working.

  3. To see more details about the message in the queue, click anywhere in the row describing the queue, then click the Messages Queued tab.

    For example, you can see the message ID assigned to the message and the time when it was published.

    ../img/ggs_queue_message_details.png

Step 5: Learn more

Well done. You have now created a queue in your messaging service and published a message to it. Want to learn more?