Publisher class

The Publisher class sends row updates to a specified table in Refinery.

The Publisher accepts a string array containing the column names and a generic object array that contains the row values. The column names and row values must be in the same order as the table in Refinery. Publishers are registered by the service class. (i.e. the C# Service class registers the publisher with the Refinery messaging server).

Note: For KX Refinery environments running hot-hot, this must be repeated on the secondary side if there is one. It is the user’s responsibility to publish identical data to both sides (primary & secondary), and to handle any and all failover scenarios (including how to publish any backlog of data).

See Publishing Data for an example implementation of a dual publish.

Methods

The Publisher class exposes the following public methods:

  • Publish: Publish data to the subscribers.
  • PublishSync: Publish data to the subscribers synchronously.
  • SubscriptionAdded: Adds a subscriber to this publisher.
  • SubscriptionRemoved: Removes a subscriber to this publisher.
  • HasSubscribers: Indicates whether this publisher has any subscribers.
  • WaitForSubscribers: Waits for subscribers to be added to the publisher.