Results 1 to 6 of 6

Thread: Interceptor Alternative / SpEL usage

  1. #1
    Join Date
    Sep 2006
    Posts
    100

    Default Interceptor Alternative / SpEL usage

    I was using interceptor (SI 1.0.4) to retrieve id from headers and set it as object ID in my application's processing. Using SI 2.0, I am looking to explore SpEL expression for this purpose instead of writing an interceptor. Is this doable? Is there any other alternative?

    Thanks in advance.

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Sure, you can use an annotation on your method parameter:
    Code:
    public void process(Foo payload, @Headers("bar") String s) {...}
    Or... you can just use SpEL within the configuration:
    Code:
    <service-activator input-channel="in" expression="@myProcessor.process(payload, headers.bar)"/>
    Does either work for your case?

  3. #3
    Join Date
    Sep 2006
    Posts
    100

    Default

    Worked just fine. Thank you!

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Cool. Out of curiosity, which of the 2 techniques did you choose?

  5. #5
    Join Date
    Sep 2006
    Posts
    100

    Default

    I chose annotation over SpEL just simply because I am already already in the code transforming object. That seemed simple, straight forward and no extra steps.

    Thank you!

    PS: Great presentation on MDA. Thank you, one more time.

  6. #6
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Ha. Thanks for attending!

Posting Permissions

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