<?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>topic Re: How to run bulk commands in parallel in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-run-bulk-commands-in-parallel/m-p/325894#M12895</link>
    <description>&lt;P&gt;I think we can define parallelism in streamproceesor  extenision point using defaultConcurrency and defaultPartitions parameters.&lt;/P&gt;
&lt;P&gt;For example the following configuration allows to launch 6 buckets in parallel&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.runtime.stream.service" point="streamProcessor"&amp;gt;
 &amp;lt;streamProcessor name="syllabsIndexing" class="com.adequat.nuxeo.glm.addons.MyActionProcessor" logConfig="bulk" defaultConcurrency="6" defaultPartitions="6"&amp;gt;
	 &amp;lt;policy name="syllabsIndexing" maxRetries="10" delay="1s" maxDelay="60s" continueOnFailure="true" /&amp;gt;  
	&amp;lt;/streamProcessor&amp;gt;
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 17 May 2021 15:49:23 GMT</pubDate>
    <dc:creator>Ahmad_BenMaallem</dc:creator>
    <dc:date>2021-05-17T15:49:23Z</dc:date>
    <item>
      <title>How to run bulk commands in parallel</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-run-bulk-commands-in-parallel/m-p/325893#M12894</link>
      <description>&lt;P&gt;Hello,
I am trying to learn how to use the bulk framework in nuxeo based on this document &lt;A href="https://doc.nuxeo.com/nxdoc/1010/bulk-action-framework/" target="test_blank"&gt;https://doc.nuxeo.com/nxdoc/1010/bulk-action-framework/&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;But until now I could not find how to process documents in parallel.&lt;/P&gt;
&lt;P&gt;For example, I defined the following action (just to test) which allows to sleep one second for each document,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-java"&gt;...
public class MyComputation extends AbstractBulkComputation {
...
@Override
    protected void compute(CoreSession session, List&amp;lt;String&amp;gt; ids, Map&amp;lt;String, Serializable&amp;gt; properties) {
	for (DocumentModel doc : loadDocuments(session, ids)) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
	}
}
...
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;By performing this action on 10 documents, I will have a Bulkstatus with the COMPLETED state only after 10 seconds.&lt;/P&gt;
&lt;P&gt;How can I parallelize the processing so that I will have an answer in one second in my example ?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 15:15:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-run-bulk-commands-in-parallel/m-p/325893#M12894</guid>
      <dc:creator>Ahmad_BenMaallem</dc:creator>
      <dc:date>2021-05-11T15:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to run bulk commands in parallel</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-run-bulk-commands-in-parallel/m-p/325894#M12895</link>
      <description>&lt;P&gt;I think we can define parallelism in streamproceesor  extenision point using defaultConcurrency and defaultPartitions parameters.&lt;/P&gt;
&lt;P&gt;For example the following configuration allows to launch 6 buckets in parallel&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.runtime.stream.service" point="streamProcessor"&amp;gt;
 &amp;lt;streamProcessor name="syllabsIndexing" class="com.adequat.nuxeo.glm.addons.MyActionProcessor" logConfig="bulk" defaultConcurrency="6" defaultPartitions="6"&amp;gt;
	 &amp;lt;policy name="syllabsIndexing" maxRetries="10" delay="1s" maxDelay="60s" continueOnFailure="true" /&amp;gt;  
	&amp;lt;/streamProcessor&amp;gt;
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 May 2021 15:49:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-run-bulk-commands-in-parallel/m-p/325894#M12895</guid>
      <dc:creator>Ahmad_BenMaallem</dc:creator>
      <dc:date>2021-05-17T15:49:23Z</dc:date>
    </item>
  </channel>
</rss>

