Last active
February 5, 2021 14:31
-
-
Save jparanda/16b35aea922612377b48c5b235257f6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.osgi.service.component.annotations.Activate; | |
import org.osgi.service.component.annotations.Component; | |
import org.osgi.service.component.annotations.Modified; | |
import org.osgi.service.component.propertytypes.ServiceDescription; | |
import org.osgi.service.metatype.annotations.Designate; | |
@Component(service = KafkaConfig.class, immediate = true) | |
@ServiceDescription("Kafka Configuration") | |
@Designate(ocd = KafkaConfigProperties.class) | |
public class KafkaConfig { | |
protected static final String DEFAULT_AUTO_OFFSET_RESET_CONFIG = "earliest"; | |
protected static final String DEFAULT_CLUSTER_SERVERS = "localhost:9092"; | |
private boolean enabled; | |
private String clusterServers; | |
private boolean enableAutoCommit; | |
private String autoOffsetReset; | |
private String[] topics; | |
private long pollTimeout; | |
@Activate | |
@Modified | |
public void onActivateOrSave(KafkaConfigProperties config) { | |
setEnabled(config.excalibur_kafka_enabled()); | |
setClusterServers(config.excalibur_kafka_cluster_servers()); | |
setEnableAutoCommit(config.excalibur_kafka_enable_auto_commit()); | |
setAutoOffsetReset(config.excalibur_kafka_auto_offset_reset()); | |
setTopics(config.excalibur_kafka_topics()); | |
setPollTimeout(config.excalibur_kafka_poll_timeout()); | |
} | |
//Setters and Getters | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment