<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=snicoll" rel="nofollow">Stéphane Nicoll</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7879?redirect=false" rel="nofollow">SPR-7879</a></strong> and commented</p>
<p dir="auto">We experienced a threads leak using Spring's DMLC on JBoss 4.2.3. We configured our DMLC as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;jms:listener-container
     destination-type=&quot;queue&quot;
     concurrency=&quot;1&quot;
     connection-factory=&quot;connectionFactory&quot;
     destination-resolver=&quot;destinationResolver&quot;
     transaction-manager=&quot;jmsTransactionManager&quot;
     task-executor=&quot;jmsTaskExecutor&quot;&gt;
  &lt;jms:listener destination=&quot;queue/A&quot; ref=&quot;defaultListener&quot;/&gt;
&lt;/jms:listener-container&gt;"><pre class="notranslate"><code class="notranslate">&lt;jms:listener-container
     destination-type="queue"
     concurrency="1"
     connection-factory="connectionFactory"
     destination-resolver="destinationResolver"
     transaction-manager="jmsTransactionManager"
     task-executor="jmsTaskExecutor"&gt;
  &lt;jms:listener destination="queue/A" ref="defaultListener"/&gt;
&lt;/jms:listener-container&gt;
</code></pre></div>
<p dir="auto">After some investigations and the help of the support we figured out that the following configuration helped fixing our threads leak issue</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;jms:listener-container
     destination-type=&quot;queue&quot;
     concurrency=&quot;1&quot;
     connection-factory=&quot;connectionFactory&quot;
     destination-resolver=&quot;destinationResolver&quot;
     acknowledge=&quot;transacted&quot;
     task-executor=&quot;jmsTaskExecutor&quot;&gt;
  &lt;jms:listener destination=&quot;queue/A&quot; ref=&quot;defaultListener&quot;/&gt;
&lt;/jms:listener-container&gt;"><pre class="notranslate"><code class="notranslate">&lt;jms:listener-container
     destination-type="queue"
     concurrency="1"
     connection-factory="connectionFactory"
     destination-resolver="destinationResolver"
     acknowledge="transacted"
     task-executor="jmsTaskExecutor"&gt;
  &lt;jms:listener destination="queue/A" ref="defaultListener"/&gt;
&lt;/jms:listener-container&gt;
</code></pre></div>
<p dir="auto">Our use case is that we have externalized basically the following:</p>
<ul dir="auto">
<li>The connection factory and destination resolver (in order to be able to connect to another 3rd party JMS broker)</li>
<li>The JmsTransactionManager, whether we want to enable XA support or not</li>
</ul>
<p dir="auto">In the first configuration, it's obvious it is easy to share the configuration of this listener container, just import a strategy that defines the 3 beans above and you're good (we have some kind of "profile" capability using naming conventions). The problem is that the second configuration is the only way to get a proper usage with JBoss (connection/threads leak).</p>
<p dir="auto">I don't know how easy it would be but the JmsTrasanctionManager that I use is the following</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;bean id=&quot;jmsTransactionManager&quot; class=&quot;org.springframework.jms.connection.JmsTransactionManager&quot;&gt;
    &lt;property name=&quot;connectionFactory&quot; ref=&quot;connectionFactory&quot;/&gt;
&lt;/bean&gt;"><pre class="notranslate"><code class="notranslate">&lt;bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager"&gt;
    &lt;property name="connectionFactory" ref="connectionFactory"/&gt;
&lt;/bean&gt;
</code></pre></div>
<p dir="auto">Couldn't we imagine a solution where the DMLC is smart enough to look at the transaction manager type and flip to the "acknowledge=transacted" mode? I understand the JMS API is related to the issue but reading the doc, it's hard to understand what would be the impact of each option.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.5</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398117789" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13838" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13838/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13838">#13838</a> Improve Javadocs for DMLC Regarding JmsTransactionManager (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=dfernandez" rel="nofollow">Daniel Fernández</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8963?redirect=false" rel="nofollow">SPR-8963</a></strong> and commented</p>
<p dir="auto">IMHO, there is a mismatch between the configuration possibilities offered by XML and <code class="notranslate">@Configuration</code> classes in Spring 3.1, which could be fixed by allowing developers to create custom annotations that could be used in <code class="notranslate">@Configuration</code> classes (in the same way as <code class="notranslate">@PropertySource</code>) for performing pre-configured infrastructure tasks.</p>
<p dir="auto">These annotations could perform these configuration tasks "underneath", hiding their complexities to Spring users, in the same way namespace handlers can in an XML file.</p>
<p dir="auto"><code class="notranslate">@PropertySource</code> is the clear example to this, as it registers a PropertySource for the specified ".properties" files, but the object registered is of a specific class hard-coded into Spring's code. This avoids the possibility of creating instances of other implementations of the PropertySource interface that perform more complex processing of .properties entries.</p>
<p dir="auto">Specifically, the jasypt project [ http://www.jasypt.org ] --of which I'm author-- defines an "encryption" XML namespace which allows developers to register an EncryptablePropertySource that performs automatic transparent decryption of properties with "encryption:encryptable-property-placeholder/", which works in a way equivalent to "context:property-placeholder/", but applying transparent decryption.</p>
<p dir="auto">I would love to be able to offer this same easiness of configuration in <code class="notranslate">@Configuration</code> classes with an <code class="notranslate">@EncryptablePropertySource</code> annotation, but as it happens this is not possible :-(</p>
<p dir="auto">Please, extend the <code class="notranslate">@Configuration</code> mechanism for allowing custom annotations (with their associated handlers).</p>
<p dir="auto">Thanks.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 GA</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?120147-Can-I-create-my-own-annotations-for-enabling-features-at-Configuration-classes" rel="nofollow">http://forum.springsource.org/showthread.php?120147-Can-I-create-my-own-annotations-for-enabling-features-at-Configuration-classes</a></p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398171062" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/16732" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/16732/hovercard" href="https://github.com/spring-projects/spring-framework/issues/16732">#16732</a> Improve <code class="notranslate">@PropertySource</code> loading support (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398156818" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14865" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14865/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14865">#14865</a> Allow <code class="notranslate">@PropertySource</code> to be specified on a test class</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398165142" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/16004" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/16004/hovercard" href="https://github.com/spring-projects/spring-framework/issues/16004">#16004</a> Support declarative PropertySource annotations in the TestContext framework</li>
<li><a href="https://jira.spring.io/browse/SEC-3123" rel="nofollow">SEC-3123</a> Encrypted property value support</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398188790" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/18447" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/18447/hovercard" href="https://github.com/spring-projects/spring-framework/issues/18447">#18447</a> Add support for UTF-8 and other charset/encoding to <code class="notranslate">@PropertySource</code></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398190326" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/18574" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/18574/hovercard" href="https://github.com/spring-projects/spring-framework/issues/18574">#18574</a> convertPropertyValue (for reading encrypted values) not working</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398168468" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/16428" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/16428/hovercard" href="https://github.com/spring-projects/spring-framework/issues/16428">#16428</a> Custom <code class="notranslate">@Profile</code> annotations not working on <code class="notranslate">@Configuration</code> classes</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398116068" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13568" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13568/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13568">#13568</a> PropertySourcesPlaceholderConfigurer never calls "convertProperties" on merged properties</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398159720" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/15294" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/15294/hovercard" href="https://github.com/spring-projects/spring-framework/issues/15294">#15294</a> Add encryption support for PropertyPlaceholderConfigurer</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398175791" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/17236" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/17236/hovercard" href="https://github.com/spring-projects/spring-framework/issues/17236">#17236</a> Backport encrypted property functionality from spring-cloud-config environment work</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398189937" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/18544" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/18544/hovercard" href="https://github.com/spring-projects/spring-framework/issues/18544">#18544</a> Allow a single element to override an array attribute in a meta-annotation</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/a3789120c9d5d77a7f3946c9d5d809195de6d243/hovercard" href="https://github.com/spring-projects/spring-framework/commit/a3789120c9d5d77a7f3946c9d5d809195de6d243"><tt>a378912</tt></a></p>
<p dir="auto">5 votes, 12 watchers</p>