-
Notifications
You must be signed in to change notification settings - Fork 4
KdbPublisherManager
This class provides a single interface to publish tables to multiple kdb+ processes at the same time. For example, publishing to a primary and secondary kdb instance.
Construction of the publisher manager requires no configuration.
To add processes to publish to, use addPublisher(KdbProcess)
. This method will check to ensure the target process is not already added and that the process can be connected to. Each publisher added is constructed as a KdbPublisherThread
and therefore has a thread assigned to each one.
You can publish tables in one of two ways:
-
publish(List<KdbTable>)
: Publishes all specified tables to all configured processes within the manager -
publish(List<KdbProcess>, List<KdbTable)
: Publishes all specified tables to the specified processes. Any process passed that is not managed by this manager will result in aKdbPublisherDoesNotExistException
As part of the application shutdown, it is recommended to call shutdown
which will gracefully close the connections to all configured processes.
public KdbPublisherManager startManager() throws KdbTargetProcessUnavailableException, KdbPublisherAlreadyExistsException {
KdbPublisherManager manager = new KdbPublisherManager();
manager.add(new KdbProcess("primary.host", 1234));
manager.add(new KdbProcess("secondary.host", 1234));
return manager;
}
Copyright (C) Sport Trades Ltd 2017 - 2020, John Keys and Jaskirat Rajasansir 2020 - 2021