org.apache.camel.component.kafka.KafkaConfiguration Java Examples

The following examples show how to use org.apache.camel.component.kafka.KafkaConfiguration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DebeziumTransactionTransformerApplication.java    From eda-tutorial with Apache License 2.0 5 votes vote down vote up
@Bean
public KafkaComponent kafka() {
    KafkaComponent kafkaComponent = new KafkaComponent();
    KafkaConfiguration configuration = new KafkaConfiguration();
    configuration.setBrokers("my-cluster-kafka-bootstrap.strimzi-infra.svc:9092");
    configuration.setGroupId("debezium-transaction-transformer");
    kafkaComponent.setConfiguration(configuration);
    return kafkaComponent;
}
 
Example #2
Source File: AccountApplication.java    From eda-tutorial with Apache License 2.0 5 votes vote down vote up
@Bean
public KafkaComponent kafka() {
    KafkaComponent kafkaComponent = new KafkaComponent();
    KafkaConfiguration configuration = new KafkaConfiguration();
    configuration.setBrokers("my-cluster-kafka-bootstrap.strimzi-infra.svc:9092");
    configuration.setGroupId("account");
    kafkaComponent.setConfiguration(configuration);
    return kafkaComponent;
}
 
Example #3
Source File: KafkaReceiverApplication.java    From eda-tutorial with Apache License 2.0 5 votes vote down vote up
@Produces
@Named("kafka")
public KafkaComponent kafka() {
    KafkaComponent kafkaComponent = new KafkaComponent();
    KafkaConfiguration configuration = new KafkaConfiguration();
    configuration.setBrokers("localhost:9092");
    kafkaComponent.setConfiguration(configuration);
    return kafkaComponent;
}
 
Example #4
Source File: KafkaSenderApplication.java    From eda-tutorial with Apache License 2.0 5 votes vote down vote up
@Bean
public KafkaComponent kafka() {
    KafkaComponent kafkaComponent = new KafkaComponent();
    KafkaConfiguration configuration = new KafkaConfiguration();
    configuration.setBrokers("my-cluster-kafka-bootstrap.strimzi-infra.svc:9092");
    kafkaComponent.setConfiguration(configuration);
    return kafkaComponent;
}
 
Example #5
Source File: KafkaReceiverApplication.java    From eda-tutorial with Apache License 2.0 5 votes vote down vote up
@Bean
public KafkaComponent kafka() {
    KafkaComponent kafkaComponent = new KafkaComponent();
    KafkaConfiguration configuration = new KafkaConfiguration();
    configuration.setBrokers("my-cluster-kafka-bootstrap.strimzi-infra.svc:9092");
    kafkaComponent.setConfiguration(configuration);
    return kafkaComponent;
}
 
Example #6
Source File: KafkaConnectionCustomizer.java    From syndesis with Apache License 2.0 5 votes vote down vote up
@Override
public void customize(ComponentProxyComponent component, Map<String, Object> options) {
    if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) {
        LOG.info("Setting SSLContextParameters configuration as a self-signed certificate was provided");
        SSLContextParameters sslContextParameters = createSSLContextParameters(
            ConnectorOptions.extractOption(options, CERTIFICATE_OPTION));
        KafkaConfiguration configuration = new KafkaConfiguration();
        configuration.setSslContextParameters(sslContextParameters);
        configuration.setSecurityProtocol("SSL");
        // If present, Kafka client 2.0 is using this parameter to verify host
        // we must set to blank to skip host verification
        configuration.setSslEndpointAlgorithm("");
        options.put("configuration", configuration);
    }
}
 
Example #7
Source File: KafkaConnectionCustomizerTest.java    From syndesis with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldAssertIfSelfSignedCertificate() {
    KafkaConnectionCustomizer kafkaConnectionCustomizer = new KafkaConnectionCustomizer();
    Map<String, Object> options = new HashMap<>();
    options.put("brokers", "test:9092");
    options.put("brokerCertificate", TEST_CERT);
    kafkaConnectionCustomizer.customize(null, options);
    assertThat(options).containsKey("configuration");
    KafkaConfiguration kafkaConfiguration = (KafkaConfiguration) options.get("configuration");
    assertThat(kafkaConfiguration.getSslContextParameters()).isNotNull();
    assertThat(kafkaConfiguration.getSecurityProtocol()).isEqualTo("SSL");
    assertThat(kafkaConfiguration.getSslEndpointAlgorithm()).isEqualTo("");
}