Class FilteredKafkaIasiosConsumer

java.lang.Object
org.eso.ias.kafkautils.SimpleKafkaIasiosConsumer
org.eso.ias.kafkautils.FilteredKafkaIasiosConsumer
All Implemented Interfaces:
KafkaStringsConsumer.StringsConsumer

public class FilteredKafkaIasiosConsumer extends SimpleKafkaIasiosConsumer
FilteredKafkaIasiosConsumer allows to set a custom filter on top of the Kafka consumer. The filter implements the FilterIaValue interface.
  • Constructor Details

    • FilteredKafkaIasiosConsumer

      public FilteredKafkaIasiosConsumer(String servers, String topicName, String consumerID, FilteredKafkaIasiosConsumer.FilterIasValue filter)
      Constructor
      Parameters:
      servers - The kafka servers to connect to
      topicName - The name of the topic to get events from
      consumerID - the ID of the consumer
      filter - The filter to apply to accept or discard IASValues
  • Method Details

    • accept

      protected boolean accept(IASValue<?> iasio)
      Accepts or rejects a IASValue against the filters, if set
      Overrides:
      accept in class SimpleKafkaIasiosConsumer
      Parameters:
      iasio - The IASValue to accept or discard
      Returns:
      true if the value is accpted; false otherwise