AMQP-186: add placeholder support to container parser
This commit is contained in:
@@ -79,6 +79,8 @@ class ListenerContainerParser implements BeanDefinitionParser {
|
||||
|
||||
private static final String PHASE_ATTRIBUTE = "phase";
|
||||
|
||||
private static final String AUTO_STARTUP_ATTRIBUTE = "auto-startup";
|
||||
|
||||
private static final String ADVICE_CHAIN_ATTRIBUTE = "advice-chain";
|
||||
|
||||
|
||||
@@ -228,17 +230,17 @@ class ListenerContainerParser implements BeanDefinitionParser {
|
||||
|
||||
String concurrency = containerEle.getAttribute(CONCURRENCY_ATTRIBUTE);
|
||||
if (StringUtils.hasText(concurrency)) {
|
||||
containerDef.getPropertyValues().add("concurrentConsumers", concurrency);
|
||||
containerDef.getPropertyValues().add("concurrentConsumers", new TypedStringValue(concurrency));
|
||||
}
|
||||
|
||||
String prefetch = containerEle.getAttribute(PREFETCH_ATTRIBUTE);
|
||||
if (StringUtils.hasText(prefetch)) {
|
||||
containerDef.getPropertyValues().add("prefetchCount", new Integer(prefetch));
|
||||
containerDef.getPropertyValues().add("prefetchCount", new TypedStringValue(prefetch));
|
||||
}
|
||||
|
||||
String transactionSize = containerEle.getAttribute(TRANSACTION_SIZE_ATTRIBUTE);
|
||||
if (StringUtils.hasText(transactionSize)) {
|
||||
containerDef.getPropertyValues().add("txSize", transactionSize);
|
||||
containerDef.getPropertyValues().add("txSize", new TypedStringValue(transactionSize));
|
||||
}
|
||||
|
||||
String phase = containerEle.getAttribute(PHASE_ATTRIBUTE);
|
||||
@@ -246,6 +248,11 @@ class ListenerContainerParser implements BeanDefinitionParser {
|
||||
containerDef.getPropertyValues().add("phase", phase);
|
||||
}
|
||||
|
||||
String autoStartup = containerEle.getAttribute(AUTO_STARTUP_ATTRIBUTE);
|
||||
if (StringUtils.hasText(autoStartup)) {
|
||||
containerDef.getPropertyValues().add("autoStartup", new TypedStringValue(autoStartup));
|
||||
}
|
||||
|
||||
String adviceChain = containerEle.getAttribute(ADVICE_CHAIN_ATTRIBUTE);
|
||||
if (StringUtils.hasText(adviceChain)) {
|
||||
containerDef.getPropertyValues().add("adviceChain", new RuntimeBeanReference(adviceChain));
|
||||
|
||||
@@ -490,6 +490,13 @@
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="auto-startup" type="xsd:string" default="true">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Flag to indicate that the container should start up automatically when the enclosing context is refreshed. Default true.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="advice-chain" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<props>
|
||||
<prop key="five">5</prop>
|
||||
<prop key="one">1</prop>
|
||||
<prop key="false">false</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
@@ -21,7 +22,7 @@
|
||||
|
||||
<rabbit:queue id="bar" />
|
||||
|
||||
<rabbit:listener-container id="container1" connection-factory="connectionFactory" acknowledge="manual" concurrency="${five}" transaction-size="${one}">
|
||||
<rabbit:listener-container id="container1" connection-factory="connectionFactory" acknowledge="manual" concurrency="${five}" transaction-size="${one}" auto-startup="${false}">
|
||||
<rabbit:listener id="testListener" queue-names="foo, #{bar.name}" ref="testBean" method="handle"/>
|
||||
</rabbit:listener-container>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user