Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Currently, I'm loading data from a REST connection with pagination. The REST query is authenticated using a JWT token. I'm using the WITH CONNECTION clause to insert the token in the header.
However, the query runs quite long, causing the token to expire and the loading to fail. Is there any workaround for this?
Thank you.
Using QSEoW.
@KHSDM how do you manage the pagination? If you do this manually in a loop you could check the expiration during loops.
I'm using the built-in pagination option. Using the Next URL option.
Hi @KHSDM ,
The REST connector has no solution for this.
Hi @KHSDM,
If you are setting the pagination yourself, I mean, it is not automatically set in the Data Connection configuration, you can do incremental loads before each pagination. But there may be a catch here. You should be able to retake from where you have left and that depends on how the REST API was setup on the backend. So, you could loop your REST Connection until the NextURL is blank.
Another possible alternative is to do data partition. Try to apply filters to your requests to reduce the number os data returned. For example, let's say you could loop through a list of countries to return subsets of data. Instead of returning all the records at once, you can return these lists per country and save all the data in the same QVD - or even partitioned QVDs, one for each country.
Regards,
Mark Costa
Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com
@KHSDM this is a short example how to handle a NextURL manually using a loop and WITH CONNECTION
First create a subroutine to check if the authentication is still valid.
SUB Auth
IF ExpireDateTime<Now() THEN
**** your auth call****
ENDIF
End Sub
Then start the loop