Skip to content

Instantly share code, notes, and snippets.

@schroedermatt
Created April 4, 2022 20:41
Show Gist options
  • Save schroedermatt/f159cc3744743516a8af543a4a45884c to your computer and use it in GitHub Desktop.
Save schroedermatt/f159cc3744743516a8af543a4a45884c to your computer and use it in GitHub Desktop.
/**
* Custom subscriber that will be notified on all UnleashEvents.
* The extended Log4JSubscriber will log out the events that are not
* handled in this extension.
**/
public class KafkaUnleashSubscriber extends Log4JSubscriber {
@Override
public void on(@NotNull UnleashEvent event) {
// many events come through here, we only care about responses
if (event instance of FeatureToggleResponse) {
// event has ALL toggles, filter out those you care about
// apply toggles to consumer
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment