Class RedisSink

java.lang.Object
org.apache.pulsar.io.redis.sink.RedisSink
All Implemented Interfaces:
AutoCloseable, org.apache.pulsar.io.core.Sink<byte[]>

public class RedisSink extends Object implements org.apache.pulsar.io.core.Sink<byte[]>
A Simple Redis sink, which stores the key/value records from Pulsar in redis. Note that records from Pulsar with null keys or values will be ignored. This class expects records from Pulsar to have a key and value that are stored as bytes or a string.
  • Constructor Details

    • RedisSink

      public RedisSink()
  • Method Details

    • open

      public void open(Map<String,Object> config, org.apache.pulsar.io.core.SinkContext sinkContext) throws Exception
      Specified by:
      open in interface org.apache.pulsar.io.core.Sink<byte[]>
      Throws:
      Exception
    • write

      public void write(org.apache.pulsar.functions.api.Record<byte[]> record) throws Exception
      Specified by:
      write in interface org.apache.pulsar.io.core.Sink<byte[]>
      Throws:
      Exception
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception