Greetings again, Dejan: I tried setting up another Remote broker using the 5.40 release, just dropping my existing configuration files into place.
I'm getting this parsing error on startup: ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 86 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'amq:destinationPolicy'. One of '{"http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:producerSystemUsage, "http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:proxyConnectors, "http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:regionBroker, "http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:services, "http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:shutdownHooks, "http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:sslContext, "http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:systemUsage, "http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:taskRunnerFactory, "http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:tempDataStore, "http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:transportConnectorURIs, "http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>:transportConnectors, WC[##other:"http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core>]}' is expected. The content of my activemq.xml is pasted below. Even though i'm forcing the schemaLocation to http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd, is AMQ trying to validate teh file against the 5.4.0 schema? <beans xmlns="http://www.springframework.org/schema/beans"<http://www.springframework.org/schema/beans> xmlns:amq="http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<http://www.w3.org/2001/XMLSchema-instance> xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd"> <!-- Allows us to use system properties as variables in this configuration file. For more information, see the Javadoc: http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>file:${activemq.base}/conf/messaging.conf</value> <value>file:${activemq.base}/conf/credentials.properties</value> </list> </property> </bean> <!-- The <broker> element is used to configure the ActiveMQ broker. Tips: - Change the brokerName attribute to something unique --> <broker xmlns="http://activemq.apache.org/schema/core"<http://activemq.apache.org/schema/core> brokerName="${ApplianceID}" useJmx="true" advisorySupport="true" dataDirectory="${activemq.base}/data"> <!-- Define Queue and Topic Names --> <destinations> <!-- for remote_messaging app --> <queue physicalName="org.nwea.queues.local.inbound.notifications_and_alerts"/> <queue physicalName="org.nwea.queues.local.internal.invalidmessages"/> <queue physicalName="org.nwea.queues.local.internal.updated_entities_to_mto"/> <queue physicalName="org.nwea.queues.local.internal.notifications_and_alerts"/> <queue physicalName="org.nwea.queues.local.internal.from_central.hold_for_upgrade"/> <queue physicalName="org.nwea.queues.local.outbound.data_updates"/> <!-- for Reports app --> <queue physicalName="inbound.rptreq.q"/> <queue physicalName="internal.largerptreq.q"/> <queue physicalName="internal.rptreq.q"/> <queue physicalName="inbound.tt2etl.q"/> <queue physicalName="internal.tt2etl.q"/> </destinations> <plugins> <jaasAuthenticationPlugin configuration="activemq-domain"/> <authorizationPlugin> <map> <authorizationMap> <authorizationEntries> <authorizationEntry topic=">" read="admins" write="admins" admin="admins"/> <authorizationEntry topic="ActiveMQ.Advisory.>" read="remotepeer" write="remotepeer" admin="remotepeer"/> <authorizationEntry topic="org.nwea.topics.>" write="remotepeer" admin="remotepeer"/> <authorizationEntry queue=">" read="admins" write="admins" admin="admins"/> <authorizationEntry queue="org.nwea.queues.central.>" read="remotepeer" admin="remotepeer"/> </authorizationEntries> </authorizationMap> </map> </authorizationPlugin> </plugins> <!-- Examples of destination-specific policies using destination names or wildcards. For more information, see: http://activemq.apache.org/per-destination-policies.html http://activemq.apache.org/destination-features.html http://activemq.apache.org/slow-consumer-handling.html http://activemq.apache.org/subscription-recovery-policy.html --> <destinationPolicy> <policyMap> <policyEntries> <!-- originally set to 5mb --> <policyEntry queue=">" producerFlowControl="true" memoryLimit="${remote_baseQueueMemory}mb"/> <policyEntry topic=">" producerFlowControl="true" memoryLimit="${remote_baseTopicMemory}mb"> <dispatchPolicy> <!-- Use total ordering, see: http://activemq.apache.org/total-ordering.html --> <strictOrderDispatchPolicy/> </dispatchPolicy> <subscriptionRecoveryPolicy> <!-- Upon subscription, receive the last image sent on the destination. --> <lastImageSubscriptionRecoveryPolicy/> </subscriptionRecoveryPolicy> </policyEntry> <!-- nwea dead letter policy --> <!-- http://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd.html --> <!-- originally set to 100mb --> <policyEntry queue="org.nwea.>" memoryLimit="${remote_deadLetterQueueMemory}mb"> <deadLetterStrategy> <individualDeadLetterStrategy processExpired="true" processNonPersistent="true" queuePrefix="nwea_dlq_queue."> </individualDeadLetterStrategy> </deadLetterStrategy> </policyEntry> <!-- originally set to 100mb --> <policyEntry topic="org.nwea.>" memoryLimit="${remote_deadLetterTopicMemory}mb"> <deadLetterStrategy> <individualDeadLetterStrategy processExpired="true" processNonPersistent="true" topicPrefix="nwea_dlq_topic."> </individualDeadLetterStrategy> </deadLetterStrategy> </policyEntry> </policyEntries> </policyMap> </destinationPolicy> <!-- The managementContext is used to configure how ActiveMQ is exposed in JMX. By default, ActiveMQ uses the MBean server that is started by the JVM. For more information, see: http://activemq.apache.org/jmx.html --> <managementContext> <!-- originally set to true, port 1199 --> <managementContext createConnector="${remote_enableJmx}" connectorPort="${remote_jmxConnectorPort}"/> </managementContext> <!-- The network connectors are used to create a network of brokers. For more information, see: http://activemq.apache.org/networks-of-brokers.html --> <networkConnectors> <networkConnector name="${ApplianceID}" userName="${networkConnectorUserName}" password="${networkConnectorPassword}" uri="static://(ssl://${Central.ServerHostname}:${central_sslPortNumber})" duplex="true" dynamicOnly="true"> <dynamicallyIncludedDestinations> <queue physicalName="org.nwea.queues.central.>"/> <topic physicalName="org.nwea.topics.>"/> </dynamicallyIncludedDestinations> <staticallyIncludedDestinations> <queue physicalName="org.nwea.queues.central.>"/> <topic physicalName="org.nwea.topics.>"/> </staticallyIncludedDestinations> </networkConnector> </networkConnectors> <!-- Configure message persistence for the broker. The default persistence mechanism is the AMQ store (identified by the amqPersistenceAdapter). For more information, see: http://activemq.apache.org/persistence.html --> <persistenceAdapter> <kahaDB directory="${activemq.base}/data/${ApplianceID}/kahadb" indexWriteBatchSize="1000" enableIndexWriteAsync="true" enableJournalDiskSyncs="false"/> </persistenceAdapter> <!-- ssl configuration --> <sslContext> <sslContext keyStore="file:${activemq.base}/conf/broker.ks"<file:${activemq.base}/conf/broker.ks> keyStorePassword="password" trustStore="file:${activemq.base}/conf/broker.ts"<file:${activemq.base}/conf/broker.ts> trustStorePassword="password"/> </sslContext> <!-- The systemUsage controls the maximum amount of space the broker will use before slowing down producers. For more information, see: http://activemq.apache.org/producer-flow-control.html --> <systemUsage> <systemUsage> <memoryUsage> <!-- originally set to 100 mb --> <memoryUsage limit="${remote_systemMemoryUsage} mb"/> </memoryUsage> <storeUsage> <!-- originally set to 1 gb --> <storeUsage limit="${remote_systemStoreUsage} gb"/> </storeUsage> <tempUsage> <!-- originally set to 200 mb --> <tempUsage limit="${remote_systemTempUsage} mb"/> </tempUsage> </systemUsage> </systemUsage> <!-- The transport connectors expose ActiveMQ over a given protocol to clients and other brokers. For more information, see: http://activemq.apache.org/configuring-transports.html --> <transportConnectors> <!-- by convention we use 51616 and 51617 (for ssl) so as not to conflict with Geronimo's embedded ActiveMQ defaults (61616 & 61617) --> <transportConnector name="openwire" uri="tcp://0.0.0.0:${remote_openwirePortNumber}"/> <transportConnector name="ssl" uri="ssl://0.0.0.0:${remote_sslPortNumber}"/> </transportConnectors> </broker> <jetty xmlns="http://mortbay.com/schemas/jetty/1.0"<http://mortbay.com/schemas/jetty/1.0>> <connectors> <nioConnector port="8161"/> </connectors> <handlers> <webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/> </handlers> </jetty> <!-- CAMEL ROUTING CONFIGURATIONS --> <import resource="camel_remote_messaging.xml"/> <import resource="camel_reports.xml"/> </beans> Joe Niski IS Development | NWEA PHONE 503.212.3382 | FAX 503.639.7873 NWEA.ORG<3D%22http://www.nwea.org/%22> | Partnering to Help All Kids Learn On 08/17/2010 03:26 AM, Dejan Bosanac wrote: Hi Joe, this sounds like a bug. Did you tested it with some newer version of ActiveMQ (as there was a lot of work in that area since 5.0.3) Can you test newly released 5.4.0 http://repo1.maven.org/maven2/org/apache/activemq/apache-activemq/5.4.0/ and see if the problem still exists? If it's still there, it would be great if you could raise a Jira issue, ideally with a test case. Cheers -- Dejan Bosanac - http://twitter.com/dejanb Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Tue, Aug 17, 2010 at 2:00 AM, Joe Niski <joe.ni...@nwea.org><mailto:joe.ni...@nwea.org> wrote: > i have a network of 2 brokers, let's call them "Remote" and "Central", > running on ActiveMQ 5.0.3, in a store-and-forward configuration. i inherited > this setup, i did not design it, but it seems like a generally solid > configuration. > > On the Remote broker, there are topics (e.g. "org.nwea.topics.license") that > have durable subscriptions to topics of the same name on the Central broker. > Messages that are published to topics on the Central broker find their way to > Remote really fast - as long as the Remote is online when the message is > published. Messages that are published when Remote is offline are never > picked up by the remote. > > i have a j2ee application that contains MDBs that are annotated to have > durable subscriptions to the topics on the Remote broker. > > The NetworkConnector configuration in the Remote broker's activemq.xml looks > like this: > > <networkConnectors> > <networkConnector name="${ApplianceID}" > userName="${networkConnectorUserName}" > password="${networkConnectorPassword}" > > uri="static://(ssl://${Central.ServerHostname}:${central_sslPortNumber})" > duplex="true" > dynamicOnly="true"> > <dynamicallyIncludedDestinations> > <queue physicalName="org.nwea.queues.central.>"/> > <topic physicalName="org.nwea.topics.>"/> > </dynamicallyIncludedDestinations> > <staticallyIncludedDestinations> > <queue physicalName="org.nwea.queues.central.>"/> > <topic physicalName="org.nwea.topics.>"/> > </staticallyIncludedDestinations> > </networkConnector> > </networkConnectors> > > In reading through the book "ActiveMQ in Action" and reviewing the online > docs at http://activemq.apache.org/networks-of-brokers.html, it seems that we > should use the default setting for "dynamicOnly", "false" (the docs say "if > true, only forward messages if a consumer is active on the connected broker"). > > However, when i set "dynamicOnly" to false, i see numerous startup errors and > NullPointerExceptions in the Remote activemq.log, and connection errors in > Central's logs. The Remote log simply reads: > [DemandForwardingBridge.serviceLocalException]: Network connection between > vm://remotebroker.msg02.nweacolo.pvt#24 and > ssl://msg01.se.nweacolo.pvt/192.168.1.94:51617 shutdown due to a local error: > java.lang.NullPointerException > > With "dynamicOnly" set to true, the log shows that existing durable > subscriptions are reconnecting during startup. > > Playing with the "prefetchSize" and "networkTTL" attributes for > <networkConnector> on Remote (vaguely recommended in the docs) doesn't seem > to have any effect. > > This seems very similar to this issue from February 2009: > http://old.nabble.com/Confusion-about-dynamicOnly-NetworkConnector-property-td22211600.html, > which didn't seem to get resolved. > > Any insight, recommendations, or help are most appreciated. > -- > > Joe Niski > IS Development | NWEA > NWEA.ORG<3D%22http://www.nwea.org/%22> | Partnering to Help All Kids Learn >