Skip to content

Commit 5c136e4

Browse files
committed
Cassandra: Compatibility with IO-2.0
1 parent 8f45e1c commit 5c136e4

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

spring-integration-cassandra/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (project.hasProperty('platformVersion')) {
2727
apply plugin: 'spring-io'
2828

2929
dependencies {
30-
springIoVersions "io.spring.platform:platform-versions:${platformVersion}@properties"
30+
springIoVersions "io.spring.platform:platform-bom:${platformVersion}@properties"
3131
}
3232
}
3333

spring-integration-cassandra/src/main/java/org/springframework/integration/cassandra/outbound/CassandraMessageHandler.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.springframework.expression.TypeLocator;
3131
import org.springframework.expression.spel.support.StandardEvaluationContext;
3232
import org.springframework.expression.spel.support.StandardTypeLocator;
33+
import org.springframework.integration.expression.ExpressionUtils;
3334
import org.springframework.integration.expression.IntegrationEvaluationContextAware;
3435
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
3536
import org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor;
@@ -47,8 +48,7 @@
4748
* @author Artem Bilan
4849
*/
4950
@SuppressWarnings("unchecked")
50-
public class CassandraMessageHandler<T> extends AbstractReplyProducingMessageHandler
51-
implements IntegrationEvaluationContextAware {
51+
public class CassandraMessageHandler<T> extends AbstractReplyProducingMessageHandler {
5252

5353
private final Map<String, Expression> parameterExpressions = new HashMap<>();
5454

@@ -153,21 +153,22 @@ public void setStatementProcessor(MessageProcessor<Statement> statementProcessor
153153
}
154154

155155
@Override
156-
public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
157-
TypeLocator typeLocator = evaluationContext.getTypeLocator();
156+
public String getComponentType() {
157+
return "cassandra:outbound-" + (this.producesReply ? "gateway" : "channel-adapter");
158+
}
159+
160+
@Override
161+
protected void doInit() {
162+
super.doInit();
163+
164+
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
165+
TypeLocator typeLocator = this.evaluationContext.getTypeLocator();
158166
if (typeLocator instanceof StandardTypeLocator) {
159167
/*
160168
* Register the Cassandra Query DSL package so they don't need a FQCN for QueryBuilder, for example.
161169
*/
162170
((StandardTypeLocator) typeLocator).registerImport("com.datastax.driver.core.querybuilder");
163171
}
164-
this.evaluationContext = evaluationContext;
165-
}
166-
167-
168-
@Override
169-
public String getComponentType() {
170-
return "cassandra:outbound-" + (this.producesReply ? "gateway" : "channel-adapter");
171172
}
172173

173174
@Override

0 commit comments

Comments
 (0)