spring集成中release-strategy-expression的语法

时间:2014-05-13 08:56:03

标签: spring integration spring-el

以下是预期内容的代码段:

<int:resequencer input-channel="resequencerChannel" output-channel="headerRoutingChannel"
       send-timeout="10000" release-strategy-expression="size() eq (T(java.lang.Runtime).getRuntime().availableProcessors() * 3)"/>

但语法似乎不正确。我想知道release-strategy-expression的实际语法。 提前谢谢。

Stack Trace:
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1005E:(pos 8): Type cannot be found 'org.springframework.util.Assert'
    at org.springframework.expression.spel.support.StandardTypeLocator.findType(StandardTypeLocator.java:115)
    at org.springframework.expression.spel.ExpressionState.findType(ExpressionState.java:138)
    at org.springframework.expression.spel.ast.TypeReference.getValueInternal(TypeReference.java:58)
    at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:48)
    at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:84)
    at org.springframework.expression.spel.ast.Ternary.getValueInternal(Ternary.java:57)
    at org.springframework.expression.spel.ast.MethodReference.getArguments(MethodReference.java:147)
    at org.springframework.expression.spel.ast.MethodReference.getValueRef(MethodReference.java:66)
    at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:63)
    at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:84)
    at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:114)
    at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:111)
    at org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:144)
    at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:268)
    at org.springframework.integration.util.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:142)
    at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:73)

1 个答案:

答案 0 :(得分:0)

如果您尝试在组大小达到可用处理器的3倍时发布...

size() eq ...