Handling Salesforce paginated apis with Quarkus #36681
-
Hi, Me and my team recently started using quarkus and we have a case where we need to handle the Salesforce api pagination. { Instead of a page number we have a nextRecordsUrl field containing the id for the next batch of records. The first response contains the id to the second batch, the second response contains the id to the third, etc until the field done is equal to true. Can you help us with such example using mutiny for our case? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Something like this Multi<SalesforceRecord> multi = Multi.createBy().repeating()
.uni(() -> new AtomicReference<String>("firstPage"),
url -> sfClient.getRecord(url.get()).onItem()
.invoke(sfRecord -> url.set(sfRecord.getNextRecordsUrl())))
.until(SalesforceRecord::isDone); |
Beta Was this translation helpful? Give feedback.
Something like this