Sidebar

How restrict the result returned by errorManager.searchErrors()?

0 votes
206 views
asked Jun 9, 2016 by rich-c-2789 (16,240 points)
I need to restrict how many errors are returned using errorManager.searchErrors() so that it doesn't overwhelm the channel from processing new messages if a lot are returned.

1 Answer

0 votes
Use the optional "maxResults" parameter to specify the maximum number of results to return:
 
var searchText = 'error=Server Busy';
var results = errorManager.searchErrors(searchText);
qie.debug('searchErrors returned ' + results.size() + ' messageQueueIds.');
qie.debug('The messageQueueIds returned: ' + results);
NOTE: searchErrors returns the most recent errors first.  When using the "maxResults", to avoid getting stuck in a loop after resolving an error that errors out again, add a date range to process the older errors first.
 
 
 

 

answered Jun 9, 2016 by rich-c-2789 (16,240 points)
...