Memory¶
The memory
sink captures all stream items into an in-memory list.
This is useful for testing or scenarios where bounded streams can be held in memory.
Typically requires java based pipeline with code that extracts the data from the sink, e.g. displaying data to the user through a custom web server.
MemorySink<String> sink = new MemorySink<>();
sink:
memory: {}
Java dependency management¶
Add this declaration to your dependency management system to access the configuration DSL for this plugin in Java.
<dependency>
<groupId>org.voltdb</groupId>
<artifactId>volt-stream-connectors-api</artifactId>
<version>1.4.0</version>
</dependency>
implementation group: 'org.voltdb', name: 'volt-stream-connectors-api', version: '1.4.0'
Usage Examples¶
stream
.withName("Read data from Mqtt")
.consumeFromSource(MqttSourceConfigBuilder.<MqttPublishMessage>builder()
.withGroupName(groupName)
.withTopicFilter(topicFilter)
)
.processWith(MqttPublishMessage::payload)
.processWith(ReadFromMqttAndNeverFinishCommitPipeline::convertByteBufferToString)
.terminateWithSink(new MemorySink<>());