-
1. Re: SwitchYard does support database polling?
splatch Jan 8, 2013 9:31 AM (in response to leandropantoja)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 Jan 8, 2013 9:42 AM (in response to splatch)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 Jul 26, 2013 4:39 PM (in response to kcbabo)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:
-
4. Re: SwitchYard does support database polling?
synclpz Jul 27, 2013 4:36 AM (in response to moraleslos)DataSource field should be pointing to JNDI name of DS configured on JBoss AS
-
5. Re: SwitchYard does support database polling?
moraleslos Jul 29, 2013 1:38 AM (in response to synclpz)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 Jul 29, 2013 2:58 AM (in response to moraleslos)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.