Skip to content

Instantly share code, notes, and snippets.

@steklopod
Created July 23, 2020 09:50
Show Gist options
  • Save steklopod/f1c686872ca02ffaceca06a8435b183c to your computer and use it in GitHub Desktop.
Save steklopod/f1c686872ca02ffaceca06a8435b183c to your computer and use it in GitHub Desktop.
@Data
@Validated
@ConfigurationProperties("registration.kafka")
public class KafkaProperties {
@NotEmpty(message = "Parameter 'bootstrap-servers' can not be empty")
private String bootstrapServers;
@NestedConfigurationProperty
@NotNull(message = "Parameter 'some-activate' can not be null")
private KafkaConsumerProperties someActivate;
}
@Data
public class KafkaConsumerProperties {
@NotEmpty(message = "Parameter 'topic' can not be empty")
private String topic;
@NotEmpty(message = "Parameter 'group-id' can not be empty")
private String groupId;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment