Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5143

Unable to pass object array dynamically to camel-sql component select query

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • jboss-fuse-6.3
    • jboss-fuse-6.2.1
    • Camel
    • % %
    • 6.3 Sprint 4 (Mar 28 - Apr 29)

      camel-sql component sql select query is not working when we pass object array dynamically:

      Please find below class which populates value in map

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      public class NewTopicBean {

      Integer topics[] =

      {1,2,3}

      ;

      public Map<String, Object[]> generateNewTopic()

      { Map<String, Object[]> answer = new HashMap<String, Object[]>(); answer.put("TopicId", topics); return answer; }

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      Please find blueprint configuration:

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      <bean id="topicBean" class="com.route1.NewTopicBean" />

      <route id="routeMysql1">
      <from uri="direct:selectMysql1" />

      <transform>
      <method ref="topicBean" method="generateNewTopic" />
      </transform>

      <to
      uri="sql:select * from FLIGHTS where number in (:#TopicId)?dataSource=mysql1XADataSource&allowNamedParameters=true" />
      <log message="Got ${body}"/>
      <to uri="mock:routeMysql1"/>
      </route>
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            acosenti Andrea Cosentino
            rhn-support-kkakarla kodandaRamu kakarla
            Tomas Turek Tomas Turek
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: