You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by rdifrango <rd...@captechconsulting.com> on 2014/02/20 19:08:53 UTC

Broker Configuration - Redlivery Policy

I'm trying to set a global redilvery policy that anytime there is a failure
on my Message Listeners [via Spring] that all errors land in a single error
queue.  I trying to do so, I'm getting a failure upon reading my XML file
that I'm using to configure my broker.

My environment is:

Active MQ 5.9
Spring 3.2.4

Here is the config file [please note it works fine without the
<plugins><redeliveryPlugin> block:

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
  http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd">

	
	<bean
	
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<value>file:${activemq.conf}/credentials.properties</value>
		</property>
	</bean>

	
	<broker xmlns="http://activemq.apache.org/schema/core" useJmx="false"
		brokerName="localhost" persistent="true" dataDirectory="${activemq.data}">

		<destinationPolicy>
			<policyMap>
				<policyEntries>
					<policyEntry topic=">">
						
						<pendingMessageLimitStrategy>
							<constantPendingMessageLimitStrategy
								limit="1000" />
						</pendingMessageLimitStrategy>
					</policyEntry>
				</policyEntries>
			</policyMap>
		</destinationPolicy>

		
		<managementContext>
			<managementContext createConnector="false" />
		</managementContext>

		
		<persistenceAdapter>
			<kahaDB directory="${activemq.data}/kahadb" />
		</persistenceAdapter>

		<plugins>
			<redeliveryPlugin sendToDlqIfMaxRetriesExceeded="true">
				<redeliveryPolicyMap>
					<redeliveryPolicyMap>
						<defaultEntry>
							<redeliveryPolicy initialRedeliveryDelay="5000"
maximumRedeliveries="1" queue="error.epf.audit.queue"/>
						</defaultEntry>
					</redeliveryPolicyMap>
				</redeliveryPolicyMap>
			</redeliveryPlugin>
		</plugins>

		
		<systemUsage>
			<systemUsage>
				<memoryUsage>
					<memoryUsage percentOfJvmHeap="70" />
				</memoryUsage>
				<storeUsage>
					<storeUsage limit="100 gb" />
				</storeUsage>
				<tempUsage>
					<tempUsage limit="50 gb" />
				</tempUsage>
			</systemUsage>
		</systemUsage>

		
		<transportConnectors>
			
			<transportConnector name="openwire"
			
uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"
/>
		</transportConnectors>

		
		<shutdownHooks>
			<bean xmlns="http://www.springframework.org/schema/beans"
class="org.apache.activemq.hooks.SpringContextHook" />
		</shutdownHooks>

	</broker>

</beans>



--
View this message in context: http://activemq.2283324.n4.nabble.com/Broker-Configuration-Redlivery-Policy-tp4678217.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Broker Configuration - Redlivery Policy

Posted by rdifrango <rd...@captechconsulting.com>.
I did look at that and no matter the options that I tried none worked.

I just went with what I’ll call is a “default” strategy meaning I’m listening on the DLQ queue instead of a custom one.


From: "ceposta [via ActiveMQ]" <ml...@n4.nabble.com>>
Date: Fri, 28 Feb 2014 16:17:10 -0800
To: Ron Difrango <rd...@captechconsulting.com>>
Subject: Re: Broker Configuration - Redlivery Policy

well, i would take a look here about how redelivery works:
https://activemq.apache.org/redelivery-policy.html

essentially, a poison pill will be placed into a DLQ. check the docs
on DLQ for configuring your use case

On Sun, Feb 23, 2014 at 9:07 PM, rdifrango
<[hidden email]</user/SendEmail.jtp?type=node&node=4678433&i=0>> wrote:

> It seems as if, if I use the broker.start() method things are BETTER.
>
> I still get this error when I'm trying to set a specific destination.
>
> One other thing is that if my Spring Message List tosses an exception
> because it can't write to the database the message seem to STOP flowing to
> it.
>
> Instead of queue of my own, should I just be listening to ActiveMQ.DLQ?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Broker-Configuration-Redlivery-Policy-tp4678217p4678293.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



--
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta
http://www.christianposta.com/blog


________________________________
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/Broker-Configuration-Redlivery-Policy-tp4678217p4678433.html
To unsubscribe from Broker Configuration - Redlivery Policy, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4678217&code=cmRpZnJhbmdvQGNhcHRlY2hjb25zdWx0aW5nLmNvbXw0Njc4MjE3fDg5NzUyNTQ1OQ==>.
NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://activemq.2283324.n4.nabble.com/Broker-Configuration-Redlivery-Policy-tp4678217p4678436.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Broker Configuration - Redlivery Policy

Posted by Christian Posta <ch...@gmail.com>.
well, i would take a look here about how redelivery works:
https://activemq.apache.org/redelivery-policy.html

essentially, a poison pill will be placed into a DLQ. check the docs
on DLQ for configuring your use case

On Sun, Feb 23, 2014 at 9:07 PM, rdifrango
<rd...@captechconsulting.com> wrote:
> It seems as if, if I use the broker.start() method things are BETTER.
>
> I still get this error when I'm trying to set a specific destination.
>
> One other thing is that if my Spring Message List tosses an exception
> because it can't write to the database the message seem to STOP flowing to
> it.
>
> Instead of queue of my own, should I just be listening to ActiveMQ.DLQ?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Broker-Configuration-Redlivery-Policy-tp4678217p4678293.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Re: Broker Configuration - Redlivery Policy

Posted by rdifrango <rd...@captechconsulting.com>.
It seems as if, if I use the broker.start() method things are BETTER. 

I still get this error when I'm trying to set a specific destination.  

One other thing is that if my Spring Message List tosses an exception
because it can't write to the database the message seem to STOP flowing to
it.

Instead of queue of my own, should I just be listening to ActiveMQ.DLQ?



--
View this message in context: http://activemq.2283324.n4.nabble.com/Broker-Configuration-Redlivery-Policy-tp4678217p4678293.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Broker Configuration - Redlivery Policy

Posted by rdifrango <rd...@captechconsulting.com>.
And just for completeness, here is what the exception says:

java.lang.IllegalStateException: BeanFactory not initialized or already
closed - call 'refresh' before accessing beans via the ApplicationContext

My code to fire up the broker looks like:

BrokerService activeMqBroker = BrokerFactory.createBroker(uri);
activeMqBroker.setUseShutdownHook(true);
activeMqBroker.startAllConnectors();



--
View this message in context: http://activemq.2283324.n4.nabble.com/Broker-Configuration-Redlivery-Policy-tp4678217p4678218.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.