Skip to content

Commit d317523

Browse files
committed
fix: empty debezium values
1 parent a188644 commit d317523

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
2-
* Copyright 2023 Sven Loesekann
3-
Licensed under the Apache License, Version 2.0 (the "License");
4-
you may not use this file except in compliance with the License.
5-
You may obtain a copy of the License at
6-
http://www.apache.org/licenses/LICENSE-2.0
7-
Unless required by applicable law or agreed to in writing, software
8-
distributed under the License is distributed on an "AS IS" BASIS,
9-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10-
See the License for the specific language governing permissions and
11-
limitations under the License.
2+
* Copyright 2023 Sven Loesekann
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
1212
*/
1313
package de.xxx.dbtorest.source;
1414

@@ -19,6 +19,9 @@
1919
import org.springframework.stereotype.Service;
2020
import org.springframework.transaction.annotation.Transactional;
2121

22+
import java.util.Optional;
23+
import java.util.function.Predicate;
24+
2225
@Service
2326
@Transactional
2427
public class DbChangeSourceService {
@@ -31,6 +34,7 @@ public DbChangeSourceService(KafkaProducer kafkaProducer) {
3134

3235
public void sendChange(DbChangeDto dbChangeDto) {
3336
//LOGGER.info(dbChangeDto.toString());
34-
this.kafkaProducer.sendDbChangeMsg(dbChangeDto);
37+
Optional.ofNullable(dbChangeDto.value()).stream().filter(Predicate.not(String::isBlank)).findFirst()
38+
.ifPresent(x -> this.kafkaProducer.sendDbChangeMsg(dbChangeDto));
3539
}
3640
}

0 commit comments

Comments
 (0)