Trying Out Your Event Broker Service

If you haven't already done so, start by Creating Your First Event Broker Service. Assuming that you have now created an event broker service, this getting started tutorial walks you through trying your new event broker service. You will connect a publisher and a subscriber, subscribe to a topic, and publish a matching message to try out the event broker service service.

This tutorial is to demonstrate the most basic event interaction using messaging. This tutorial will show you the following tasks:

  1. Go to the Try Me! Tab.
  2. Connect the Publisher and Subscriber
  3. Subscribe to a Topic
  4. Publish a Matching Message

Go to the Try Me! Tab

To access the Try Me! tab:

  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 into the PubSub+ Cloud Console.

  2. In the PubSub+ Cloud Console, click Cluster Manager from the navigation bar.

  3. On the Services page, click the card for your event broker service. The event broker service details are displayed.

  4. On the service details page, select the Try Me! tab.

    ../img/tryMe_1.png

    The Try Me! tab, it is divided into the following sections.

    • Charts at the top that represent your event broker service's metrics such as network usage, Guaranteed Messaging endpoints, and the number of active connections.
    • Two CodePen projects: Publisher and Subscriber.
    • In each of the Publisher and Subscriber sections, choose public endpoint.

      If you are performing this step in a Dedicated Region or Customer-Controlled Region and select private endpoint, you may require VPN access to use that endpoint. For more information, see Creating Event Broker Services.

    ../img/tryMe_2.png

Connect the Publisher and Subscriber

To connect the publisher and subscriber, do the following:

  1. In the Publisher CodePen, click Connect.

    Publisher Connect Button

  2. In the Subscriber Codepen, click Connect.

    Subscriber Connect Button

  3. Check that beside the Establish connection text, the previously red link icon changes to a green, which indicates that the Publisher and Subscriber CodePen applications are correctly connected. If not, click show advanced settings to change the credentials that you connect with. The credentials are found in the Connect tab for the event broker service, and can be used for connecting your other applications.

Subscribe to a Topic

In the Subscriber CodePen, under step 2, click Subscribe to subscribe to the try-me topic. After you click the button, the subscribed topic appears. You can also try other topics if you like. See Understanding Topics to learn more about topics.

Subscriber Subscribed to Topic try-me

Publish a Matching Message

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

Publisher Published Message with Topic try-me

You should see that the message has been sent from the Publisher and received by the Subscriber.

../img/tryMe_8.png

Next Steps

You have now exchanged a message between a publisher and a subscriber. Want to learn more?