-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
src/itest/java/se/yolean/kafka/topic/client/service/TopicDeclarationsTopicCheckTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/se/yolean/kafka/topic/client/service/AdminClientPropsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Properties> { | ||
|
||
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; | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/se/yolean/kafka/topic/client/service/SchemaRegistryClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package se.yolean.kafka.topic.client.service; | ||
|
||
public class SchemaRegistryClient { | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/se/yolean/kafka/topic/client/service/StoreInitializationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
|
||
} |