I am writing some business flow using WSO2 Process Server. I want to start a process when there is any new entry in a specific table. i.e. we do DB Polling in oracle process.
So whenever there is a new entry in table, i need to fetch those data and start processing on those data using BPEL.
The above explained scenario can be achieved using task component of WSO2 ESB. Using task component we can schedule the call to a proxy service after certain interval and we can use that proxy to fetch the data from database.
Related
I have an application that needs to update the UI with the results of an Amplify Datastore query. I am making the query as soon as the component mounts/renders, but the results of the query are empty even though I know there is available data. If I add a timeout of 1 second or greater before making the query, then the query returns the expected data. My hunch is that this is because the query is returning an empty set of data before the response from the delta sync table, which shows there is data to be fetched, is returned.
Is there any type of event provided by Datastore that would allow me to wait until the data store is initialized or has data to query before making the query?
I understand that I could use the .observe functionality of datastore for a similar effect, but this is currently not an option.
First, if you do not use the Datastore start method then sync from the backend starts when the first query is submitted. Queries are run against the local store so data won't be there yet.
Second, Datastore publishes events on the amplify hub so that you can monitor changes, such as a set of data being synced, Datastore being ready and even Datastore being ready and all data synced locally.
See the documentation on Datastore.start
and the documentation for Datastore events for more information.
I would like to make a database polling in wso2 mediator, but it seems there is no mediator ready to do that.
My problem is that I have tried to make a listener task with a dblookup but I have combined more than 10 mediators and it seems that it is not the best way.
What I need to do is: listen to a field in the databse, when the field is changed, I will fire an external webservice.
Should I create a custom mediator for polling or are there ready mediators?
wso2 docs are not enough to complete my scenario.
I guess you'll need your 10 mediators. My approach would be like this
1.) store the actual value of the field in a database (e.g. internal H2 database) using dbreport mediator (https://docs.wso2.com/display/ESB481/DB+Report+Mediator)
2.) create a scheduled task that triggers your proxy
3.) create a proxy that retrieves the value from the database where you stored the last value, use dblookup mediator (https://docs.wso2.com/display/ESB481/DBLookup+Mediator) to retrieve the actual value from your database. If the values are different do something using filter mediator and update the value in your local db (https://docs.wso2.com/display/ESB481/Filter+Mediator)
My approach depends on how fast the value in the db changes. If there's a high frequency I assume this will not work properly.
Have you tried using DB listener inbound with WSO2 ESB? This solves your problem.
[1] https://store.wso2.com/store/assets/esbconnector/details/da8c396a-281e-493b-87bc-b55a4cebe92d
Best Regards,
Malaka
I am trying to run a stored procedure in WSO2 CEP with SQL Server 2016. Is this possible? I already looked through the documentation on this which is scarce. there is only one sample with connection to SQL Server.
Although, it looks like it is limited to selects, inserts and deletes.
I was not able to find any documentation on other driver functionality through CEP.
Also, I did find some information on other WSO2 Services, not wso2 CEP, which might allow me to run the stored procedures. If you have any information on that and who to plug CEP with those services It would help as well.
WSO2CEP is a real time analytics product which provides few SQL operations with RDBMS publisher to publish events as mentioned in the documentation [1].
Only work around would be modifying existing query defined output-event-adapters.xml file located in <CEP-Location>/repository/conf direcory. Inside the file locate <adapterConfig type="rdbms"> element and you will find properties of SQL operations such as update into like below.
<property key="updateTableRow">UPDATE $TABLE_NAME SET $COLUMN_VALUES WHERE $CONDITION</property>
You can change above like below to execute stored procedure
<property key="updateTableRow">EXEC $TABLE_NAME $COLUMN_VALUES</property>
Then in RDBMS publisher you need to change execution.mode as update.
[1] https://docs.wso2.com/display/CEP400/RDBMS+Event+Publisher
I have the following simple setup in Azure ML.
Basically the Reader is a SQL query to a DB which returns a vector called Pdelta, which is then passed to the R script for further processing and the results are then returned back to the web service. The DB query is simple (SELECT Pdelta FROM ...) and it works fine. I have set the DB query as a web service paramater as well.
Everything seems to work fine, but at the end when i publish it as a web service and test it, it somehow asks for an additional input parameter. The additional parameter gets called PDELTA.
I am wondering why is this happening, what is it that I am overlooking? I would like to make this web service ask for only one parameter - the SQL query (Delta Query) which would then deliver the Pdeltas.
Any ideas or suggestions would be grealty appreciated!
You can remove the web service input block and publish the web service without it. That way the Pdelta input will be passed in only from the Reader module.
I am working on the this Scheduled database polling with WSO2 Data Services Server blog on linux Ubuntu with WSO2 DSS 3.0.1 and ESB 4.7.
0
While i am inserting the values into student_registration table,
Nothing displaying in WSO2 ESB terminal side and WSO2 DSS terminal side.
Scheduling in not working, some one please help me to solve this.
Please share your DB content, you need to have an intial timestamp set in the timestamp table
If you inserted any baseline timestamp record into "timestamp table" ?
Ex.
insert into imestamp_table(ID, timestamp) values (1, SYSDATE());