Expand my Community achievements bar.

How to use AIO Events SDK getEventsObservableFromJournal inside Runtime action? The runtime action closes after 2-3 mins. How to keep action active and keep polling for events?

Avatar

Level 5

Hi,

I created a runtime web-action that ll fetch events from journal api like this

const journalObservable = await client.getEventsObservableFromJournal(baseURL, journalOptions);
  journalObservable.subscribe(
    x => logger.log('onNext: ' + JSON.stringify(x)), // any action onNext event
    e => logger.error('onError: ' + e.message), // any action onError
    () => logger.log('onCompleted')) //action onComplete

I am able to invoke the web action from postman. And when I publish events into the journal api, my logs read the events from journal successfully. 

 

Now the web action stays alive like 1-2 mins. Then dies. So if event is published say after 5 mins, those events are not received. Is this expected? 

 

Alternate I could think is, create as non-web-action using alarm. And cron trigger the action every say 5 mins. Is this correct that "Reading journal events must be created as non-web-action using alarm cron?" 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Employee

Alternate I could think is, create as non-web-action using alarm. And cron trigger the action every say 5 mins. Is this correct that "Reading journal events must be created as non-web-action using alarm cron?" 


This is correct.
It can be a web action too using an alarm.

Please refer to https://developer.adobe.com/app-builder/docs/resources/journaling-events/ codelab for an example on the same