Support Questions

Find answers, ask questions, and share your expertise

Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component

avatar
Expert Contributor

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

1 ACCEPTED SOLUTION

avatar
Master Guru

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.

https://github.com/apache/nifi/blob/d838f61291d2582592754a37314911b701c6891b/nifi-nar-bundles/nifi-f...

https://github.com/apache/nifi/blob/7f5eabd603bfc326dadc35590bbe69304e8c90fa/nifi-nar-bundles/nifi-f...

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());

https://github.com/apache/nifi/blob/2d6bba080f90a45a9f4149f6844f452150ed6bc1/nifi-nar-bundles/nifi-f...

@QueryParam("limit") IntegerParameterlimit) throwsInterruptedException {

Have you traced it. Maybe 500 is too big.

View solution in original post

10 REPLIES 10

avatar
Rising Star

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.