import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.kafka.annotation.EnableKafka;
+import org.springframework.kafka.core.KafkaTemplate;
@SpringBootApplication
+@EnableConfigurationProperties({ KafkaProperties.class, ApplicationProperties.class })
+@EnableKafka
public class Application
{
+ @Bean
+ public RestGateway restGateway(
+ ApplicationProperties applicationProperties,
+ KafkaProperties kafkaProperties,
+ KafkaTemplate<String, Integer> kafkaTemplate)
+ {
+ return
+ new RestGateway(
+ kafkaProperties.getClientId(),
+ applicationProperties.getTopic(),
+ applicationProperties.getPartition(),
+ kafkaTemplate);
+ }
+
+
public static void main(String[] args)
{
SpringApplication.run(Application.class, args);
+++ /dev/null
-package de.juplo.kafka;
-
-import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.kafka.annotation.EnableKafka;
-import org.springframework.kafka.core.KafkaTemplate;
-
-
-@Configuration
-@EnableConfigurationProperties({ KafkaProperties.class, ApplicationProperties.class })
-@EnableKafka
-public class ApplicationConfiguration
-{
- @Bean
- public RestGateway restGateway(
- ApplicationProperties applicationProperties,
- KafkaProperties kafkaProperties,
- KafkaTemplate<String, Integer> kafkaTemplate)
- {
- return
- new RestGateway(
- kafkaProperties.getClientId(),
- applicationProperties.getTopic(),
- applicationProperties.getPartition(),
- kafkaTemplate);
- }
-}