You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jan Dev <ja...@gmx.ch> on 2010/04/01 11:40:46 UTC

Different deadLetterStrategies for different queues

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.


Re: Different deadLetterStrategies for different queues

Posted by Rathna <ra...@gmail.com>.
Gary Tully <ga...@...> writes:

> 
> For destination D you still need to specify a real/concrete strategy,
> either individualDeadLetterStrategy or shared will work:
> 
> <policyEntry queue="D" producerFlowControl="true" memoryLimit="10mb">
>  <deadLetterStrategy>
>    <individualDeadLetterStrategy processExpired="false"/>
>  </deadLetterStrategy>
> </policyEntry>
> 
> On 1 April 2010 10:40, Jan Dev <ja...@...> wrote:
> 
> >
> > 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.resolveInn
erBean(BeanDefinitionValueResolver.java:230)
> >        at
> >
> > 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveVal
ueIfNecessary(BeanDefinitionValueResolver.java:122)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app
lyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.pop
ulateBean(AbstractAutowireCapableBeanFactory.java:1010)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doC
reateBean(AbstractAutowireCapableBeanFactory.java:472)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.r
un(AbstractAutowireCapableBeanFactory.java:409)
> >        at java.security.AccessController.doPrivileged(Native Method)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre
ateBean(AbstractAutowireCapableBeanFactory.java:380)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Abstra
ctBeanFactory.java:264)
> >        at
> >
> > 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingle
ton(DefaultSingletonBeanRegistry.java:222)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract
BeanFactory.java:261)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe
anFactory.java:185)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe
anFactory.java:164)
> >        at
> >
> > 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstanti
ateSingletons(DefaultListableBeanFactory.java:429)
> >        at
> >
> > 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactory
Initialization(AbstractApplicationContext.java:728)
> >        at
> >
> > 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractA
pplicationContext.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(XBeanBroke
rFactory.java:96)
> >        at
> >
> > 
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.jav
a: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:1
15)
> >        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.resolveInn
erBean(BeanDefinitionValueResolver.java:230)
> >        at
> >
> > 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveVal
ueIfNecessary(BeanDefinitionValueResolver.java:117)
> >        at
> >
> > 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveMan
agedList(BeanDefinitionValueResolver.java:287)
> >        at
> >
> > 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveVal
ueIfNecessary(BeanDefinitionValueResolver.java:126)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app
lyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.pop
ulateBean(AbstractAutowireCapableBeanFactory.java:1010)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doC
reateBean(AbstractAutowireCapableBeanFactory.java:472)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.r
un(AbstractAutowireCapableBeanFactory.java:409)
> >        at java.security.AccessController.doPrivileged(Native Method)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre
ateBean(AbstractAutowireCapableBeanFactory.java:380)
> >        at
> >
> > 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInn
erBean(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.doC
reateBean(AbstractAutowireCapableBeanFactory.java:480)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.r
un(AbstractAutowireCapableBeanFactory.java:409)
> >        at java.security.AccessController.doPrivileged(Native Method)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre
ateBean(AbstractAutowireCapableBeanFactory.java:380)
> >        at
> >
> > 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInn
erBean(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.jav
a:391)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.con
vertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app
lyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.pop
ulateBean(AbstractAutowireCapableBeanFactory.java:1010)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doC
reateBean(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(TypeConverter
Delegate.java:231)
> >        at
> >
> > 
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverter
Delegate.java:138)
> >        at
> >
> > 
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.jav
a: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.
> >
> >
> 
Hi Gary,Can this be possible using a java dsl instead of changing the 
activemq.xml? using some bean class is it possible?




Re: Different deadLetterStrategies for different queues

Posted by Rathna <ra...@gmail.com>.
Hi,Is there a way to set deadletterstrategies in java dsl instead of 
configuring in activemq.xml.I don't want to touch any configuration settings in 
fuse.







Re: Different deadLetterStrategies for different queues

Posted by clar <cl...@hotmail.com>.
Gary Tully <ga...@...> writes:

> 
> For destination D you still need to specify a real/concrete strategy,
> either individualDeadLetterStrategy or shared will work:
> 
> <policyEntry queue="D" producerFlowControl="true" memoryLimit="10mb">
>  <deadLetterStrategy>
>    <individualDeadLetterStrategy processExpired="false"/>
>  </deadLetterStrategy>
> </policyEntry>
> 
> On 1 April 2010 10:40, Jan Dev <ja...@...> wrote:
> 
> >
> > 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:9
9)
> >        at
> >
> > 
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.
java:57)
> >        at
> >
> > 
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:1
29)
> >        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.resolv
eInnerBean(BeanDefinitionValueResolver.java:230)
> >        at
> >
> > 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolv
eValueIfNecessary(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(Ab
stractBeanFactory.java:264)
> >        at
> >
> > 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi
ngleton(DefaultSingletonBeanRegistry.java:222)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abst
ractBeanFactory.java:261)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
ctBeanFactory.java:185)
> >        at
> >
> > 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
ctBeanFactory.java:164)
> >        at
> >
> > 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
antiateSingletons(DefaultListableBeanFactory.java:429)
> >        at
> >
> > 
org.springframework.context.support.AbstractApplicationContext.finishBeanFac
toryInitialization(AbstractApplicationContext.java:728)
> >        at
> >
> > 
org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
actApplicationContext.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(XBeanB
rokerFactory.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.ja
va:115)
> >        at
> >
> > 
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:7
4)
> >        ... 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.resolv
eInnerBean(BeanDefinitionValueResolver.java:230)
> >        at
> >
> > 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolv
eValueIfNecessary(BeanDefinitionValueResolver.java:117)
> >        at
> >
> > 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolv
eManagedList(BeanDefinitionValueResolver.java:287)
> >        at
> >
> > 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolv
eValueIfNecessary(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.resolv
eInnerBean(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.resolv
eInnerBean(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(TypeConve
rterDelegate.java:231)
> >        at
> >
> > 
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConve
rterDelegate.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.
> >
> >
> 

Hi, I wanted to set dead message to a specific queue, at the same time 
discard expired message. Below is a snippet of my activemq.xml.

<destinationPolicy> 
      <policyMap> 
        <policyEntries> 
          <policyEntry queue=">" producerFlowControl="true" 
memoryLimit="1mb"> 
            <deadLetterStrategy> 
              <individualDeadLetterStrategy queuePrefix="DLQ." 
useQueueForQueueMessages="true" processExpired="false" 
processNonPersistent="false"/> 
            </deadLetterStrategy> 
            <pendingQueuePolicy> 
                <vmQueueCursor /> 
            </pendingQueuePolicy> 
          </policyEntry> 
        </policyEntries> 
      </policyMap> 
    </destinationPolicy>


But however, the message does not seems to be discarded even though I  had 
set time to live to 10 sec. It still goes to the specific DLQ. Any idea 
where has gone wrong? Many thanks.



Re: Different deadLetterStrategies for different queues

Posted by Gary Tully <ga...@gmail.com>.
For destination D you still need to specify a real/concrete strategy,
either individualDeadLetterStrategy or shared will work:

<policyEntry queue="D" producerFlowControl="true" memoryLimit="10mb">
 <deadLetterStrategy>
   <individualDeadLetterStrategy processExpired="false"/>
 </deadLetterStrategy>
</policyEntry>

On 1 April 2010 10:40, Jan Dev <ja...@gmx.ch> wrote:

>
> 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.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com