Go API Developer's Guide

The PubSub+ Messaging API for Go (version 1.7) uses modern development patterns and usability in the form of a native Solace API. The PubSub+ Go API allows your applications to take full advantage of the Solace event broker's feature set.

The PubSub+ Messaging API for Go utilizes the builder pattern, which allows you to easily create a MessagingService instance with a custom configuration that then connects to an event broker. After a successful connection is established, you can send and receive messages using our Go API. Our Go API allows you to handle scenarios where messages accumulate on internal buffers, referred to as back-pressure. For example, on a client application that sends messages, it is possible to have a scenario where the client application is generating messages faster than the messages can be sent to the event broker, which can happen due to factors such as network congestion.

Here's an overview of how to use the PubSub+ Messaging API for Go after you've set-up your environment:

  1. Build a MessagingService instance and configure it using properties to:
  2. Send messages to or receive messages from an event broker as follows using:

    During the creation of the message publishers or message consumers, you can configure how to handle when back-pressure occurs. See each section below for more information.

  3. As part of publishing or consuming messages, use OutboundMessage and InboundMessage, and handle errors as required via event handlers.

You can reference various sample applications to understand how to use our Go API. For more information, review sections of this guide along with the PubSub+ Messaging API for Go reference and Go sample code on the Solace Go API GitHub page.