Skip to content
Weik.ioUniversity
Try Weik.io

Polling and change detection

Patterns 1 · 3:46

The ERP reports no changes, so every poll fetches all customers, and the video shows how to find out which of them changed. Weik.io's entity store lets only the new and changed ones reach the CRM. The video assumes you know the Camel track.

Download the mp4Recorded on 2026.2

What it covers

  • Two route files in one folder, a timed poll and a send route
  • The send route, which waits on the store for records created or updated
  • The entity type customer, created with weikio entitystore policy set, and one entity per customer
  • A first poll that creates twenty customers and a second that sends nothing
  • One changed phone number reaching the CRM as one update
  • Reading revisions back with the weikio CLI and on the admin UI's Entity store page

Commands in this video

Terminal
$ weikio entitystore policy set sandbox/customer --env devtest
$ weikio run ./customer-sync
$ weikio entities list sandbox/customer
$ weikio entities get sandbox/customer C-1007 --revisions
Transcript
  1. 0:01A source system that reports no changes forces every read to take everything.
  2. 0:07This video shows an integration that sends only the changes.
  3. 0:15An integration in devtest copies customers from an ERP service to a CRM.
  4. 0:21It asks the ERP, and gets all twenty back.
  5. 0:25The entity store keeps the newest copy of every customer.
  6. 0:29Whatever comes back out of the store goes on to the CRM.
  7. 0:36The customer-sync folder holds two route files, starting with the poll route.
  8. 0:41Each run calls the ERP's customers address on a timer, once a minute.
  9. 0:46Each of the twenty goes into the store as the type customer.
  10. 0:50The second file holds the send route to the CRM.
  11. 0:53It waits on the store instead of the ERP,
  12. 0:56for customers whose record was created or updated.
  13. 1:02First,
  14. 1:03declare the type with weikio entitystore policy set sandbox/customer for devtest.
  15. 1:11The declaration creates the type's store inside the environment's budget.
  16. 1:15Then weikio run, the customer-sync folder.
  17. 1:19The files go up, the version builds, then the deployment starts.
  18. 1:23Your Weik.io installation keeps the integration at version 0.1.0.
  19. 1:33The deployment runs as a Java process on agent dev.
  20. 1:36The first poll reads all twenty and puts each into the store.
  21. 1:41All twenty are new, so all come back out as created, to the CRM.
  22. 1:49A minute later the poll reads all twenty again.
  23. 1:52The store takes every copy and skips the ones that change nothing,
  24. 1:56so no send line prints.
  25. 2:01The ERP gives one customer a new phone number.
  26. 2:07The next poll reads and puts all twenty again.
  27. 2:10This time the store finds one real change,
  28. 2:14and the send route posts that one customer as an update.
  29. 2:19Control C stops the following, the integration stays deployed and keeps running.
  30. 2:28In the Weik.io CLI, weikio entities list sandbox/customer prints what the store holds,
  31. 2:36one row later than the rest.
  32. 2:41weikio entities get reads that customer back with its revisions.
  33. 2:45The update prints above the creation.
  34. 2:48The store keeps two revisions of each record.
  35. 2:55The admin UI's Entity store page lists the declared types.
  36. 3:00The type's page lists all twenty customers in devtest.
  37. 3:05The Changes section marks the one update among the puts.
  38. 3:09Opening the changed customer shows its newest data and the revisions behind it.
  39. 3:18The integration is two routes: one reads everything,
  40. 3:21the other answers with the changes.
  41. 3:24The entity store between them keeps each customer's newest
  42. 3:27copy and lets only real changes through.
  43. 3:31The source needs no change detection, since the timer reads all of it.
  44. 3:35The destination receives only the customers that changed.

Next in this track

Patterns 2 · 3:05 Sending data to several destinations Watched

Sign in to the live demo

Sign in with the shared viewer account, which can open every screen of the example projects and can't change anything.

E-mail
viewer@demo.weik.io
Password
try-weikio-live-demo
Open the live demo