Announcement Announcement Module
No announcement yet.
PropertyPlaceholderConfigurer not resolving placeholder in tag attributes Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • PropertyPlaceholderConfigurer not resolving placeholder in tag attributes

    I am trying to use a placeholder for configuring the concurrency of a JMS listener:

    <jms:listener-container connection-factory="connectionFactory" concurrency="${jms.converterQueueConcurrency}" transaction-manager="jmsTransactionManager">
    <jms:listener destination="converterQueue" ref="converterMessageListener" method="onMessage" />
    However the PropertyPlaceholderConfigurer refuses to resolve this particular placeholder (others are resolved perfectly, even one included as an attribute in a <jaxws> tag, from the cxf project)

    Isn't this supported?

  • #2
    Hi Jr1931,
    PropertyPlaceholderConfigurer generally doesn't work for many custom namespace. This could be because the custom namespace parsers (BeanDefinitionParser) are not implemented keeping in mind that it needs to support PropertyPlaceholderConfigurer.

    I am not sure what kind of exceptions you are getting. I guess you might be getting some paresInt exception etc. Since jms:listener-container is a custom namespace. It has got its on parser I guess it is JmsListenerContainerParser. If you look at the code of JmsListenerContainerParser it is trying to convert the concurrency value to Integer and causing it to fail, it could have simply added it to the BeanDefinition.

    PropertyPlaceholderConfigurer is BeanFactoryPostProcessor and it would run after the Bean's BeanDefinition is ready but the Bean Definition is created by the BeanDefinitionParser which is in this case is JmsListenerContainerParser.