Tuple Loading Topic

note

Tuple Loading Topics cannot be defined via configuration properties.

Java Configuration

TupleTopicDescription Spring Beans are picked up as configuration for the DLC.

Parameter Required Type Default Description
name Y String Name of the topic.
tupleSupplier Y Function<DlcScope, Collection<Object[]>> The tuple supplier.
headers List<String> The headers of the tuples provided by supplier.
channels Set<Channel> A channel is created using the topic’s name as the name of the target. Channels
restrictToSources Set<String> Sources to which the topic restricted. See source to topic matching.
restrictFromSources Set<String> Sources from which the topic is restricted. See source to topic matching.

Java Example

This configuration does not specify a target for the data or the data format.

note

If you do not name your topic the same as your store you will have to explicitly specify the target in the channel of the topic.

  • The target is implicitly the Atoti table named “Trades”.
  • The format (column order of the tuples and how input fields are parsed) implicitly comes from the columns and types of the targeted Atoti table, in this case “Trades”.
@Bean
public TupleTopicDescription tupleTopic() {
    return TupleTopicDescription.builder("trades", this::generateTuples)
            .build();
}