concurrent connection

Options

Does anyone have idea about below error while trying to enable concurrent connection ?.. am i doing wrong in format what i put in values.

Config:-
solace.jms.message.consumer.concurrency.value=1-2
code:-
listenerFactory.setConcurrency("${solace.jms.message.consumer.concurrency.value}");

Error:-
java.lang.IllegalArgumentException: Invalid concurrency value [${solace.jms.message.consumer.concurrency.value}]: only single maximum integer (e.g. "5") and minimum-maximum combo (e.g. "3-5") supported.

Answers

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 920 admin
    Options

    Hi @maniv,
    It doesn't look like the value from the config is being properly read in which is why the invalid concurrency value in the exception reads the same as the configuration property name.

    Try reading in your property like this and then using the concurrency variable in your setter.
    @Value("${solace.jms.message.consumer.concurrency.value}")
    private String concurrency;

    Spring offers several ways to read in your properties, this article has a few more options:
    http://www.appsdeveloperblog.com/reading-application-properties-spring-boot/

    Hope that helps!

  • rdesoju
    rdesoju Member Posts: 66
    Options

    Have you tried enclosing 1-2 in double quotes?

  • maniv
    maniv Member Posts: 10
    Options

    @marc reading property values are correct and verified it.

  • maniv
    maniv Member Posts: 10
    Options

    @rdesoju .. tried it :).. but no luck