-
Notifications
You must be signed in to change notification settings - Fork 32
Consistent Region Support for Messaging Toolkit
This documents describes the design of consistent region for each of the operators in the Messaging Toolkit.
- KafkaProducer will not be allowed at the beginning of a consistent region
[Samantha:] Is the operator doing anything special on drain, checkpoint, reset and resetToInitialState? What can the user expect from message delivery perspective ?
- KafkaConsumer will not be allowed in a consistent region. It is technically possible to use a low level Kafka API and support some sort of replaying of data for consistent regions, however Kafka documentation mentions that replay support will be added in the recommended high-level API sometime in the near future. Consistent region support can then be re-evaluated at that point
MQTTSink Operator
Limitations:
- MQTTSink operator can not be placed at start of a consistent region.
- MQTTSink operator does not support tuple replay for control port. The operator will issue warning messages to user about control port behavior.
On Drain: The operator will flush all tuples remaining in its internal buffer to the remote messaging server.
On Checkpoint: The operator saves states of qos, serverUri, topics attributes.
On Reset: The operator restores the attribute states saved in the provided checkpoint, i.e previously saved checkpoint.
On ResetToInit: the operator restores value of qos, serverUri and topics to its initial state.
With this approach, the MQTTSink operator may expect the following behavior when it participates in a consistent region.
- Messages with qos=1 and 2 will be delivered to messaging server at least once. Duplicate tuples is expected. (Does this mean we are droping support of qos=0, also allowing duplicate tuples will break qos=2 protocol.)
Samantha: No, it does not mean we are dropping support for qos=0. It means that user must set qos=1, 2 to guaranteed message delivery of at least once from Streams.
- MQTTSink operator does not support control port tuple restore, user may want to reply control port after a reset.
MQTTSource Operator:
- This operator can NOT participate in a consistent region.
- User should use ReplayableStart operator after MQTTSource operator to achieve tuple replay.
- Since this operator has internal buffer, a new attribute will be introduced allowing user to control size of internal buffer. In case of having replayableStart operator after it, setting size of internal buffer to 1 will help avoiding losing tuples in case of reset.