activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Shannon <christopher.l.shan...@gmail.com>
Subject Re: Redeliverypolicy per detination in Spring
Date Mon, 10 Aug 2015 15:47:43 GMT
You don't need a getter to call a setter with spring injection.  Your
problem is your attempting to call a protected setter.  Change your
redeliverPolicyMap configuration to:

<bean id="redeliveryPolicyMap"
class="org.apache.activemq.broker.region.policy.RedeliveryPolicyMap">
        <property name="*redeliveryPolicyEntries*">
                <list>
                        <ref bean="smsOutRedeliveryPolicy" />
                        <ref bean="smsInRedeliveryPolicy" />
                </list>
        </property>
</bean>

In RedeliveryPolicyMap, redeliveryPolicyEntries is a public setter so this
should work.

On Mon, Aug 10, 2015 at 7:16 AM, s.csaba <s.csaba@gmail.com> wrote:

> ActiveMQ 5.11.1
> Spring 4.1.1
>
> I'd like to configure redelivery policy per destination in spring xml. (Two
> queue with defferent policy.) The RedeliveryPolicyMap setEntries method
> seems to right for this. The javadoc says: "A helper method to allow the
> destination map to be populated from a dependency injection framework such
> as Spring"
>
> http://activemq.apache.org/maven/5.11.0/apidocs/org/apache/activemq/filter/DestinationMap.html#setEntries(java.util.List)
>
> But there is no getter metthod, so the spring framwork throw the following
> error message:
> "Caused by: org.springframework.beans.NotWritablePropertyException: Invalid
> property 'entries' of bean class
> [org.apache.activemq.broker.region.policy.RedeliveryPolicyMap]: Bean
> property 'entries' is not writable or has an invalid setter method. Does
> the
> parameter type of the setter match the return type of the getter?"
>
> The missing of RedeliveryPolicyMap.getEntries method is intentional or is a
> bug? Can I configure this some other way?
>
> spring configuration:
> <bean id="smsOut" class="org.apache.activemq.command.ActiveMQQueue">
>         <constructor-arg index="0" value="sms_out" />
> </bean>
> <bean id="smsIn" class="org.apache.activemq.command.ActiveMQQueue">
>         <constructor-arg index="0" value="sms_in" />
> </bean>
> <bean id="smsOutRedeliveryPolicy"
> class="org.apache.activemq.RedeliveryPolicy">
>     <property name="destination" ref="smsOut" />
>     <property name="maximumRedeliveries" value="10" />
> </bean>
> <bean id="smsInRedeliveryPolicy"
> class="org.apache.activemq.RedeliveryPolicy">
>     <property name="destination" ref="smsIn" />
>     <property name="maximumRedeliveries" value="1" />
> </bean>
> <bean id="redeliveryPolicyMap"
> class="org.apache.activemq.broker.region.policy.RedeliveryPolicyMap">
>         <property name="entries">
>                 <list>
>                         <ref bean="smsOutRedeliveryPolicy" />
>                         <ref bean="smsInRedeliveryPolicy" />
>                 </list>
>         </property>
> </bean>
> <bean id="amqConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>     <constructor-arg index="0" value="tcp://localhost:61616" />
>     <property name="redeliveryPolicyMap" ref="redeliveryPolicyMap"/>
> </bean>
> <bean id="connectionFactory"
> class="org.springframework.jms.connection.CachingConnectionFactory">
>     <constructor-arg ref="amqConnectionFactory" />
> </bean>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Redeliverypolicy-per-detination-in-Spring-tp4700640.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message