private Map<String, String> setNumConsumersInRuntimeAttributes(Node docElement, Map<String, String> incomingRuntimeAttributes) {
        Map<String, String> runtimeAttributes = new HashMap<>();

        for (Map.Entry<String, String> e : incomingRuntimeAttributes.entrySet()) {
            runtimeAttributes.put(e.getKey(), e.getValue());
        }

        //if this is set at runtime use that value
        if (runtimeAttributes.containsKey(NUM_CONSUMERS_KEY)) {
            return Collections.unmodifiableMap(runtimeAttributes);
        }
        Node ncNode = docElement
                .getAttributes()
                .getNamedItem("numConsumers");
        int numConsumers = -1;
        String numConsumersString = ncNode.getNodeValue();
        try {
            numConsumers = Integer.parseInt(numConsumersString);
        } catch (NumberFormatException e) {
            //swallow and just use numConsumers
        }
        //TODO: should we have a max range check?
        if (numConsumers < 1) {
            numConsumers = AbstractConsumersBuilder.getDefaultNumConsumers();
        }
        runtimeAttributes.put(NUM_CONSUMERS_KEY, Integer.toString(numConsumers));
        return Collections.unmodifiableMap(runtimeAttributes);
    }
Builds a FileResourceBatchProcessor from runtime arguments and a
document node of a configuration file.  With the exception of the QueueBuilder,
the builders choose how to adjudicate between
runtime arguments and the elements in the configuration file.

@param docElement                document element of the xml config file
@param incomingRuntimeAttributes runtime arguments
@return FileResourceBatchProcessor
tika-batch/src/main/java/org/apache/tika/batch/builders/BatchProcessBuilder.java