6 Replies Latest reply on Jul 29, 2013 2:58 AM by synclpz

    SwitchYard does support database polling?

    leandropantoja

      Hi,

       

      I would like to know if SwitchYard ( or Jboss ESB) supports SQL executions by time time frequency. For example:

       

      Every 5 mintunes, execute "select * from table where status = 0".

       

      I another SOA platforms, it is called database polling.

       

       

      Thanks.

       

      Leandro.

        • 1. Re: SwitchYard does support database polling?
          splatch

          Hey Leandro,

          We don't support database polling yet. Support for this kind of operations will be part of 0.8 release. I did some steps before christmas and it should be available after porting in SNAPSHOT builds this or next week.

          If you stuck with earlier versions you may use quartz/timer binding combined with sql binding to achieve database polling.

           

          Best regards,

          Lukasz

          • 2. Re: SwitchYard does support database polling?
            kcbabo

            It's not pure SQL, but you could use the JPA gateway in 0.7 to poll a database.  If you need SQL, then you'll be good to go once Lukasz implements the feature in 0.8.

            • 3. Re: SwitchYard does support database polling?
              moraleslos

              Running into a scenario where I will need to poll a database.  I've added the SQL binding but am not sure how to fill that out appropriately.  First questions is, where do you define the JDBC driver?  Or is the Data Source field a Java class that does the connection and everything else?  Not sure what I need to do with this:

               

              sql screen.png

              • 4. Re: SwitchYard does support database polling?
                synclpz

                DataSource field should be pointing to JNDI name of DS configured on JBoss AS

                • 5. Re: SwitchYard does support database polling?
                  moraleslos

                  I've configured JBoss EAP 6.1 appropriately (I think) and am now running into this issue:

                   

                  Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in the registry for: java:jboss/datasources/testDS of type: javax.sql.DataSource

                   

                  Below is my switchyard config:

                   

                      <sca:component name="PollSqlService">

                        <bean:implementation.bean class="com.example.switchyard.switchyard_example.PollSqlServiceBean"/>

                        <sca:service name="PollSqlService">

                          <sca:interface.java interface="com.example.switchyard.switchyard_example.PollSqlService"/>

                        </sca:service>

                      </sca:component>

                      <sca:service name="PollSqlService" promote="PollSqlService/PollSqlService">

                        <sca:interface.java interface="com.example.switchyard.switchyard_example.PollSqlService"/>

                        <sql:binding.sql period="60">

                          <operationSelector operationName="consume"/>

                          <sql:contextMapper/>

                          <sql:query>select * from dbo.ITEM</sql:query>

                          <sql:dataSourceRef>java:jboss/datasources/testDS</sql:dataSourceRef>

                        </sql:binding.sql>

                      </sca:service>

                    </sca:composite>

                   

                  In EAP I added that datasource to my standalone.xml file, along with the appropriate driver in that same xml as well as in the module.

                   

                  Any ideas?

                  • 6. Re: SwitchYard does support database polling?
                    synclpz

                    You can check if DS is bound right, just look for this line in server.log:

                     

                    13:57:52,581 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

                     

                    Anyway, ExampleDS is bundled with EAP6.1, you can just try to use it, before setting up your one.

                     

                    You SY config seems to be ok.