Annotation Type TopicPartition


  • @Target({})
    @Retention(RUNTIME)
    public @interface TopicPartition
    Used to add topic/partition information to a KafkaListener.
    Author:
    Gary Russell, Artem Bilan
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String topic
      The topic to listen on.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      PartitionOffset[] partitionOffsets
      The partitions with initial offsets within the topic.
      java.lang.String[] partitions
      The partitions within the topic.
    • Element Detail

      • topic

        java.lang.String topic
        The topic to listen on.
        Returns:
        the topic to listen on. Property place holders and SpEL expressions are supported, which must resolve to a String.
      • partitions

        java.lang.String[] partitions
        The partitions within the topic. Partitions specified here can't be duplicated in partitionOffsets(). Each string can contain a comma-delimited list of partitions, or ranges of partitions (e.g. 0-5, 7, 10-15.
        Returns:
        the partitions within the topic. Property place holders and SpEL expressions are supported, which must resolve to Integers (or Strings that can be parsed as Integers).
        Default:
        {}
      • partitionOffsets

        PartitionOffset[] partitionOffsets
        The partitions with initial offsets within the topic. There must only be one instance of PartitionOffset if its 'partition' property is '*'. Partitions specified here can't be duplicated in the partitions().
        Returns:
        the PartitionOffset array.
        Default:
        {}