activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rathna <rathnadevi.331...@gmail.com>
Subject Re: Different deadLetterStrategies for different queues
Date Mon, 11 Mar 2013 06:06:50 GMT
Gary Tully <gary.tully@...> 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 <jandev@...> 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?




Mime
View raw message