Hi Team,
We are using Adobe I/O Eventing to trigger the download events and then fetching the events using Journaling API Endpoint, in the last pushing the events to third party applications.
When we are fetching the events from Journaling queue, we are just getting at max 3 events in each get request.
As per the document [1] stating "depending on the traffic of the events associated with your registration, the number of events returned in a single response batch varies: a batch of events contains at least one event (if you are not already at the end of the journal), but there is no pre-defined upper limit.", in each batch we want to fetch more events, we used 'limits' param but that too is not helping to get most of the events in one request.
Now my questions are :
1. Why Journaling batches just have 2-3 events at a time, I cant see full queue of events with Postman Get request.
2. How can I pull maximum events from journaling queue?
3. How this Journaling is working?
4. What is the risk here to return whole events at that moment from Journaling queue?
Thanks,
SD
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @SDusane , valid questions when first time using the Journaling queue. I wrote an article how we leveraged Journaling with code examples at each layer. https://medium.com/@bsaravanaprakash/building-content-supply-chain-using-workfront-aio-journaling-ap...
So lets breakdown,
async function fetchEventsUsingSDK(state, since = "") {
logger.info("Checking events after index: " + since);
const client = await sdk.init(imsOrgId, clientId, oauthToken);
const baseURL = `https://api.adobe.io/events/organizations/${consumerOrgId}/integrations/${credId}/${registrationId}`;
const journalOptions = since ? { since: since } : undefined;
const journalObservable = await client.getEventsObservableFromJournal(
baseURL,
journalOptions
);
journalObservable
.pipe(
filter((evt) => evt.position && evt.event.data),
concatMap((evt) => {
return of(evt).pipe(
concatMap((event) => processEvent(event).then(() => event))
);
})
)
.subscribe(
async (x) => await saveEventIndexToState(state, x), // any action onNext event
(e) => logger.error("onError: " + e.message), // any action onError
() => logger.log("onCompleted") //action onComplete
);
}
This will fetch all the events while the action is awake Hope this clarifies.
Hi @SDusane , valid questions when first time using the Journaling queue. I wrote an article how we leveraged Journaling with code examples at each layer. https://medium.com/@bsaravanaprakash/building-content-supply-chain-using-workfront-aio-journaling-ap...
So lets breakdown,
async function fetchEventsUsingSDK(state, since = "") {
logger.info("Checking events after index: " + since);
const client = await sdk.init(imsOrgId, clientId, oauthToken);
const baseURL = `https://api.adobe.io/events/organizations/${consumerOrgId}/integrations/${credId}/${registrationId}`;
const journalOptions = since ? { since: since } : undefined;
const journalObservable = await client.getEventsObservableFromJournal(
baseURL,
journalOptions
);
journalObservable
.pipe(
filter((evt) => evt.position && evt.event.data),
concatMap((evt) => {
return of(evt).pipe(
concatMap((event) => processEvent(event).then(() => event))
);
})
)
.subscribe(
async (x) => await saveEventIndexToState(state, x), // any action onNext event
(e) => logger.error("onError: " + e.message), // any action onError
() => logger.log("onCompleted") //action onComplete
);
}
This will fetch all the events while the action is awake Hope this clarifies.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies