This commit is contained in:
Mahmoud Ben Hassine
2019-05-07 17:14:12 +02:00
parent 06556dc97e
commit 00ac7c5833
6 changed files with 83 additions and 46 deletions

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2018 the original author or authors.
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -51,6 +51,10 @@ public class KafkaItemWriter<K, T> extends KeyValueItemWriter<K, T> {
Assert.notNull(this.kafkaTemplate.getDefaultTopic(), "KafkaTemplate must have the default topic set.");
}
/**
* Set the {@link KafkaTemplate} to use.
* @param kafkaTemplate to use
*/
public void setKafkaTemplate(KafkaTemplate<K, T> kafkaTemplate) {
this.kafkaTemplate = kafkaTemplate;
}

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2018 the original author or authors.
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,7 +36,7 @@ public class KafkaItemWriterBuilder<K, V> {
private boolean delete;
/**
* Establishes the KafkaTemplate to be used by the KafkaItemWriter.
* Establish the KafkaTemplate to be used by the KafkaItemWriter.
* @param kafkaTemplate the template to be used
* @return this instance for method chaining
* @see KafkaItemWriter#setKafkaTemplate(KafkaTemplate)
@@ -48,7 +48,6 @@ public class KafkaItemWriterBuilder<K, V> {
/**
* Set the {@link Converter} to use to derive the key from the item.
*
* @param itemKeyMapper the Converter to use.
* @return The current instance of the builder.
* @see KafkaItemWriter#setItemKeyMapper(Converter)
@@ -59,11 +58,10 @@ public class KafkaItemWriterBuilder<K, V> {
}
/**
* Indicates if the items being passed to the writer are all to be send as delete events to the topic. A delete
* event is made of a key with a null value. If set to false (default), the items will be send with provided value
* and key converter by the itemKeyMapper. If set to true, the items will be send with the key converter from the
* Indicate if the items being passed to the writer are all to be sent as delete events to the topic. A delete
* event is made of a key with a null value. If set to false (default), the items will be sent with provided value
* and key converter by the itemKeyMapper. If set to true, the items will be sent with the key converter from the
* value by the itemKeyMapper and a null value.
*
* @param delete removal indicator.
* @return The current instance of the builder.
* @see KafkaItemWriter#setDelete(boolean)
@@ -75,7 +73,6 @@ public class KafkaItemWriterBuilder<K, V> {
/**
* Validates and builds a {@link KafkaItemWriter}.
*
* @return a {@link KafkaItemWriter}
*/
public KafkaItemWriter<K, V> build() {

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2018 the original author or authors.
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,4 +22,4 @@
@NonNullApi
package org.springframework.batch.item.kafka.builder;
import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullApi;

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2018 the original author or authors.
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,4 +22,4 @@
@NonNullApi
package org.springframework.batch.item.kafka;
import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullApi;