Announcement Announcement Module
Collapse
No announcement yet.
Interceptor Alternative / SpEL usage Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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?

    Comment


    • #3
      Worked just fine. Thank you!

      Comment


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

        Comment


        • #5
          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.

          Comment


          • #6
            Ha. Thanks for attending!

            Comment

            Working...
            X