Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.

Commit 94c44a3

Browse files
garyrussellmarkpollack
authored andcommitted
XD-3232 Update Integration, Framework, AMQP, Batch
JIRA: https://jira.spring.io/browse/XD-3232 * Update versions * SI TCP serializers need to be flushed since 4.2 * Remove uses of deprecated APIs * Some modules were relying on a transitive dependency on slf4j which is no longer there * Work around for INT-3766 (reactor-code but not reactor-stream on CP) * Update to S-I-Kafka 1.2.1.RELEASE Fix evaluation context initialization.
1 parent ed52e17 commit 94c44a3

File tree

13 files changed

+170
-105
lines changed

13 files changed

+170
-105
lines changed

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ ext {
141141
splunkVersion = '1.3.0'
142142
springBatchAdminMgrVersion = '1.3.0.RELEASE'
143143
springIntegrationSplunkVersion = '1.1.0.RELEASE'
144-
springIntegrationKafkaVersion = '1.2.0.RELEASE'
144+
springIntegrationKafkaVersion = '1.2.1.RELEASE'
145145
kafkaVersion = '0.8.2.1'
146146
springShellVersion = '1.1.0.RELEASE'
147147
zookeeperVersion = '3.4.6'
@@ -409,6 +409,7 @@ project('spring-xd-rxjava') {
409409
compile "io.reactivex:rxjava"
410410
compile "org.springframework.integration:spring-integration-core"
411411
compile "org.springframework:spring-expression"
412+
compile "org.slf4j:slf4j-api"
412413
}
413414
}
414415

@@ -873,6 +874,7 @@ project('spring-xd-module') {
873874
compile "org.springframework.boot:spring-boot-autoconfigure"
874875
compile "org.springframework.boot:spring-boot-loader"
875876
compile "com.fasterxml.jackson.core:jackson-databind"
877+
compile "org.slf4j:slf4j-api"
876878
compile project(':spring-xd-module-spi')
877879
}
878880
}
@@ -980,6 +982,7 @@ project('spring-xd-codec') {
980982
compile "org.springframework:spring-core"
981983
compile "org.springframework.integration:spring-integration-core"
982984
compile "com.esotericsoftware:kryo-shaded"
985+
compile "org.slf4j:slf4j-api"
983986
}
984987
}
985988

@@ -1178,6 +1181,7 @@ project('spring-xd-shell') {
11781181
exclude group: 'org.apache.avro', module: 'avro-compiler'
11791182
}
11801183
testCompile project(":spring-xd-test")
1184+
testCompile "io.projectreactor:reactor-stream" // TODO: remove when INT-3766 is resolved
11811185
}
11821186

11831187
// skip the startScripts task to avoid default start script generation

dependencies.properties

Lines changed: 55 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -288,34 +288,33 @@ org.slf4j\:slf4j-api=1.7.11
288288
org.slf4j\:slf4j-jdk14=1.7.11
289289
org.slf4j\:slf4j-log4j12=1.7.11
290290
org.spockframework\:spock-core=0.7-groovy-2.0
291-
org.springframework\:spring-aop=4.1.6.RELEASE
292-
org.springframework\:spring-aspects=4.1.6.RELEASE
293-
org.springframework\:spring-beans=4.1.6.RELEASE
294-
org.springframework\:spring-context=4.1.6.RELEASE
295-
org.springframework\:spring-context-support=4.1.6.RELEASE
296-
org.springframework\:spring-core=4.1.6.RELEASE
297-
org.springframework\:spring-expression=4.1.6.RELEASE
298-
org.springframework\:spring-instrument=4.1.6.RELEASE
299-
org.springframework\:spring-instrument-tomcat=4.1.6.RELEASE
300-
org.springframework\:spring-jdbc=4.1.6.RELEASE
301-
org.springframework\:spring-jms=4.1.6.RELEASE
291+
org.springframework\:spring-aop=4.2.0.RC2
292+
org.springframework\:spring-aspects=4.2.0.RC2
293+
org.springframework\:spring-beans=4.2.0.RC2
294+
org.springframework\:spring-context=4.2.0.RC2
295+
org.springframework\:spring-context-support=4.2.0.RC2
296+
org.springframework\:spring-core=4.2.0.RC2
297+
org.springframework\:spring-expression=4.2.0.RC2
298+
org.springframework\:spring-instrument=4.2.0.RC2
299+
org.springframework\:spring-instrument-tomcat=4.2.0.RC2
300+
org.springframework\:spring-jdbc=4.2.0.RC2
301+
org.springframework\:spring-jms=4.2.0.RC2
302302
org.springframework\:springloaded=1.2.0.RELEASE
303-
org.springframework\:spring-messaging=4.1.6.RELEASE
304-
org.springframework\:spring-orm=4.1.6.RELEASE
305-
org.springframework\:spring-oxm=4.1.6.RELEASE
306-
org.springframework\:spring-test=4.1.6.RELEASE
307-
org.springframework\:spring-tx=4.1.6.RELEASE
308-
org.springframework\:spring-web=4.1.6.RELEASE
309-
org.springframework\:spring-webmvc=4.1.6.RELEASE
310-
org.springframework\:spring-webmvc-portlet=4.1.6.RELEASE
311-
org.springframework\:spring-websocket=4.1.6.RELEASE
312-
org.springframework.amqp\:spring-amqp=1.4.5.RELEASE
313-
org.springframework.amqp\:spring-erlang=1.4.5.RELEASE
314-
org.springframework.amqp\:spring-rabbit=1.4.5.RELEASE
315-
org.springframework.batch\:spring-batch-core=3.0.3.RELEASE
316-
org.springframework.batch\:spring-batch-infrastructure=3.0.3.RELEASE
317-
org.springframework.batch\:spring-batch-integration=3.0.3.RELEASE
318-
org.springframework.batch\:spring-batch-test=3.0.3.RELEASE
303+
org.springframework\:spring-messaging=4.2.0.RC2
304+
org.springframework\:spring-orm=4.2.0.RC2
305+
org.springframework\:spring-oxm=4.2.0.RC2
306+
org.springframework\:spring-test=4.2.0.RC2
307+
org.springframework\:spring-tx=4.2.0.RC2
308+
org.springframework\:spring-web=4.2.0.RC2
309+
org.springframework\:spring-webmvc=4.2.0.RC2
310+
org.springframework\:spring-webmvc-portlet=4.2.0.RC2
311+
org.springframework\:spring-websocket=4.2.0.RC2
312+
org.springframework.amqp\:spring-amqp=1.5.0.M1
313+
org.springframework.amqp\:spring-rabbit=1.5.0.M1
314+
org.springframework.batch\:spring-batch-core=3.0.4.RELEASE
315+
org.springframework.batch\:spring-batch-infrastructure=3.0.4.RELEASE
316+
org.springframework.batch\:spring-batch-integration=3.0.4.RELEASE
317+
org.springframework.batch\:spring-batch-test=3.0.4.RELEASE
319318
org.springframework.boot\:spring-boot=1.2.3.RELEASE
320319
org.springframework.boot\:spring-boot-actuator=1.2.3.RELEASE
321320
org.springframework.boot\:spring-boot-autoconfigure=1.2.3.RELEASE
@@ -389,35 +388,35 @@ org.springframework.data\:spring-yarn-core=2.2.0.RELEASE
389388
org.springframework.data\:spring-yarn-integration=2.2.0.RELEASE
390389
org.springframework.data\:spring-yarn-test=2.2.0.RELEASE
391390
org.springframework.hateoas\:spring-hateoas=0.16.0.RELEASE
392-
org.springframework.integration\:spring-integration-amqp=4.1.5.RELEASE
393-
org.springframework.integration\:spring-integration-core=4.1.5.RELEASE
394-
org.springframework.integration\:spring-integration-event=4.1.5.RELEASE
395-
org.springframework.integration\:spring-integration-feed=4.1.5.RELEASE
396-
org.springframework.integration\:spring-integration-file=4.1.5.RELEASE
397-
org.springframework.integration\:spring-integration-ftp=4.1.5.RELEASE
398-
org.springframework.integration\:spring-integration-gemfire=4.1.5.RELEASE
399-
org.springframework.integration\:spring-integration-groovy=4.1.5.RELEASE
400-
org.springframework.integration\:spring-integration-http=4.1.5.RELEASE
401-
org.springframework.integration\:spring-integration-ip=4.1.5.RELEASE
402-
org.springframework.integration\:spring-integration-jdbc=4.1.5.RELEASE
403-
org.springframework.integration\:spring-integration-jms=4.1.5.RELEASE
404-
org.springframework.integration\:spring-integration-jmx=4.1.5.RELEASE
405-
org.springframework.integration\:spring-integration-jpa=4.1.5.RELEASE
406-
org.springframework.integration\:spring-integration-mail=4.1.5.RELEASE
407-
org.springframework.integration\:spring-integration-mongodb=4.1.5.RELEASE
408-
org.springframework.integration\:spring-integration-mqtt=4.1.5.RELEASE
409-
org.springframework.integration\:spring-integration-redis=4.1.5.RELEASE
410-
org.springframework.integration\:spring-integration-rmi=4.1.5.RELEASE
411-
org.springframework.integration\:spring-integration-scripting=4.1.5.RELEASE
412-
org.springframework.integration\:spring-integration-security=4.1.5.RELEASE
413-
org.springframework.integration\:spring-integration-sftp=4.1.5.RELEASE
414-
org.springframework.integration\:spring-integration-stream=4.1.5.RELEASE
415-
org.springframework.integration\:spring-integration-syslog=4.1.5.RELEASE
416-
org.springframework.integration\:spring-integration-test=4.1.5.RELEASE
417-
org.springframework.integration\:spring-integration-twitter=4.1.5.RELEASE
418-
org.springframework.integration\:spring-integration-ws=4.1.5.RELEASE
419-
org.springframework.integration\:spring-integration-xml=4.1.5.RELEASE
420-
org.springframework.integration\:spring-integration-xmpp=4.1.5.RELEASE
391+
org.springframework.integration\:spring-integration-amqp=4.2.0.M2
392+
org.springframework.integration\:spring-integration-core=4.2.0.M2
393+
org.springframework.integration\:spring-integration-event=4.2.0.M2
394+
org.springframework.integration\:spring-integration-feed=4.2.0.M2
395+
org.springframework.integration\:spring-integration-file=4.2.0.M2
396+
org.springframework.integration\:spring-integration-ftp=4.2.0.M2
397+
org.springframework.integration\:spring-integration-gemfire=4.2.0.M2
398+
org.springframework.integration\:spring-integration-groovy=4.2.0.M2
399+
org.springframework.integration\:spring-integration-http=4.2.0.M2
400+
org.springframework.integration\:spring-integration-ip=4.2.0.M2
401+
org.springframework.integration\:spring-integration-jdbc=4.2.0.M2
402+
org.springframework.integration\:spring-integration-jms=4.2.0.M2
403+
org.springframework.integration\:spring-integration-jmx=4.2.0.M2
404+
org.springframework.integration\:spring-integration-jpa=4.2.0.M2
405+
org.springframework.integration\:spring-integration-mail=4.2.0.M2
406+
org.springframework.integration\:spring-integration-mongodb=4.2.0.M2
407+
org.springframework.integration\:spring-integration-mqtt=4.2.0.M2
408+
org.springframework.integration\:spring-integration-redis=4.2.0.M2
409+
org.springframework.integration\:spring-integration-rmi=4.2.0.M2
410+
org.springframework.integration\:spring-integration-scripting=4.2.0.M2
411+
org.springframework.integration\:spring-integration-security=4.2.0.M2
412+
org.springframework.integration\:spring-integration-sftp=4.2.0.M2
413+
org.springframework.integration\:spring-integration-stream=4.2.0.M2
414+
org.springframework.integration\:spring-integration-syslog=4.2.0.M2
415+
org.springframework.integration\:spring-integration-test=4.2.0.M2
416+
org.springframework.integration\:spring-integration-twitter=4.2.0.M2
417+
org.springframework.integration\:spring-integration-ws=4.2.0.M2
418+
org.springframework.integration\:spring-integration-xml=4.2.0.M2
419+
org.springframework.integration\:spring-integration-xmpp=4.2.0.M2
421420
org.springframework.ldap\:spring-ldap-core=2.0.2.RELEASE
422421
org.springframework.ldap\:spring-ldap-core-tiger=2.0.2.RELEASE
423422
org.springframework.ldap\:spring-ldap-ldif-batch=2.0.2.RELEASE

extensions/spring-xd-extension-process/src/main/java/org/springframework/xd/extension/process/ShellCommandProcessor.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public class ShellCommandProcessor implements Lifecycle, InitializingBean {
6868

6969
private final static Logger log = LoggerFactory.getLogger(ShellCommandProcessor.class);
7070

71-
private final ShellWordsParser shellWordsParser = new ShellWordsParser();
71+
private final ShellWordsParser shellWordsParser = new ShellWordsParser();
7272

7373
private TaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
7474

@@ -133,8 +133,8 @@ public synchronized String receive() {
133133
Assert.isTrue(isRunning(), "Shell process is not started.");
134134
String data;
135135
try {
136-
byte[] buffer = serializer.deserialize(stdout);
137-
data = new String(buffer, charset);
136+
byte[] buffer = this.serializer.deserialize(this.stdout);
137+
data = new String(buffer, this.charset);
138138
}
139139
catch (IOException e) {
140140
throw new RuntimeException(e.getMessage(), e);
@@ -150,7 +150,8 @@ public synchronized String receive() {
150150
public synchronized void send(String data) {
151151
Assert.isTrue(isRunning(), "Shell process is not started.");
152152
try {
153-
serializer.serialize(data.getBytes(charset), stdin);
153+
this.serializer.serialize(data.getBytes(this.charset), this.stdin);
154+
this.stdin.flush();
154155
}
155156
catch (IOException e) {
156157
log.error(e.getMessage(), e);

gradle/build-extensions.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ project('spring-xd-extension-http') {
2424
compile "org.springframework.integration:spring-integration-core"
2525
compile "io.netty:netty:${nettyVersion}"
2626
compile "org.springframework:spring-web"
27+
compile "org.slf4j:slf4j-api"
2728
compile project(":spring-xd-module-spi")
2829
testCompile project(":spring-xd-test")
2930
}
@@ -93,6 +94,7 @@ project('spring-xd-extension-batch') {
9394
compile "org.springframework.integration:spring-integration-file"
9495
runtime "org.springframework.integration:spring-integration-ftp"
9596
runtime "io.projectreactor:reactor-core"
97+
runtime "io.projectreactor:reactor-stream" // TODO: remove when INT-3766 is resolved
9698
provided "org.springframework.batch:spring-batch-core"
9799
provided "org.springframework.data:spring-data-hadoop-store:${springDataHadoopBase}"
98100
testCompile project(':spring-xd-test')
@@ -114,6 +116,7 @@ project('spring-xd-extension-process') {
114116
dependencies {
115117
compile project(':spring-xd-extension-encoder-support')
116118
compile "org.springframework.integration:spring-integration-ip"
119+
compile "org.slf4j:slf4j-api"
117120
testCompile project(':spring-xd-test')
118121
testRuntime (
119122
//"org.slf4j:jcl-over-slf4j",

spring-xd-analytics/src/main/java/org/springframework/xd/analytics/metrics/integration/AbstractMetricHandler.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616

1717
package org.springframework.xd.analytics.metrics.integration;
1818

19+
import org.springframework.beans.BeansException;
20+
import org.springframework.beans.factory.BeanFactory;
21+
import org.springframework.beans.factory.BeanFactoryAware;
22+
import org.springframework.beans.factory.InitializingBean;
1923
import org.springframework.expression.EvaluationContext;
2024
import org.springframework.expression.Expression;
2125
import org.springframework.expression.spel.standard.SpelExpressionParser;
2226
import org.springframework.expression.spel.support.StandardEvaluationContext;
23-
import org.springframework.integration.expression.IntegrationEvaluationContextAware;
27+
import org.springframework.integration.context.IntegrationContextUtils;
2428
import org.springframework.messaging.Message;
2529
import org.springframework.util.Assert;
2630

@@ -31,14 +35,18 @@
3135
*
3236
* @author Eric Bottard
3337
*/
34-
abstract class AbstractMetricHandler implements IntegrationEvaluationContextAware {
38+
abstract class AbstractMetricHandler implements BeanFactoryAware, InitializingBean {
3539

3640
protected final Expression nameExpression;
3741

3842
protected final SpelExpressionParser spelExpressionParser = new SpelExpressionParser();
3943

4044
protected EvaluationContext evaluationContext = new StandardEvaluationContext();
4145

46+
private boolean evalationContextSet;
47+
48+
private BeanFactory beanFactory;
49+
4250
protected AbstractMetricHandler(String nameExpression) {
4351
Assert.notNull(nameExpression, "Metric name expression can not be null");
4452
this.nameExpression = spelExpressionParser.parseExpression(nameExpression);
@@ -48,10 +56,22 @@ protected String computeMetricName(Message<?> message) {
4856
return nameExpression.getValue(evaluationContext, message, CharSequence.class).toString();
4957
}
5058

51-
@Override
5259
public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
5360
Assert.notNull(evaluationContext, "'evaluationContext' cannot be null");
5461
this.evaluationContext = evaluationContext;
62+
this.evalationContextSet = true;
63+
}
64+
65+
@Override
66+
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
67+
this.beanFactory = beanFactory;
68+
}
69+
70+
@Override
71+
public void afterPropertiesSet() throws Exception {
72+
if (!this.evalationContextSet) {
73+
this.evaluationContext = IntegrationContextUtils.getEvaluationContext(this.beanFactory);
74+
}
5575
}
5676

5777
}

spring-xd-dirt/src/main/java/org/springframework/xd/dirt/rest/RestConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,18 @@
5050
* @author Andrew Eisenberg
5151
* @author Scott Andrews
5252
* @author Gunnar Hillert
53+
* @author Gary Russell
5354
*/
5455
@Configuration
5556
@EnableHypermediaSupport(type = HAL)
5657
@EnableSpringDataWebSupport
57-
@ComponentScan(excludeFilters = @Filter(Configuration.class))
58+
@ComponentScan(excludeFilters = @Filter(Configuration.class) )
5859
public class RestConfiguration {
5960

6061
@Bean
6162
public WebContentInterceptor webContentInterceptor() {
6263
WebContentInterceptor webContentInterceptor = new WebContentInterceptor();
6364
webContentInterceptor.setCacheSeconds(0);
64-
webContentInterceptor.setUseCacheControlHeader(true);
65-
webContentInterceptor.setUseExpiresHeader(true);
6665
return webContentInterceptor;
6766
}
6867

spring-xd-dirt/src/main/resources/META-INF/spring-xd/batch/singlestep-partition-support.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
<property name="stepName" value="step1" />
4646
</bean>
4747

48+
<int:channel id="setHeaderReplyChannelChannel" />
49+
4850
<int:header-enricher input-channel="setHeaderReplyChannelChannel" output-channel="stepExecutionRequests.output">
4951
<int:header name="xdReplyChannel" expression="@replyChannelRegistry.channelToChannelName(headers.replyChannel)" />
5052
</int:header-enricher>

spring-xd-dirt/src/test/java/org/springframework/xd/dirt/integration/bus/rabbit/RabbitMessageBusTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ protected String getPubSubEndpointRouting(AbstractEndpoint endpoint) {
690690
@Override
691691
public Spy spyOn(final String queue) {
692692
final RabbitTemplate template = new RabbitTemplate(this.rabbitAvailableRule.getResource());
693-
template.setAfterReceivePostProcessor(new DelegatingDecompressingPostProcessor());
693+
template.setAfterReceivePostProcessors(new DelegatingDecompressingPostProcessor());
694694
return new Spy() {
695695

696696
@Override

spring-xd-dirt/src/test/java/org/springframework/xd/dirt/stream/RabbitSingleNodeStreamDeploymentIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import static org.hamcrest.Matchers.instanceOf;
1717
import static org.junit.Assert.assertEquals;
1818
import static org.junit.Assert.assertNotNull;
19-
import static org.springframework.test.util.MatcherAssertionErrors.assertThat;
19+
import static org.junit.Assert.assertThat;
2020

2121
import java.util.Collections;
2222
import java.util.List;

spring-xd-hadoop/src/main/java/org/springframework/xd/integration/hadoop/config/StoreWriterFactoryBean.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014 the original author or authors.
2+
* Copyright 2014-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
3434
import org.springframework.data.hadoop.store.strategy.rollover.RolloverStrategy;
3535
import org.springframework.expression.EvaluationContext;
3636
import org.springframework.expression.spel.support.StandardEvaluationContext;
37-
import org.springframework.integration.expression.IntegrationEvaluationContextAware;
37+
import org.springframework.integration.context.IntegrationContextUtils;
3838
import org.springframework.messaging.Message;
3939
import org.springframework.util.StringUtils;
4040
import org.springframework.xd.integration.hadoop.partition.MessagePartitionStrategy;
@@ -45,9 +45,10 @@
4545
* path expression is set.
4646
*
4747
* @author Janne Valkealahti
48+
* @author Gary Russell
4849
*/
4950
public class StoreWriterFactoryBean implements InitializingBean, DisposableBean, FactoryBean<DataStoreWriter<?>>,
50-
BeanFactoryAware, Lifecycle, IntegrationEvaluationContextAware {
51+
BeanFactoryAware, Lifecycle {
5152

5253
private volatile DataStoreWriter<?> storeWriter;
5354

@@ -106,9 +107,10 @@ public void destroy() throws Exception {
106107

107108
@Override
108109
public void afterPropertiesSet() throws Exception {
110+
if (this.evaluationContext == null) {
111+
this.evaluationContext = IntegrationContextUtils.getEvaluationContext(this.beanFactory);
112+
}
109113
if (StringUtils.hasText(partitionExpression)) {
110-
// we require that we were given StandardEvaluationContext
111-
// via IntegrationEvaluationContextAware
112114
if (!(evaluationContext instanceof StandardEvaluationContext)) {
113115
throw new RuntimeException("Expecting evaluationContext of type StandardEvaluationContext but was "
114116
+ evaluationContext);
@@ -180,7 +182,6 @@ public void stop() {
180182
}
181183
}
182184

183-
@Override
184185
public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
185186
// used with partition writer spel if set
186187
this.evaluationContext = evaluationContext;

0 commit comments

Comments
 (0)