I’m trying to implement a data pipeline workflow via Temporal Java-SDK.
Here are the sequential steps in my mind:
- First read the database rows from a big table(let’s say ten million rows in total) one by one via JDBC stream query.
- Pass each row into the next handlers, for example, Elasticsearch for indexing.
The rough idea is:
- create a DB-reading activity for reading the rows from the big table
- create any required Data-Pipeline activities for each row handler, and use each row as the activity input argument.
But when I tried to implement the activities call inside the main workflow function, I got this issue:
because the dataset is huge, iterate each row from the DB, store them into a list, and put them as the return data, return them from the DB-reading activity to the workflow is impossible, so I’m seeking a way that the DB-reading activity can send data to the workflow continuously without blocking the DB-reading process and workflow so that I can get each streaming row and pass each row to the next Data-Pipeline activities.
I tried to search such topic in this community, and found these:
Reactive not supported: Reactive support within activity.
Send data to the workflow via signal: Passing Activity Stub to (other) Activity Method Blows Call Stack - #3 by alec
From link 2, It seems like I can use signal to send these millions of rows to the workflow one by one. However, it was assuming that the total number of such signals is bounded.
So, my questions here are:
- does the DB-reading activity case is signal bounded(I guess not).
- If I can’t use the signal for sending data to workflow from activity, How can I achieve my use case, any suggestions?