Results 1 to 2 of 2

Thread: Payload modification within a router

  1. #1
    Join Date
    Apr 2012
    Posts
    18

    Default Payload modification within a router

    I'm having a custom router in this form:

    Code:
    @Router
    public String route(Foo payload) {...}
    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?

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,142

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •