Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
solsson committed Nov 28, 2017
1 parent bf60ed3 commit b467f5a
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
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();
}

}
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;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package se.yolean.kafka.topic.client.service;

public class SchemaRegistryClient {

}
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
}

}

0 comments on commit b467f5a

Please sign in to comment.