You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/10/29 18:57:04 UTC

[camel] 03/13: CAMEL-15770 - Kafka serialize/deserialize properties are inconsistently named - serializerClass

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ebf1b0a21ca2720da402569a836c0f96d3762c9d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Oct 29 18:50:59 2020 +0100

     CAMEL-15770 - Kafka serialize/deserialize properties are inconsistently named - serializerClass
---
 .../org/apache/camel/component/kafka/KafkaConfiguration.java | 12 ++++++------
 .../java/org/apache/camel/component/kafka/KafkaProducer.java |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java
index 1f25c14..922420b 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java
@@ -158,7 +158,7 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware
     @UriParam(label = "producer", defaultValue = "10000")
     private Integer queueBufferingMaxMessages = 10000;
     @UriParam(label = "producer", defaultValue = KafkaConstants.KAFKA_DEFAULT_SERIALIZER)
-    private String serializerClass = KafkaConstants.KAFKA_DEFAULT_SERIALIZER;
+    private String valueSerializer = KafkaConstants.KAFKA_DEFAULT_SERIALIZER;
     @UriParam(label = "producer", defaultValue = KafkaConstants.KAFKA_DEFAULT_SERIALIZER)
     private String keySerializer = KafkaConstants.KAFKA_DEFAULT_SERIALIZER;
 
@@ -341,7 +341,7 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware
     public Properties createProducerProperties() {
         Properties props = new Properties();
         addPropertyIfNotNull(props, ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, getKeySerializer());
-        addPropertyIfNotNull(props, ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, getSerializerClass());
+        addPropertyIfNotNull(props, ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, getValueSerializer());
         addPropertyIfNotNull(props, ProducerConfig.ACKS_CONFIG, getRequestRequiredAcks());
         addPropertyIfNotNull(props, ProducerConfig.BUFFER_MEMORY_CONFIG, getBufferMemorySize());
         addPropertyIfNotNull(props, ProducerConfig.COMPRESSION_TYPE_CONFIG, getCompressionCodec());
@@ -875,15 +875,15 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware
         this.queueBufferingMaxMessages = queueBufferingMaxMessages;
     }
 
-    public String getSerializerClass() {
-        return serializerClass;
+    public String getValueSerializer() {
+        return valueSerializer;
     }
 
     /**
      * The serializer class for messages.
      */
-    public void setSerializerClass(String serializerClass) {
-        this.serializerClass = serializerClass;
+    public void setValueSerializer(String valueSerializer) {
+        this.valueSerializer = valueSerializer;
     }
 
     public String getKeySerializer() {
diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
index ef7b241..0466514 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
@@ -231,7 +231,7 @@ public class KafkaProducer extends DefaultAsyncProducer {
 
                         ex = innerExchange == null ? exchange : innerExchange;
                         value = tryConvertToSerializedType(ex, innerMmessage.getBody(),
-                                endpoint.getConfiguration().getSerializerClass());
+                                endpoint.getConfiguration().getValueSerializer());
 
                     }
 
@@ -270,7 +270,7 @@ public class KafkaProducer extends DefaultAsyncProducer {
 
         // must convert each entry of the iterator into the value according to
         // the serializer
-        Object value = tryConvertToSerializedType(exchange, msg, endpoint.getConfiguration().getSerializerClass());
+        Object value = tryConvertToSerializedType(exchange, msg, endpoint.getConfiguration().getValueSerializer());
 
         ProducerRecord record;
         if (hasPartitionKey && hasMessageKey) {