<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160226#M49257</link>
    <description>&lt;P&gt;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.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2016 21:20:09 GMT</pubDate>
    <dc:creator>mgilman</dc:creator>
    <dc:date>2016-12-20T21:20:09Z</dc:date>
    <item>
      <title>Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160217#M49248</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;U&gt;Following is how I construct and execute my query:&lt;/U&gt;&lt;/P&gt;&lt;PRE&gt;BulletinRepository repository =  context.getBulletinRepository();
final BulletinQuery queryProcessor= new BulletinQuery.Builder().
		sourceType(ComponentType.PROCESSOR).
		limit(500).build();
bulletinsList.addAll(repository.findBulletins(queryProcessor)); 
&lt;/PRE&gt;&lt;P&gt;How do I get ALL the messages from Bulletin repository rather then just receiving 5?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Obaid&lt;/P&gt;</description>
      <pubDate>Sun, 18 Dec 2016 09:12:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160217#M49248</guid>
      <dc:creator>obaid_salikeen</dc:creator>
      <dc:date>2016-12-18T09:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160218#M49249</link>
      <description>&lt;P&gt;Here is your answer:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
public class &lt;STRONG&gt;VolatileBulletinRepository&lt;/STRONG&gt; implements BulletinRepository {&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;    private static final int CONTROLLER_BUFFER_SIZE = 10;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;    private static final int &lt;STRONG&gt;COMPONENT_BUFFER_SIZE = 5;&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The limit for bulletins returned is set by the component buffer, which is hard coded to 5.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/apache/nifi/blob/d838f61291d2582592754a37314911b701c6891b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java" target="_blank"&gt;https://github.com/apache/nifi/blob/d838f61291d2582592754a37314911b701c6891b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/apache/nifi/blob/7f5eabd603bfc326dadc35590bbe69304e8c90fa/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java" target="_blank"&gt;https://github.com/apache/nifi/blob/7f5eabd603bfc326dadc35590bbe69304e8c90fa/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am not sure who is setting that limit, but that may be 5 somewhere.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;        final BulletinQuery.Builder queryBuilder = new BulletinQuery.Builder()&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;                .groupIdMatches(query.getGroupId())&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;                .sourceIdMatches(query.getSourceId())&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;                .nameMatches(query.getName())&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;                .messageMatches(query.getMessage())&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;                .after(query.getAfter())&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;                .limit(query.getLimit());&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;        // perform the query&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;        final List&amp;lt;Bulletin&amp;gt; results = bulletinRepository.findBulletins(queryBuilder.build());

&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;A href="https://github.com/apache/nifi/blob/2d6bba080f90a45a9f4149f6844f452150ed6bc1/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java" target="_blank"&gt;https://github.com/apache/nifi/blob/2d6bba080f90a45a9f4149f6844f452150ed6bc1/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java&lt;/A&gt;&lt;/P&gt;&lt;P&gt;@QueryParam("limit") IntegerParameterlimit) throwsInterruptedException {&lt;/P&gt;&lt;P&gt;Have you traced it.   Maybe 500 is too big.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Dec 2016 13:17:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160218#M49249</guid>
      <dc:creator>TimothySpann</dc:creator>
      <dc:date>2016-12-18T13:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160219#M49250</link>
      <description>&lt;P&gt;UPDATE: FOLLOWING SOLUTION DOSENT WORKS : We always get at-max 5 messages,&lt;/P&gt;&lt;P&gt;Thanks @&lt;A href="https://community.hortonworks.com/users/9304/tspann.html"&gt;Timothy Spann&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;Here is what  I found out (there is a bulletin id maintained for each bulletin messages, and it is always increasing. By using .after(id) I am able to fetch all messages in repeated calls:&lt;/P&gt;&lt;PRE&gt;/**
 * Retrieve bulletins from ButtetinRepository
 * These bulletin messages are used to generate system health metrics (Errors/Warns/Info)
 * @param context
 * @param previousBulletinId
 * @param maxBulletins
 * @return
 */
public static List&amp;lt;Bulletin&amp;gt; findBulletins(ReportingContext context, ComponentType componentType, long previousBulletinId, final int maxBulletins){
ArrayList&amp;lt;Bulletin&amp;gt; bulletinsList = new ArrayList&amp;lt;&amp;gt;();
BulletinRepository repository =  context.getBulletinRepository();
int bulletinsFound = 0;
	do{
		bulletinsFound = 0;
		final BulletinQuery queryProcessor= new BulletinQuery.Builder().sourceType(componentType).after(previousBulletinId).build();
		List&amp;lt;Bulletin&amp;gt; bulletinsThisQuery = repository.findBulletins(queryProcessor);
		if(bulletinsThisQuery != null &amp;amp;&amp;amp; bulletinsThisQuery.size() &amp;gt; 0){
			bulletinsFound = bulletinsThisQuery.size();
			previousBulletinId = bulletinsThisQuery.get(0).getId(); /** Retrieve bulletin id*/
			bulletinsList.addAll(bulletinsThisQuery); 
		}
	}
	while(bulletinsFound &amp;gt; 0 &amp;amp;&amp;amp; bulletinsList.size() &amp;lt; maxBulletins);
	return bulletinsList;
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Dec 2016 04:17:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160219#M49250</guid>
      <dc:creator>obaid_salikeen</dc:creator>
      <dc:date>2016-12-19T04:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160220#M49251</link>
      <description>&lt;P&gt;Sweet.   You should write an article, that's good to know.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 04:25:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160220#M49251</guid>
      <dc:creator>TimothySpann</dc:creator>
      <dc:date>2016-12-19T04:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160221#M49252</link>
      <description>&lt;P&gt;Ok, actually I verified that I am still getting total of 5 messages, no matter how many times I call it, apologies !&lt;/P&gt;&lt;P&gt;So now, I need to re-think how I monitor errors. Do you think through Rest API I would be able to get all error messages?&lt;/P&gt;&lt;P&gt;Or should I monitor logs for errors?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 04:46:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160221#M49252</guid>
      <dc:creator>obaid_salikeen</dc:creator>
      <dc:date>2016-12-19T04:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160222#M49253</link>
      <description>&lt;P&gt;This is by design. A bulletin is simply a notification about a passing event. To get access to every event you'd either need to monitor the log files or implement a custom Reporting Task to exfil the bulletins as they occur. The reporting context provided to the task has access to the bulletin repository. We have a similar Reporting Task for sending provenance events [1].&lt;/P&gt;&lt;P&gt;[1] &lt;A href="https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java" target="_blank"&gt;https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 21:33:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160222#M49253</guid>
      <dc:creator>mgilman</dc:creator>
      <dc:date>2016-12-19T21:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160223#M49254</link>
      <description>&lt;P&gt;Thanks &lt;A href="https://community.hortonworks.com/users/362/mgilman.html"&gt;mgilman&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;Yes that is what I am trying to achieve, a ReportingTask that is fetching events from BulletinRepository. The issue is that it always returns at-max 5, so I cannot report all arrors (assume you have more then 5 errors for a processor etc) so which API should I use to extract all bulletins? essentially, how to do "exfil the bulletins as they occur"? It would be great if you could elaborate, thanks&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 01:02:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160223#M49254</guid>
      <dc:creator>obaid_salikeen</dc:creator>
      <dc:date>2016-12-20T01:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160224#M49255</link>
      <description>&lt;P&gt;The Reporting Task would follow the same pattern as the REST API. The only difference is that you'll be able to schedule it to run much more frequently than you could poll the REST API. You do need to maintain some local state, specifically the last bulletin seen. Then in your on trigger you can findBulletins starting from that id. Update the last bulletin seen. Repeat in the next onTrigger.&lt;/P&gt;&lt;P&gt;Since we're limited to 5 per component, that means that this will need to run at least once before the component is able to generate more than 5 bulletins. The REST API follows a similar patten for the Bulletin Board but it's not guaranteed to pull back every single bulletin. It is guaranteed to pull back up to the last 5. Once the next bulletin is triggered, the oldest one falls out of scope. Polling the REST API will definitely be slower than running a Report Task and will increase the risk of possibly missing one.&lt;/P&gt;&lt;P&gt;Alternatively you can scrap the logs. The bulletins are essentially notifications of log messages.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 03:21:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160224#M49255</guid>
      <dc:creator>mgilman</dc:creator>
      <dc:date>2016-12-20T03:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160225#M49256</link>
      <description>&lt;P&gt;Thanks @&lt;A href="https://community.hortonworks.com/users/362/mgilman.html"&gt;mgilman&lt;/A&gt;&lt;/P&gt;&lt;P&gt;That was helpful. So for ReportingTask, how frequent should I run it? Lets say I am running every 10 seconds, and we receive 100 errors/Warn/info bulletins every minute (just for example), do you think we might loose messages, are we guaranteed to receive all bulletins?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 15:40:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160225#M49256</guid>
      <dc:creator>obaid_salikeen</dc:creator>
      <dc:date>2016-12-20T15:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160226#M49257</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 21:20:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160226#M49257</guid>
      <dc:creator>mgilman</dc:creator>
      <dc:date>2016-12-20T21:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - BulletinRepository API returns maximum 5 bulletins (errors/info/warn) per component</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160227#M49258</link>
      <description>&lt;P&gt;Monitor logs and REST API are good.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 22:49:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-BulletinRepository-API-returns-maximum-5-bulletins/m-p/160227#M49258</guid>
      <dc:creator>TimothySpann</dc:creator>
      <dc:date>2016-12-20T22:49:53Z</dc:date>
    </item>
  </channel>
</rss>

