Class RabbitExpressionEvaluatingInterceptor
java.lang.Object
org.springframework.cloud.stream.binder.rabbit.RabbitExpressionEvaluatingInterceptor
- All Implemented Interfaces:
org.springframework.messaging.support.ChannelInterceptor
public class RabbitExpressionEvaluatingInterceptor
extends Object
implements org.springframework.messaging.support.ChannelInterceptor
Interceptor to evaluate expressions for outbound messages before serialization.
- Since:
- 2.0
- Author:
- Gary Russell, Oleg Zhurakousky
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRabbitExpressionEvaluatingInterceptor(org.springframework.expression.Expression routingKeyExpression, org.springframework.expression.Expression delayExpression, org.springframework.expression.EvaluationContext evaluationContext) Construct an instance with the provided expressions and evaluation context. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.messaging.Message<?>preSend(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.messaging.support.ChannelInterceptor
afterReceiveCompletion, afterSendCompletion, postReceive, postSend, preReceive
-
Field Details
-
PARSER
public static final org.springframework.expression.ExpressionParser PARSERInstance of ExpressionParser. -
ROUTING_KEY_HEADER
Default name for routing key header.- See Also:
-
DELAY_HEADER
Default name for delay header.- See Also:
-
-
Constructor Details
-
RabbitExpressionEvaluatingInterceptor
public RabbitExpressionEvaluatingInterceptor(org.springframework.expression.Expression routingKeyExpression, org.springframework.expression.Expression delayExpression, org.springframework.expression.EvaluationContext evaluationContext) Construct an instance with the provided expressions and evaluation context. At least one expression muse be non-null.- Parameters:
routingKeyExpression- the routing key expresssion.delayExpression- the delay expression.evaluationContext- the evaluation context.
-
-
Method Details
-
preSend
public org.springframework.messaging.Message<?> preSend(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel) - Specified by:
preSendin interfaceorg.springframework.messaging.support.ChannelInterceptor
-