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?"
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Here is the working solution I figured after trial-n-error.
1. After creating the App, change the default settings.Default app is created with 2min timeout, so it dies even when active actions are in progress. I am able to change timeout to 30 minutes and able to execute long-running-processes
2. Set the alarm trigger to more frequent (5 mins) so it polls and fetches events more frequent.
3. One learning I figured, when changing frequency, make sure change trigger name and interval name. Else somehow alarms clashes and same action runs under both frequencies.
This way by editing default settings and running cron, able to execute long processes.
Thanks all for helping out.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
@sangeethakrishnan , Nopes, I tested and found not working. So this is serverless world. Everytime cron executes and triggers action, its a NEW container instance created. and watever action running at old container is lost.
Still working with adobe for better solutions. I ll capture my findings once I find a satisfactory answer.
Views
Replies
Total Likes
Thats why you need to store the state which is the last read position as stated here: https://developer.adobe.com/app-builder/docs/resources/journaling-events/lesson2/
Views
Replies
Total Likes
Here is the working solution I figured after trial-n-error.
1. After creating the App, change the default settings.Default app is created with 2min timeout, so it dies even when active actions are in progress. I am able to change timeout to 30 minutes and able to execute long-running-processes
2. Set the alarm trigger to more frequent (5 mins) so it polls and fetches events more frequent.
3. One learning I figured, when changing frequency, make sure change trigger name and interval name. Else somehow alarms clashes and same action runs under both frequencies.
This way by editing default settings and running cron, able to execute long processes.
Thanks all for helping out.
Views
Replies
Total Likes
Views
Likes
Replies