projects
/
demos
/
kafka
/
demos-kafka-payment-system-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
WIP
[demos/kafka/demos-kafka-payment-system-setup]
/
transfer
/
src
/
main
/
java
/
de
/
juplo
/
kafka
/
payment
/
transfer
/
TransferServiceApplication.java
diff --git
a/transfer/src/main/java/de/juplo/kafka/payment/transfer/TransferServiceApplication.java
b/transfer/src/main/java/de/juplo/kafka/payment/transfer/TransferServiceApplication.java
index
49e57a3
..
320b841
100644
(file)
--- a/
transfer/src/main/java/de/juplo/kafka/payment/transfer/TransferServiceApplication.java
+++ b/
transfer/src/main/java/de/juplo/kafka/payment/transfer/TransferServiceApplication.java
@@
-2,12
+2,12
@@
package de.juplo.kafka.payment.transfer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
-import de.juplo.kafka.payment.transfer.impl.TransferServiceImpl;
+import de.juplo.kafka.payment.transfer.domain.TransferRepository;
+import de.juplo.kafka.payment.transfer.domain.TransferService;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.serialization.StringSerializer;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.serialization.StringSerializer;
-import org.apache.kafka.common.serialization.UUIDSerializer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@
-23,23
+23,24
@@
import java.util.UUID;
public class TransferServiceApplication
{
@Bean(destroyMethod = "close")
public class TransferServiceApplication
{
@Bean(destroyMethod = "close")
- KafkaProducer<
UUID
, String> producer(TransferServiceProperties properties)
+ KafkaProducer<
String
, String> producer(TransferServiceProperties properties)
{
Properties props = new Properties();
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, properties.bootstrapServers);
{
Properties props = new Properties();
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, properties.bootstrapServers);
- props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,
UUID
Serializer.class);
+ props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,
String
Serializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
return new KafkaProducer<>(props);
}
@Bean
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
return new KafkaProducer<>(props);
}
@Bean
- TransferServiceImpl transferService(
- KafkaProducer<UUID, String> producer,
+ TransferService transferService(
+ TransferRepository repository,
+ KafkaProducer<String, String> producer,
ObjectMapper mapper,
TransferServiceProperties properties)
{
ObjectMapper mapper,
TransferServiceProperties properties)
{
- return new TransferService
Impl(
producer, mapper, properties.topic);
+ return new TransferService
(repository,
producer, mapper, properties.topic);
}
}