I'm having a custom router in this form:
If I modify the payload object within this method (say, payload.setDate(new Date())), would that reflect in the actual Message that will be routed?Code:@Router public String route(Foo payload) {...}
I'm having a custom router in this form:
If I modify the payload object within this method (say, payload.setDate(new Date())), would that reflect in the actual Message that will be routed?Code:@Router public String route(Foo payload) {...}
Yes, but it would be cleaner to use an upstream @Transformer to modify the payload, rather than mixing concerns like this.
Routers should just route.
The @Transformer could be another method in the same class
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware