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;

View File

@@ -1,3 +1,16 @@
buildscript {
repositories {
maven { url 'http://repo.spring.io/libs-snapshot' }
maven { url "http://repo.spring.io/libs-milestone" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
plugins {
id "org.sonarqube" version "1.2"
}
description = 'Spring Integration Samples'
apply plugin: 'base'
@@ -12,16 +25,6 @@ ext {
linkScmDevConnection = 'scm:git:ssh://git@github.com:spring-projects/spring-integration-samples.git'
}
buildscript {
repositories {
maven { url 'http://repo.spring.io/libs-snapshot' }
maven { url "http://repo.spring.io/libs-milestone" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
allprojects {
group = 'org.springframework.integration.samples'
@@ -196,9 +199,9 @@ subprojects { subproject ->
slf4jVersion = '1.7.11'
springIntegrationVersion = '4.3.0.RC1'
springIntegrationDslVersion = '1.1.2.RELEASE'
springIntegrationKafkaVersion = '2.0.0.M1'
springIntegrationKafkaVersion = '2.0.0.RC1'
springIntegrationSplunkVersion = '1.1.0.RELEASE'
springKafkaVersion = '1.0.0.M2'
springKafkaVersion = '1.0.0.RC1'
springVersion = '4.3.0.RC2'
springSecurityVersion = '4.0.2.RELEASE'
springWebFlowVersion = '2.3.3.RELEASE'
@@ -609,6 +612,8 @@ project('kafka') {
exclude group: 'org.slf4j'
}
compile "log4j:log4j:$log4jVersion"
testCompile 'org.springframework.boot:spring-boot-starter-test'
}
@@ -663,6 +668,8 @@ project('si4demo') {
compile 'org.springframework.boot:spring-boot-starter-integration'
compile "org.springframework.integration:spring-integration-mail"
compile "org.springframework.integration:spring-integration-twitter"
compile "org.springframework.integration:spring-integration-http"
compile "org.springframework.integration:spring-integration-ip"
compile "org.springframework.integration:spring-integration-java-dsl:$springIntegrationDslVersion"
compile "javax.mail:javax.mail-api:$javaxMailVersion"
compile "com.sun.mail:javax.mail:$javaxMailVersion"
@@ -1337,10 +1344,8 @@ project('stomp-chat') {
}
}
apply plugin: 'sonar-runner'
sonarRunner {
sonarProperties {
sonarqube {
properties {
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
property "sonar.links.homepage", linkHomepage
property "sonar.links.ci", linkCi
@@ -1350,9 +1355,3 @@ sonarRunner {
property "sonar.java.coveragePlugin", "jacoco"
}
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '2.5'
distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}

View File

@@ -1,2 +1,3 @@
version=4.3.0.BUILD-SNAPSHOT
springBootVersion=1.4.0.M2
springBootVersion=1.4.0.M3
org.gradle.daemon=true

Binary file not shown.

View File

@@ -1,6 +1,6 @@
#Thu Jul 30 16:26:17 EDT 2015
#Mon Jun 06 20:23:31 EDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-2.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip

52
gradlew vendored
View File

@@ -6,12 +6,30 @@
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
@@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -90,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`

8
gradlew.bat vendored
View File

@@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -46,7 +46,7 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args