INT-4138: MQTT: Outbound Adapter Improvements

JIRA:https://jira.spring.io/browse/INT-4138

Expressions for topic, qos, retained.

Also change inbound mapping to `RECEIVED_...` headers.

Fix some minor asciidoc problems in (s)ftp.

Rework Qos/Retained Expressions/Defaults

Encapsulate the logic entirely in the converter.

Polishing - PR Comments
This commit is contained in:
Gary Russell
2016-11-14 16:04:17 -05:00
committed by Artem Bilan
parent d42357ba02
commit 3035bc716d
17 changed files with 471 additions and 127 deletions

View File

@@ -27,6 +27,7 @@ import org.springframework.util.Assert;
*
* @author Mark Fisher
* @author Artem Bilan
* @author Gary Russell
* @since 2.0
*/
public class ExpressionEvaluatingMessageProcessor<T> extends AbstractMessageProcessor<T> {
@@ -61,6 +62,38 @@ public class ExpressionEvaluatingMessageProcessor<T> extends AbstractMessageProc
}
}
/**
* Create an {@link ExpressionEvaluatingMessageProcessor} for the given expression.
* @param expression a SpEL expression to evaluate.
* @since 5.0
*/
public ExpressionEvaluatingMessageProcessor(String expression) {
try {
this.expression = EXPRESSION_PARSER.parseExpression(expression);
this.expectedType = null;
}
catch (ParseException e) {
throw new IllegalArgumentException("Failed to parse expression.", e);
}
}
/**
* Construct {@link ExpressionEvaluatingMessageProcessor} for the provided
* SpEL expression and expected result type.
* @param expression a SpEL expression to evaluate.
* @param expectedType the expected result type.
* @since 5.0
*/
public ExpressionEvaluatingMessageProcessor(String expression, Class<T> expectedType) {
try {
this.expression = EXPRESSION_PARSER.parseExpression(expression);
this.expectedType = expectedType;
}
catch (ParseException e) {
throw new IllegalArgumentException("Failed to parse expression.", e);
}
}
/**
* Processes the Message by evaluating the expression with that Message as the
* root object. The expression evaluation result Object will be returned.