Skip to main content

AMPS Sink

The AMPSSink publishes data to AMPS. It uses the Sink V2 API as described in FLIP-191 and FLIP-372 to enable developers to move data from Flink into AMPS. The sink is responsible for serializing and publishing messages to AMPS.

The sink follows the builder pattern to easily allow developers to only modify the sink based on specific needs. The following is an example of the simplest AMPSSink that can be constructed. In this example, the uri is the AMPS connection URI, and the topic is the topic the sink will use to publish to AMPS. The SimpleStringSchema is a serialization schema that serializes a String object from Flink into a byte array.

AMPSSink<String> sink = AMPSSink.<String>builder()
.setUri(uri)
.setTopic(topic)
.setSerializationSchema(new SimpleStringSchema())
.build();
info

A valid AMPSSink requires a connection to AMPS, a topic to publish to, and a serialization schema to serialize the objects from Flink. The methods above demonstrate the simplest way to provide these to the sink through a URI string, a topic string, and a serialization schema.