Some upgrades

* Gradle-2.13
* Spring Kafka 1.0.0.RC1
* Spring Integration Kafka 2.0.0.RC1
* Spring Boot 1.4.0.M3
* Provide required fixes
This commit is contained in:
Artem Bilan
2016-06-06 21:12:55 -04:00
parent b6f872664d
commit 1cbcbe7810
9 changed files with 62 additions and 59 deletions

View File

@@ -23,7 +23,6 @@ import java.util.Properties;
import org.I0Itec.zkclient.ZkClient;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer;
@@ -44,6 +43,8 @@ import org.springframework.kafka.core.DefaultKafkaProducerFactory;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.core.ProducerFactory;
import org.springframework.kafka.listener.KafkaMessageListenerContainer;
import org.springframework.kafka.listener.config.ContainerProperties;
import org.springframework.kafka.support.TopicPartitionInitialOffset;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessageHandler;
@@ -123,7 +124,8 @@ public class Application {
@Bean
public KafkaMessageListenerContainer<String, String> container() throws Exception {
return new KafkaMessageListenerContainer<>(consumerFactory(), new TopicPartition(this.topic, 0));
return new KafkaMessageListenerContainer<>(consumerFactory(),
new ContainerProperties(new TopicPartitionInitialOffset(this.topic, 0)));
}
@Bean

View File

@@ -135,7 +135,8 @@ public class Application {
@ServiceActivator(inputChannel = "sendTimeChannel")
public MessageHandler loggingChannelAdapter() {
LoggingHandler loggingHandler = new LoggingHandler("info");
loggingHandler.setExpression("'The time ' + payload + ' has been sent to the WebSocketSession ' + headers.simpSessionId");
loggingHandler.setLogExpressionString(
"'The time ' + payload + ' has been sent to the WebSocketSession ' + headers.simpSessionId");
return loggingHandler;
}

View File

@@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.context.web.LocalServerPort;
import org.springframework.boot.context.embedded.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;