Class ConsumerRecordFactory<K,​V>

    • Constructor Detail

      • ConsumerRecordFactory

        public ConsumerRecordFactory​(Serializer<K> keySerializer,
                                     Serializer<V> valueSerializer)
        Deprecated.
        Create a new factory for the given topic. Uses current system time as start timestamp. Auto-advance is disabled.
        Parameters:
        keySerializer - the key serializer
        valueSerializer - the value serializer
      • ConsumerRecordFactory

        public ConsumerRecordFactory​(String defaultTopicName,
                                     Serializer<K> keySerializer,
                                     Serializer<V> valueSerializer)
        Deprecated.
        Create a new factory for the given topic. Uses current system time as start timestamp. Auto-advance is disabled.
        Parameters:
        defaultTopicName - the default topic name used for all generated consumer records
        keySerializer - the key serializer
        valueSerializer - the value serializer
      • ConsumerRecordFactory

        public ConsumerRecordFactory​(Serializer<K> keySerializer,
                                     Serializer<V> valueSerializer,
                                     long startTimestampMs)
        Deprecated.
        Create a new factory for the given topic. Auto-advance is disabled.
        Parameters:
        keySerializer - the key serializer
        valueSerializer - the value serializer
        startTimestampMs - the initial timestamp for generated records
      • ConsumerRecordFactory

        public ConsumerRecordFactory​(String defaultTopicName,
                                     Serializer<K> keySerializer,
                                     Serializer<V> valueSerializer,
                                     long startTimestampMs)
        Deprecated.
        Create a new factory for the given topic. Auto-advance is disabled.
        Parameters:
        defaultTopicName - the topic name used for all generated consumer records
        keySerializer - the key serializer
        valueSerializer - the value serializer
        startTimestampMs - the initial timestamp for generated records
      • ConsumerRecordFactory

        public ConsumerRecordFactory​(Serializer<K> keySerializer,
                                     Serializer<V> valueSerializer,
                                     long startTimestampMs,
                                     long autoAdvanceMs)
        Deprecated.
        Create a new factory for the given topic.
        Parameters:
        keySerializer - the key serializer
        valueSerializer - the value serializer
        startTimestampMs - the initial timestamp for generated records
        autoAdvanceMs - the time increment pre generated record
      • ConsumerRecordFactory

        public ConsumerRecordFactory​(String defaultTopicName,
                                     Serializer<K> keySerializer,
                                     Serializer<V> valueSerializer,
                                     long startTimestampMs,
                                     long autoAdvanceMs)
        Deprecated.
        Create a new factory for the given topic.
        Parameters:
        defaultTopicName - the topic name used for all generated consumer records
        keySerializer - the key serializer
        valueSerializer - the value serializer
        startTimestampMs - the initial timestamp for generated records
        autoAdvanceMs - the time increment pre generated record
    • Method Detail

      • advanceTimeMs

        public void advanceTimeMs​(long advanceMs)
        Deprecated.
        Advances the internally tracked time.
        Parameters:
        advanceMs - the amount of time to advance
      • create

        public ConsumerRecord<byte[],​byte[]> create​(String topicName,
                                                          K key,
                                                          V value,
                                                          Headers headers,
                                                          long timestampMs)
        Deprecated.
        Create a ConsumerRecord with the given topic name, key, value, headers, and timestamp. Does not auto advance internally tracked time.
        Parameters:
        topicName - the topic name
        key - the record key
        value - the record value
        headers - the record headers
        timestampMs - the record timestamp
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(String topicName,
                                                          K key,
                                                          V value,
                                                          long timestampMs)
        Deprecated.
        Create a ConsumerRecord with the given topic name and given topic, key, value, and timestamp. Does not auto advance internally tracked time.
        Parameters:
        topicName - the topic name
        key - the record key
        value - the record value
        timestampMs - the record timestamp
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(K key,
                                                          V value,
                                                          long timestampMs)
        Deprecated.
        Create a ConsumerRecord with default topic name and given key, value, and timestamp. Does not auto advance internally tracked time.
        Parameters:
        key - the record key
        value - the record value
        timestampMs - the record timestamp
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(K key,
                                                          V value,
                                                          Headers headers,
                                                          long timestampMs)
        Deprecated.
        Create a ConsumerRecord with default topic name and given key, value, headers, and timestamp. Does not auto advance internally tracked time.
        Parameters:
        key - the record key
        value - the record value
        headers - the record headers
        timestampMs - the record timestamp
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(String topicName,
                                                          K key,
                                                          V value)
        Deprecated.
        Create a ConsumerRecord with the given topic name, key, and value. The timestamp will be generated based on the constructor provided start time and time will auto advance.
        Parameters:
        topicName - the topic name
        key - the record key
        value - the record value
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(String topicName,
                                                          K key,
                                                          V value,
                                                          Headers headers)
        Deprecated.
        Create a ConsumerRecord with the given topic name, key, value, and headers. The timestamp will be generated based on the constructor provided start time and time will auto advance.
        Parameters:
        topicName - the topic name
        key - the record key
        value - the record value
        headers - the record headers
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(K key,
                                                          V value)
        Deprecated.
        Create a ConsumerRecord with default topic name and given key and value. The timestamp will be generated based on the constructor provided start time and time will auto advance.
        Parameters:
        key - the record key
        value - the record value
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(K key,
                                                          V value,
                                                          Headers headers)
        Deprecated.
        Create a ConsumerRecord with default topic name and given key, value, and headers. The timestamp will be generated based on the constructor provided start time and time will auto advance.
        Parameters:
        key - the record key
        value - the record value
        headers - the record headers
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(String topicName,
                                                          V value,
                                                          long timestampMs)
        Deprecated.
        Create a ConsumerRecord with null-key and the given topic name, value, and timestamp. Does not auto advance internally tracked time.
        Parameters:
        topicName - the topic name
        value - the record value
        timestampMs - the record timestamp
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(String topicName,
                                                          V value,
                                                          Headers headers,
                                                          long timestampMs)
        Deprecated.
        Create a ConsumerRecord with null-key and the given topic name, value, headers, and timestamp. Does not auto advance internally tracked time.
        Parameters:
        topicName - the topic name
        value - the record value
        headers - the record headers
        timestampMs - the record timestamp
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(V value,
                                                          long timestampMs)
        Deprecated.
        Create a ConsumerRecord with default topic name and null-key as well as given value and timestamp. Does not auto advance internally tracked time.
        Parameters:
        value - the record value
        timestampMs - the record timestamp
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(V value,
                                                          Headers headers,
                                                          long timestampMs)
        Deprecated.
        Create a ConsumerRecord with default topic name and null-key as well as given value, headers, and timestamp. Does not auto advance internally tracked time.
        Parameters:
        value - the record value
        headers - the record headers
        timestampMs - the record timestamp
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(String topicName,
                                                          V value,
                                                          Headers headers)
        Deprecated.
        Create a ConsumerRecord with null-key and the given topic name, value, and headers. The timestamp will be generated based on the constructor provided start time and time will auto advance.
        Parameters:
        topicName - the topic name
        value - the record value
        headers - the record headers
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(String topicName,
                                                          V value)
        Deprecated.
        Create a ConsumerRecord with null-key and the given topic name and value. The timestamp will be generated based on the constructor provided start time and time will auto advance.
        Parameters:
        topicName - the topic name
        value - the record value
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(V value)
        Deprecated.
        Create a ConsumerRecord with default topic name and null-key was well as given value. The timestamp will be generated based on the constructor provided start time and time will auto advance.
        Parameters:
        value - the record value
        Returns:
        the generated ConsumerRecord
      • create

        public ConsumerRecord<byte[],​byte[]> create​(V value,
                                                          Headers headers)
        Deprecated.
        Create a ConsumerRecord with default topic name and null-key was well as given value and headers. The timestamp will be generated based on the constructor provided start time and time will auto advance.
        Parameters:
        value - the record value
        headers - the record headers
        Returns:
        the generated ConsumerRecord
      • create

        public List<ConsumerRecord<byte[],​byte[]>> create​(String topicName,
                                                                List<KeyValue<K,​V>> keyValues)
        Deprecated.
        Creates consumer records with the given topic name, keys, and values. The timestamp will be generated based on the constructor provided start time and time will auto advance.
        Parameters:
        topicName - the topic name
        keyValues - the record keys and values
        Returns:
        the generated consumer records
      • create

        public List<ConsumerRecord<byte[],​byte[]>> create​(List<KeyValue<K,​V>> keyValues)
        Deprecated.
        Creates consumer records with default topic name as well as given keys and values. The timestamp will be generated based on the constructor provided start time and time will auto advance.
        Parameters:
        keyValues - the record keys and values
        Returns:
        the generated consumer records
      • create

        public List<ConsumerRecord<byte[],​byte[]>> create​(String topicName,
                                                                List<KeyValue<K,​V>> keyValues,
                                                                long startTimestamp,
                                                                long advanceMs)
        Deprecated.
        Creates consumer records with the given topic name, keys, and values. Does not auto advance internally tracked time.
        Parameters:
        topicName - the topic name
        keyValues - the record keys and values
        startTimestamp - the timestamp for the first generated record
        advanceMs - the time difference between two consecutive generated records
        Returns:
        the generated consumer records
      • create

        public List<ConsumerRecord<byte[],​byte[]>> create​(List<KeyValue<K,​V>> keyValues,
                                                                long startTimestamp,
                                                                long advanceMs)
        Deprecated.
        Creates consumer records with default topic name as well as given keys and values. Does not auto advance internally tracked time.
        Parameters:
        keyValues - the record keys and values
        startTimestamp - the timestamp for the first generated record
        advanceMs - the time difference between two consecutive generated records
        Returns:
        the generated consumer records
      • create

        public List<ConsumerRecord<byte[],​byte[]>> create​(String topicName,
                                                                List<KeyValue<K,​V>> keyValues,
                                                                long startTimestamp)
        Deprecated.
        Creates consumer records with the given topic name, keys and values. For each generated record, the time is advanced by 1. Does not auto advance internally tracked time.
        Parameters:
        topicName - the topic name
        keyValues - the record keys and values
        startTimestamp - the timestamp for the first generated record
        Returns:
        the generated consumer records
      • create

        public List<ConsumerRecord<byte[],​byte[]>> create​(List<KeyValue<K,​V>> keyValues,
                                                                long startTimestamp)
        Deprecated.
        Creates consumer records with the given keys and values. For each generated record, the time is advanced by 1. Does not auto advance internally tracked time.
        Parameters:
        keyValues - the record keys and values
        startTimestamp - the timestamp for the first generated record
        Returns:
        the generated consumer records