The SPLDoc for the MessageHubConsumer is inconsistent in the Port section of the operator and in the SPL functions to create the JSON for the input port. The offsets for fetch from beginning and fetch from end of a partition are contrary.
Description of input port
This port is used to specify the topic-partition offsets that the consumer should begin reading messages from. When this port is specified, the operator will ignore the topic, partition and startPosition parameters. The operator will only begin consuming messages once a tuple is received on this port. Each tuple received on this port will cause the operator to seek to the offsets for the specified topic-partitions. This works as follows:
To seek to the beginning of a topic-partition, set the value of the offset to -1.
To seek to the end of a topic-partition, set the value of the offset attribute to -2.
The SPLDoc for the MessageHubConsumer is inconsistent in the Port section of the operator and in the SPL functions to create the JSON for the input port. The offsets for fetch from beginning and fetch from end of a partition are contrary.
Description of input port
This port is used to specify the topic-partition offsets that the consumer should begin reading messages from. When this port is specified, the operator will ignore the topic, partition and startPosition parameters. The operator will only begin consuming messages once a tuple is received on this port. Each tuple received on this port will cause the operator to seek to the offsets for the specified topic-partitions. This works as follows:
Description of SPL functions
rstring createMessageAddTopicPartition(rstring topic, int32 partition, int64 offset)
Creates the JSON message to add a single topic-partition to the operator and to begin consuming at the specified offset.
What is right?
The documentation of the SPL functions is correct.