Creating Your First Queue

After Getting Started with PubSub+ Cloud and Trying Out Your Event Broker 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.

This tutorial shows you how to do the following tasks:

  1. Create a Queue
  2. Map a Topic to a Queue
  3. Publish a Message to the Queue
  4. Confirm the Message Is in the Queue

Create a Queue

To create a queue, do the following:

  1. Log in to the PubSub+ Cloud Console if you have not done so yet. The URL to access the Cloud Console differs based on your authentication scheme. For more information, see Logging In to the PubSub+ Cloud Console.

  2. In the Cloud Console, click the Cluster Manager card or the icon on the left navigation bar.
  3. On the Services page, in the top-left, select the environment that contains your event broker service.
  4. Click the card for your event broker service. The event broker service details page opens.
  5. On the Service Details page, select the Manage tab.

    The Manage page includes various options to manage your event broker service.

    Screenshot showing the elements described in the surrounding text

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

    Screenshot showing the elements described in the surrounding text

    Broker Manager opens in a separate tab in your browser and displays the Queues tab

  7. Click +Queue.

    Screenshot showing the elements described in the surrounding text

  8. 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.

    Screenshot showing the elements described in the surrounding text

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

    Screenshot showing the elements described in the surrounding text

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

    Screenshot showing the elements described in the surrounding text

Map a Topic to a Queue

While it is possible to publish directly to a queue by its name, it's best to map a topic to a queue for more flexibility. You map a topic to a queue by subscribing to the topic from the queue.

To subscribe to a topic from a queue, perform these steps:

  1. From the queue summary, click anywhere in the row describing the queue to open the Queue Detail pages.

  2. From the queue detail page, select the Subscriptions tab.

    Screenshot showing the elements described in the surrounding text

  3. On the Subscriptions tab, click +Subscription.

    Screenshot showing the elements described in the surrounding text

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

    Screenshot showing the elements described in the surrounding text

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

Publish a Message to the Queue

We will use the Broker Manager Try Me! tool 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. On the Service Details page select the Try Me! tab.

  2. To connect to the event broker service copy the following connection information from the Service Details page into the Broker Manager under Establish Connection:

    1. Copy the value for Client Username and paste it into the Client Username field.
    2. Copy the value for Client Password and paste it into the Client Password field
    3. Screenshot showing the elements described in the surrounding text

      Screenshot showing the elements described in the surrounding text

  3. In the Publisher panel, click Connect.

    Screenshot showing the elements described in the surrounding text

  4. Validate that the publisher is connected.

    Screenshot showing the elements described in the surrounding text

  5. In the Publisher panel, click Publish to publish a message with try-me as the topic name.

    Screenshot showing the elements described in the surrounding text

Confirm the Message Is in the Queue

In Broker Manager, you can confirm that the message is in the queue.

  1. In the Broker Manager, on the Queues page, your queue is listed on the summary page.

    Screenshot showing the elements described in the surrounding text

  2. Verify that the Messages Queued column shows 1 message (or more if you published multiple messages), and that a non-zero value is shown in the Messages Queued Quota (MB) column.

    Screenshot showing the elements described in the surrounding text

    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 select the Messages Queued tab.

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

    Screenshot showing the elements described in the surrounding text

Next Steps

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