diff --git a/src/itest/java/se/yolean/kafka/topic/client/service/TopicDeclarationsTopicCheckTest.java b/src/itest/java/se/yolean/kafka/topic/client/service/TopicDeclarationsTopicCheckTest.java new file mode 100644 index 0000000..e0a16da --- /dev/null +++ b/src/itest/java/se/yolean/kafka/topic/client/service/TopicDeclarationsTopicCheckTest.java @@ -0,0 +1,47 @@ +package se.yolean.kafka.topic.client.service; + +import static org.junit.Assert.*; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.google.inject.AbstractModule; +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.sun.javafx.scene.control.Properties; + +public class TopicDeclarationsTopicCheckTest { + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void test() throws Exception { + Injector injector = Guice.createInjector(new AbstractModule() { + @Override + protected void configure() { + bind(Properties.class).toInstance(new Properties()); + //bind(TopicDeclarationsTopicCheck.class); + } + }); + //TopicDeclarationsTopicCheck check = injector.getInstance(TopicDeclarationsTopicCheck.class); + //check.createOrVerifySchemaTopic(); + } + +} diff --git a/src/main/java/se/yolean/kafka/topic/client/service/AdminClientPropsProvider.java b/src/main/java/se/yolean/kafka/topic/client/service/AdminClientPropsProvider.java new file mode 100644 index 0000000..a2d7cc2 --- /dev/null +++ b/src/main/java/se/yolean/kafka/topic/client/service/AdminClientPropsProvider.java @@ -0,0 +1,36 @@ +package se.yolean.kafka.topic.client.service; + +import java.util.Properties; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Provider; + +public class AdminClientPropsProvider implements Provider { + + private String bootstrap; + private String acks; + + @Inject + public AdminClientPropsProvider(@Named("config:bootstrap") String bootstrap, + @Named("config:acks") String acks) { + this.bootstrap = bootstrap; + this.acks = acks; + } + + @Override + public Properties get() { + // https://kafka.apache.org/0110/javadoc/index.html?org/apache/kafka/clients/producer/KafkaProducer.html + Properties props = new Properties(); + props.put("bootstrap.servers", bootstrap); + props.put("acks", acks); + props.put("retries", 0); + props.put("batch.size", 16384); + props.put("linger.ms", 1); + props.put("buffer.memory", 33554432); + props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); + props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); + return props; + } + +} \ No newline at end of file diff --git a/src/main/java/se/yolean/kafka/topic/client/service/SchemaRegistryClient.java b/src/main/java/se/yolean/kafka/topic/client/service/SchemaRegistryClient.java new file mode 100644 index 0000000..30d567a --- /dev/null +++ b/src/main/java/se/yolean/kafka/topic/client/service/SchemaRegistryClient.java @@ -0,0 +1,5 @@ +package se.yolean.kafka.topic.client.service; + +public class SchemaRegistryClient { + +} diff --git a/src/main/java/se/yolean/kafka/topic/client/service/StoreInitializationException.java b/src/main/java/se/yolean/kafka/topic/client/service/StoreInitializationException.java new file mode 100644 index 0000000..6a8c862 --- /dev/null +++ b/src/main/java/se/yolean/kafka/topic/client/service/StoreInitializationException.java @@ -0,0 +1,29 @@ +package se.yolean.kafka.topic.client.service; + +public class StoreInitializationException extends Exception { + + public StoreInitializationException() { + // TODO Auto-generated constructor stub + } + + public StoreInitializationException(String arg0) { + super(arg0); + // TODO Auto-generated constructor stub + } + + public StoreInitializationException(Throwable arg0) { + super(arg0); + // TODO Auto-generated constructor stub + } + + public StoreInitializationException(String arg0, Throwable arg1) { + super(arg0, arg1); + // TODO Auto-generated constructor stub + } + + public StoreInitializationException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { + super(arg0, arg1, arg2, arg3); + // TODO Auto-generated constructor stub + } + +}