3

I am new to the Spring integration. Previously I developed an application using Weblogic Integration where I poll a database table for any new rows. If there is one, I obtain that data, modify it and send it to a different database. I have seen several examples on Spring integration where it integrates web pages, emails etc. I want to set up a poll for a table and get the message to the gateway from where I can handle it. Any help or advice is appreciated.

2 Answers 2

1

This example is the basic Db poller..

<int-jdbc:inbound-channel-adapter query="select * from item where status=2"
    channel="target" data-source="dataSource"
    update="update item set status=10 where id in (:id)" />

For channel 'target', you can put your service-activator to handle message.. You may also need a row-mapper..

Tell me more about your problem if you need more advice.,

Sign up to request clarification or add additional context in comments.

1 Comment

does poller work on single thread .eg. if it found some data and handed over the data to channel , if data is still processed will poller find new data and send data to same channel ?
0

See the inbound-channel-adapter in the reference documentation and/or the jdbc sample.

The sample doesn't show the use of the adapter, but it might help you with a general understanding of Spring Integration. Another useful resource is the test cases... integration tests and polling* parser tests.

3 Comments

Thanks for your help. Here is a brief description of my scenario. I need set up a listener to a table for any new inserts. As soon as there is one, I need to get that data, modify it and send it to another database table. Is that possible?
Yes; but the accuracy of "as soon" will depend on the frequency of the poller - DBAs generally don't like you polling their DBs at high frequency.
Got it. Will try to configure 10 seconds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.