/** * Specify concurrency limits via a "lower-upper" String, e.g. "5-10", or a simple * upper limit String, e.g. "10". * <p>JCA listener containers will always scale from zero to the given upper limit. * A specified lower limit will effectively be ignored. * <p>This property is primarily supported for configuration compatibility with * {@link org.springframework.jms.listener.DefaultMessageListenerContainer}. * For this activation config, generally use {@link #setMaxConcurrency} instead. */ public void setConcurrency(String concurrency) { try { int separatorIndex = concurrency.indexOf('-'); if (separatorIndex != -1) { setMaxConcurrency(Integer.parseInt(concurrency.substring(separatorIndex + 1, concurrency.length()))); } else { setMaxConcurrency(Integer.parseInt(concurrency)); } } catch (NumberFormatException ex) { throw new IllegalArgumentException("Invalid concurrency value [" + concurrency + "]: only " + "single maximum integer (e.g. \"5\") and minimum-maximum combo (e.g. \"3-5\") supported. " + "Note that JmsActivationSpecConfig will effectively ignore the minimum value and " + "scale from zero up to the number of consumers according to the maximum value."); } }
/** * Specify concurrency limits via a "lower-upper" String, e.g. "5-10", or a simple * upper limit String, e.g. "10". * <p>JCA listener containers will always scale from zero to the given upper limit. * A specified lower limit will effectively be ignored. * <p>This property is primarily supported for configuration compatibility with * {@link org.springframework.jms.listener.DefaultMessageListenerContainer}. * For this activation config, generally use {@link #setMaxConcurrency} instead. */ public void setConcurrency(String concurrency) { try { int separatorIndex = concurrency.indexOf('-'); if (separatorIndex != -1) { setMaxConcurrency(Integer.parseInt(concurrency.substring(separatorIndex + 1, concurrency.length()))); } else { setMaxConcurrency(Integer.parseInt(concurrency)); } } catch (NumberFormatException ex) { throw new IllegalArgumentException("Invalid concurrency value [" + concurrency + "]: only " + "single maximum integer (e.g. \"5\") and minimum-maximum combo (e.g. \"3-5\") supported. " + "Note that JmsActivationSpecConfig will effectively ignore the minimum value and " + "scale from zero up to the number of consumers according to the maximum value."); } }
/** * Specify concurrency limits via a "lower-upper" String, e.g. "5-10", or a simple * upper limit String, e.g. "10". * <p>JCA listener containers will always scale from zero to the given upper limit. * A specified lower limit will effectively be ignored. * <p>This property is primarily supported for configuration compatibility with * {@link org.springframework.jms.listener.DefaultMessageListenerContainer}. * For this activation config, generally use {@link #setMaxConcurrency} instead. */ public void setConcurrency(String concurrency) { try { int separatorIndex = concurrency.indexOf('-'); if (separatorIndex != -1) { setMaxConcurrency(Integer.parseInt(concurrency.substring(separatorIndex + 1, concurrency.length()))); } else { setMaxConcurrency(Integer.parseInt(concurrency)); } } catch (NumberFormatException ex) { throw new IllegalArgumentException("Invalid concurrency value [" + concurrency + "]: only " + "single maximum integer (e.g. \"5\") and minimum-maximum combo (e.g. \"3-5\") supported. " + "Note that JmsActivationSpecConfig will effectively ignore the minimum value and " + "scale from zero up to the number of consumers according to the maximum value."); } }