Hamid
Hamid

Reputation: 153

Expression in service activator doesn't execute (Spring Integration)

I debug my app and the expression doesn't execute.

<bean id="remover" class="org.example.Remover"/>
<bean id="key" class="java.lang.String">
    <constructor-arg value="KEY"/>
</bean>
<integration:service-activator input-channel="middleChannel"  
expression="@remover.remove(key)"/>

No Exception. method doesn't call.

Upvotes: 0

Views: 251

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121552

That’s not true: there must be an exception. You don’t show the whole flow to determine the part who swallows your exception on the matter.

Your expression is like:

@remover.remove(key)

You correctly call remover bean, but there is no such a property like key in the Message object - just only headers and payload. That’s why I’m making a conclusion that you have problems.

You can turn on debug logs for the Spring Integration category and follow you the trace of the call.

Upvotes: 1

Related Questions