public static int getNumConsumers(Map<String, String> attrs) {
        String nString = attrs.get(BatchProcessBuilder.NUM_CONSUMERS_KEY);
        if (nString == null || nString.equals("default")) {
            return AbstractConsumersBuilder.getDefaultNumConsumers();
        }
        int n = -1;
        try {
            n = Integer.parseInt(nString);
        } catch (NumberFormatException e) {
            //swallow
        }
        if (n < 1) {
            n = AbstractConsumersBuilder.getDefaultNumConsumers();
        }
        return n;
    }
numConsumers is needed by both the crawler and the consumers. This utility method
is to be used to extract the number of consumers from a map of String key value pairs.
<p>
If the value is "default", not a parseable integer or has a value &lt; 1,
then <code>AbstractConsumersBuilder</code>'s <code>getDefaultNumConsumers()</code>

@param attrs attributes from which to select the NUM_CONSUMERS_KEY
@return number of consumers
tika-batch/src/main/java/org/apache/tika/batch/builders/BatchProcessBuilder.java