Announcement Announcement Module
Collapse
No announcement yet.
SpelSource Understanding Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpelSource Understanding

    Hey there,

    Can anyone help in understanding the SpelSource in the below code.?

    <int-jdbc:outbound-channel-adapter
    channel="com.hcl.jms.inbound" data-source="dataSource"
    query="${int.jdbc.outbound.query}" sql-parameter-source-factory="spelSource" />

    <bean id="spelSource"
    class="org.springframework.integration.jdbc.Expres sionEvaluatingSqlParameterSourceFactory">
    <property name="parameterExpressions">
    <map>
    <entry key="payload" value="new String(payload)" />
    </map>
    </property>
    </bean>

  • #2
    What do you need to understand?

    This makes a variable (payload) available in the query where the value is 'new String(payload)'.

    Such as when the query is SELECT * from FOO where someColumn=ayload

    Comment


    • #3
      Thanks Gary for your time. Do we have any tutorial for spelsource with spring integration

      Regards
      Ravindar Nidigonda

      Comment


      • #4
        Hi, Ravindar!

        Do we have any tutorial for spelsource with spring integration
        Here: http://static.springsource.org/sprin...hannel-adapter
        But you should understand, that spelSource in your sample (and in the doc) is just a bean name.
        Or what do you mean?

        Cheers,
        Artem

        Comment


        • #5
          The Spring Reference Manual explains all about SpEL (Spring Expression Language).

          The ExpressionEvaluatingSqlParameterSourceFactory is a mechanism to dynamically produce parameter values for your SQL where each SpEL expression is evaluated at runtime to provide the value. The #root object is the Message<?>, which means there are two properties 'payload' and 'headers'. If your payload is a JavaBean, you can use 'payload.foo' etc (calls payload.getFoo()).

          There are some examples in the Spring Integration Reference Manual Section about the JDBC Outbound Adapter.

          If you still have difficulties understanding, please ask a specific question here.

          Comment

          Working...
          X