activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Dev <jan...@gmx.ch>
Subject Different deadLetterStrategies for different queues
Date Thu, 01 Apr 2010 09:40:46 GMT

Hi all

I am using ActiveMQ 5.3.0.
I have lots of queues. Lets say I have queue A,B,C,D

Queues A,B,C should have their own DLQ. Thus I configure the following:

<policyEntry queue=">" producerFlowControl="true" memoryLimit="50mb">
  <deadLetterStrategy>
    <individualDeadLetterStrategy queuePrefix="DLQ."
useQueueForQueueMessages="true" />
</deadLetterStrategy>
</policyEntry>

For Queue "D" I don't want to have DLQ. Expired Messages shall not be kept.
So I add the following:
<policyEntry queue="D" producerFlowControl="true" memoryLimit="10mb">
  <deadLetterStrategy processExpired="false" />
</policyEntry>

When I restart ActiveMQ to re-read the configuration it throws the exception
below.
How do I configure different dead letter strategies for different queues?

Many thanks for your help.

Regards
Jan


ERROR: java.lang.Exception:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class
path resource [activemq.xml]: Cannot create inner bean '(inner bean)' of
type [org.apache.activemq.broker.region.policy.PolicyMap] while setting bean
property 'destinationPolicy'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name '(inner bean)#2' defined in class path resource [activemq.xml]:
Cannot create inner bean 'policyEntry#922804' of type
[org.apache.activemq.broker.region.policy.PolicyEntry] while setting bean
property 'policyEntries' with key [2]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'policyEntry#922804' defined in class path resource
[activemq.xml]: Initialization of bean failed; nested exception is
org.springframework.beans.TypeMismatchException: Failed to convert property
value of type [java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy'; nested exception is
java.lang.IllegalArgumentException: Cannot convert value of type
[java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy': no matching editors or conversion strategy found
java.lang.Exception:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class
path resource [activemq.xml]: Cannot create inner bean '(inner bean)' of
type [org.apache.activemq.broker.region.policy.PolicyMap] while setting bean
property 'destinationPolicy'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name '(inner bean)#2' defined in class path resource [activemq.xml]:
Cannot create inner bean 'policyEntry#922804' of type
[org.apache.activemq.broker.region.policy.PolicyEntry] while setting bean
property 'policyEntries' with key [2]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'policyEntry#922804' defined in class path resource
[activemq.xml]: Initialization of bean failed; nested exception is
org.springframework.beans.TypeMismatchException: Failed to convert property
value of type [java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy'; nested exception is
java.lang.IllegalArgumentException: Cannot convert value of type
[java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy': no matching editors or conversion strategy found
	at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:99)
	at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
	at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:129)
	at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
	at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:79)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.activemq.console.Main.runTaskClass(Main.java:251)
	at org.apache.activemq.console.Main.main(Main.java:107)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at
org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0'
defined in class path resource [activemq.xml]: Cannot create inner bean
'(inner bean)' of type [org.apache.activemq.broker.region.policy.PolicyMap]
while setting bean property 'destinationPolicy'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name '(inner bean)#2' defined in class path resource [activemq.xml]:
Cannot create inner bean 'policyEntry#922804' of type
[org.apache.activemq.broker.region.policy.PolicyEntry] while setting bean
property 'policyEntries' with key [2]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'policyEntry#922804' defined in class path resource
[activemq.xml]: Initialization of bean failed; nested exception is
org.springframework.beans.TypeMismatchException: Failed to convert property
value of type [java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy'; nested exception is
java.lang.IllegalArgumentException: Cannot convert value of type
[java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy': no matching editors or conversion strategy found
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
	at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
	at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
	at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
	at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
	at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
	at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:96)
	at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:52)
	at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
	at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
	at
org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
	at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74)
	... 16 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '(inner bean)#2' defined in class path resource
[activemq.xml]: Cannot create inner bean 'policyEntry#922804' of type
[org.apache.activemq.broker.region.policy.PolicyEntry] while setting bean
property 'policyEntries' with key [2]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'policyEntry#922804' defined in class path resource
[activemq.xml]: Initialization of bean failed; nested exception is
org.springframework.beans.TypeMismatchException: Failed to convert property
value of type [java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy'; nested exception is
java.lang.IllegalArgumentException: Cannot convert value of type
[java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy': no matching editors or conversion strategy found
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287)
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)
	... 39 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'policyEntry#922804' defined in class path resource
[activemq.xml]: Initialization of bean failed; nested exception is
org.springframework.beans.TypeMismatchException: Failed to convert property
value of type [java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy'; nested exception is
java.lang.IllegalArgumentException: Cannot convert value of type
[java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy': no matching editors or conversion strategy found
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)
	... 49 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to
convert property value of type [java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy'; nested exception is
java.lang.IllegalArgumentException: Cannot convert value of type
[java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy': no matching editors or conversion strategy found
	at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
	... 53 more
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type
[java.lang.String] to required type
[org.apache.activemq.broker.region.policy.DeadLetterStrategy] for property
'deadLetterStrategy': no matching editors or conversion strategy found
	at
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
	at
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
	at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
	... 57 more






-- 
View this message in context: http://old.nabble.com/Different-deadLetterStrategies-for-different-queues-tp28106200p28106200.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message