commit
565ec07046
|
|
@ -177,6 +177,18 @@ public class KafkaProperties {
|
|||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an initial map of consumer properties from the state of this instance.
|
||||
* <p>
|
||||
* This allows you to add additional properties, if necessary, and override the
|
||||
* default {@code kafkaConsumerFactory} bean.
|
||||
* @return the consumer properties initialized with the customizations defined on this
|
||||
* instance
|
||||
*/
|
||||
public Map<String, Object> buildConsumerProperties() {
|
||||
return buildConsumerProperties(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an initial map of consumer properties from the state of this instance.
|
||||
* <p>
|
||||
|
|
@ -192,6 +204,18 @@ public class KafkaProperties {
|
|||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an initial map of producer properties from the state of this instance.
|
||||
* <p>
|
||||
* This allows you to add additional properties, if necessary, and override the
|
||||
* default {@code kafkaProducerFactory} bean.
|
||||
* @return the producer properties initialized with the customizations defined on this
|
||||
* instance
|
||||
*/
|
||||
public Map<String, Object> buildProducerProperties() {
|
||||
return buildProducerProperties(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an initial map of producer properties from the state of this instance.
|
||||
* <p>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
|
|||
* @author Madhura Bhave
|
||||
* @since 2.1.0
|
||||
*/
|
||||
|
||||
public class ClientsConfiguredCondition extends SpringBootCondition {
|
||||
|
||||
private static final Bindable<Map<String, OAuth2ClientProperties.Registration>> STRING_REGISTRATION_MAP = Bindable
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class KafkaPropertiesTests {
|
|||
properties.getSsl().setKeyStoreKey("-----BEGINkey");
|
||||
properties.getSsl().setTrustStoreCertificates("-----BEGINtrust");
|
||||
properties.getSsl().setKeyStoreCertificateChain("-----BEGINchain");
|
||||
Map<String, Object> consumerProperties = properties.buildConsumerProperties(null);
|
||||
Map<String, Object> consumerProperties = properties.buildConsumerProperties();
|
||||
assertThat(consumerProperties).containsEntry(SslConfigs.SSL_KEYSTORE_KEY_CONFIG, "-----BEGINkey");
|
||||
assertThat(consumerProperties).containsEntry(SslConfigs.SSL_TRUSTSTORE_CERTIFICATES_CONFIG, "-----BEGINtrust");
|
||||
assertThat(consumerProperties).containsEntry(SslConfigs.SSL_KEYSTORE_CERTIFICATE_CHAIN_CONFIG,
|
||||
|
|
@ -103,7 +103,7 @@ class KafkaPropertiesTests {
|
|||
properties.getSsl().setKeyStoreKey("-----BEGIN");
|
||||
properties.getSsl().setKeyStoreLocation(new ClassPathResource("ksLoc"));
|
||||
assertThatExceptionOfType(MutuallyExclusiveConfigurationPropertiesException.class)
|
||||
.isThrownBy(() -> properties.buildConsumerProperties(null));
|
||||
.isThrownBy(() -> properties.buildConsumerProperties());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -112,7 +112,7 @@ class KafkaPropertiesTests {
|
|||
properties.getSsl().setTrustStoreLocation(new ClassPathResource("tsLoc"));
|
||||
properties.getSsl().setTrustStoreCertificates("-----BEGIN");
|
||||
assertThatExceptionOfType(MutuallyExclusiveConfigurationPropertiesException.class)
|
||||
.isThrownBy(() -> properties.buildConsumerProperties(null));
|
||||
.isThrownBy(() -> properties.buildConsumerProperties());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue