Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-1970

Add an example of implementing a router with SpEL and mapping in the Reference Manual

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.5
    • Component/s: Documentation
    • Labels:
      None

      Description

      The Reference Manual Routers and the Spring Expression Language (SpEL) section includes an example,
      <int:router input-channel="inChannel" expression="payload + 'Channel'"/> in which the expression is resolved directly to a channel. We should add an example using child mapping elements. This seems more flexible and intuitive. For example, a common scenario is that multiple values may map to the same channel. e.g.
      <int:router input-channel="inChannel" expression="payload.paymentType">
      <int:mapping value="CASH" channel="cashPaymentChannel" />
      <int:mapping value="DEBIT" channel="creditPaymentChannel"/>
      <int:mapping value="CREDIT" channel="creditPaymentChannel"/>
      </int:router>

        Attachments

          Activity

            People

            • Assignee:
              dturanski David Turanski
              Reporter:
              dturanski David Turanski
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified