Solace Java API Developer's Guide

The Solace Java API (version 1.8) uses modern interfaces, patterns, and usability in a native Java environment. The Solace Java API offers many of the same features as the Solace JCSMP API, but requires minimal setup to provide a streamlined developer experience to develop client applications.

The Solace Java API utilizes the builder pattern, which allows you to easily create a MessagingService object with a custom configuration that then connects to an event broker. After a successful connection is established, you can send and receive messages using other interfaces provided in the Solace Java API. You can use the Solace Java API 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 Solace Java API after you've set-up your environment:

  1. Build the MessagingService object and configure it using properties to:
  2. Send messages to or receive messages from an event broker as follows using these objects:

    During the creation of the objects to publish or consume messages, you can configure how to handle when back-pressure occurs. See each section below for more information.

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

You can reference various sample applications to understand how to use the Solace Java API. For more information, see Using the Solace Java API Examples or review sections of this guide along with the Solace Java API reference.

Here's a short video that provides a brief overview of the Solace Java API.