Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageyml
titleDefault Kafka configuration
collapsetrue
kafka:
    bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVER}
    security:
        protocol: PLAINTEXT
    # to be added only in cps-core(producer)
    producer:
        group-id: ${KAFKA_GROUP_ID:cps-temporal-group}
        client-id: ${KAFKA_client_ID:cps}
        value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
    # to be added only in cps-temporal(consumer)
    consumer:
        group-id: ${KAFKA_CONSUMER_GROUP_ID:cps-temporal-group}
        client-id: ${KAFKA_client_ID:cps}
        # Configures the Spring Kafka ErrorHandlingDeserializer that delegates to the 'real' deserializers
        # See https://docs.spring.io/spring-kafka/docs/2.5.11.RELEASE/reference/html/#error-handling-deserializer
        # and https://www.confluent.io/blog/spring-kafka-can-your-kafka-consumers-handle-a-poison-pill/
        key-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
        value-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
        properties:
             spring.deserializer.key.delegate.class: org.apache.kafka.common.serialization.StringDeserializer
             spring.deserializer.value.delegate.class: org.springframework.kafka.support.serializer.JsonDeserializer
             spring.json.value.default.type: org.onap.cps.event.model.CpsDataUpdatedEvent


Any other security protocol to be used could be configured using the OOM charts on a k8s environment.
The below values are to be defined in the values.yaml

...

Code Block
languageyml
titleApplication-helm changes in OOM charts
collapsetrue
spring:
    kafka:
        bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVER}
        security:
            protocol: {{ .Values.kafka.security.protocol }}
        ssl:
            trust-store-type: {{ .Values.kafka.ssl.trust-store-type }}
            trust-store-location: {{ .Values.kafka.ssl.trust-store-location }}
            trust-store-password: {{ .Values.kafka.ssl.trust-store-password }}
        properties:
            sasl.mechanism: '{{ .Values.kafka.proeprties.sasl_mechanism }}'
            sasl.jaas.config: '{{ .Values.kafka.proeprties.sasl.jaas.config }}';
            ssl.endpoint.identification.algorithm:
        # at producer end only
        producer:
            value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
        # at consumer end only 
        consumer:
            # Configures the Spring Kafka ErrorHandlingDeserializer that delegates to the 'real' deserializers
            # See https://docs.spring.io/spring-kafka/docs/2.5.11.RELEASE/reference/html/#error-handling-deserializer
            # and https://www.confluent.io/blog/spring-kafka-can-your-kafka-consumers-handle-a-poison-pill/
            key-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
            value-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
            properties:
                spring.deserializer.key.delegate.class: org.apache.kafka.common.serialization.StringDeserializer
                spring.deserializer.value.delegate.class: org.springframework.kafka.support.serializer.JsonDeserializer


NOTE: Topics are auto generated in ONAP DMaaP Kafka. Hence topic creation is not covered in the scope on CPS.


...