Just a second...

Binary topics

A topic that streams binary data as bytes and uses efficient binary deltas to stream only the data that changes between updates. Binary topics are stateful: their state is maintained on the Diffusion™ server.

Note: Binary topics are fully supported by the JavaScript® Unified API, Android™ Unified API, Java™ Unified API, and .NET Unified API,

Why use a binary topic?

You can use a binary topic to transmit any arbitrary binary data without the overhead of encoding it to a string or the risk of the binary data being incorrectly escaped.

Binary topics can use binary deltas to send only the data that has changed when this is more efficient than sending the full value.

You can use a binary topic to transmit very large strings. This enables a client to use the binary delta capability to transmit only the changed parts of a string rather than the whole value. This reduces the amount of data transmitted over the network.

Binary formats, such as Google protocol buffers, can be streamed using a binary topic. Though Diffusion provides a Google protocol buffer topic type, the protocol buffer topic requires that a compiled .proto class must be present on the Diffusion server classpath. We recommend that you use a binary topic instead and handle the serialization and deserialization of the protocol buffers in your clients.

Properties of a binary topic

When you create a binary topic you can specify the following properties in the topic specification:
PUBLISH_VALUES_ONLY
If set to true, all values are published in full. Otherwise, deltas are published if they are more efficient to send than the full values.

If there is little or no relationship between values published to a topic, delta streams will not reduce the amount of data transmitted. For such topics, it is better to set PUBLISH_VALUES_ONLY.

Considerations when using a binary topic

Data on binary topics contains no implicit information about its structure.

Data on binary topics cannot be viewed in the console.

Classic API clients (deprecated) do not support any interaction with binary topics.

Binary topics are currently fully supported by only the following APIs:
  • JavaScript Unified API
  • Java Unified API
  • Android Unified API
  • .NET Unified API
The following APIs offer limited support:
  • C Unified API
  • Apple® Unified API

    Use this API to create binary topics and to receive data from binary topics. Updating binary topics is not yet fully supported.

The Publisher API provides the capability to create and update JSON topics using TopicDataFactory.newUniversalData.

If you use value streams to receive updates from a binary topic, this can cause problems in the event of client reconnection. We recommend that when using value streams, you configure your clients not to attempt to reconnect to a session, but instead to connect again with a new session and resubscribe to topics.