Created 12-18-2016 01:12 AM
Hi,
I have written a ReportingTask service for Nifi, where I use 'BulletinRepository.findBulletins(queryProcessor);' to retrieve all bulletins and report metrics regarding number of errors/warns/info. The issue is that I am receiving at-max 5 bulletins/messages per component though more messages are viewable through the Bulletin UI.
Following is how I construct and execute my query:
BulletinRepository repository = context.getBulletinRepository(); final BulletinQuery queryProcessor= new BulletinQuery.Builder(). sourceType(ComponentType.PROCESSOR). limit(500).build(); bulletinsList.addAll(repository.findBulletins(queryProcessor));
How do I get ALL the messages from Bulletin repository rather then just receiving 5?
Thanks
Obaid
Created 12-18-2016 05:17 AM
Here is your answer:
public class VolatileBulletinRepository implements BulletinRepository { |
private static final int CONTROLLER_BUFFER_SIZE = 10; |
private static final int COMPONENT_BUFFER_SIZE = 5; |
The limit for bulletins returned is set by the component buffer, which is hard coded to 5.
I am not sure who is setting that limit, but that may be 5 somewhere.
final BulletinQuery.Builder queryBuilder = new BulletinQuery.Builder() |
.groupIdMatches(query.getGroupId()) |
.sourceIdMatches(query.getSourceId()) |
.nameMatches(query.getName()) |
.messageMatches(query.getMessage()) |
.after(query.getAfter()) |
.limit(query.getLimit()); |
// perform the query |
final List<Bulletin> results = bulletinRepository.findBulletins(queryBuilder.build()); |
@QueryParam("limit") IntegerParameterlimit) throwsInterruptedException {
Have you traced it. Maybe 500 is too big.
Created 12-20-2016 01:20 PM
If the processor in question is only running every 10 seconds, I would suggest running the Reporting Task more frequently. However, if a single invocation of the processor will result in more than 5 bulletins, I think your going to have trouble capturing them all with this approach. Scrapping the logs may be your safest bet.