yep your transport connector doesn't use an activemq url but a tomee Resource Adapter one. Just follow AMQ doc: http://activemq.apache.org/configuring-version-5-transports.html (and tcp page since it seems that's what you want) Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau
2014-01-31 Leonardo K. Shikida <[email protected]>: > duh sorry > > here it is > > > <!-- Licensed to the Apache Software Foundation (ASF) under one or more > contributor license agreements. See the NOTICE file distributed with this > work for additional information regarding > copyright ownership. The ASF licenses this file to You under the > Apache License, Version 2.0 (the "License"); you may not use this file > except in compliance with the License. You may > obtain a copy of the License at > http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable > law or agreed to in writing, software distributed under the License is > distributed > on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, > either express or implied. See the License for the specific language > governing permissions and limitations under the > License. --> > <beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq=" > http://activemq.apache.org/schema/core" 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"> > > <!-- Allows us to use system properties as variables in this > configuration file --> > <!-- <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" > brokerName="localhost" dataDirectory="${activemq.data}"> > <!-- <destinationPolicy> --> > <!-- <policyMap> --> > <!-- <policyEntries> --> > <!-- <policyEntry queue=">" > producerFlowControl="false" prioritizedMessages="true" useCache="false" > expireMessagesPeriod="0" queuePrefetch="1" /> --> > <!-- <pendingQueuePolicy> --> > <!-- <vmQueueCursor /> --> > <!-- </pendingQueuePolicy> --> > <!-- </policyEntries> --> > <!-- </policyMap> --> > <!-- </destinationPolicy> --> > > <destinationPolicy> > <policyMap> > <policyEntries> > <policyEntry topic=">" producerFlowControl="true"> > <!-- The constantPendingMessageLimitStrategy is used to > prevent > slow topic consumers to block producers and affect > other consumers > by limiting the number of messages that are > retained > For more information, see: > > > http://activemq.apache.org/slow-consumer-handling.html > > --> > <pendingMessageLimitStrategy> > <constantPendingMessageLimitStrategy limit="1000"/> > </pendingMessageLimitStrategy> > </policyEntry> > <policyEntry queue=">" producerFlowControl="true" > memoryLimit="1mb"> > <!-- Use VM cursor for better latency > For more information, see: > > http://activemq.apache.org/message-cursors.html > > <pendingQueuePolicy> > <vmQueueCursor/> > </pendingQueuePolicy> > --> > </policyEntry> > </policyEntries> > </policyMap> > </destinationPolicy> > > > > <persistenceAdapter> > <jdbcPersistenceAdapter dataSource="#oracle-ds"/> > </persistenceAdapter> > > <systemUsage> > <systemUsage> > <memoryUsage> > <memoryUsage limit="128 mb" /> > </memoryUsage> > <storeUsage> > <storeUsage limit="100 gb" /> > </storeUsage> > <tempUsage> > <tempUsage limit="50 gb" /> > </tempUsage> > </systemUsage> > </systemUsage> > > <transportConnectors> > <transportConnector name="anythingHere" > uri="broker:(tcp://0.0.0.0:61616)?persistent=true"/> > </transportConnectors> > </broker> > > <bean id="oracle-ds" > class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> > <property name="driverClassName" > value="oracle.jdbc.OracleDriver"/> > <property name="url" value="jdbc:oracle:thin:@localhost > :1521:XE"/> > <property name="username" value="xxx"/> > <property name="password" value="xxx"/> > <property name="poolPreparedStatements" value="true"/> > </bean> > > </beans> > > > [] > > Leo > > > On Fri, Jan 31, 2014 at 3:22 PM, Romain Manni-Bucau > <[email protected]>wrote: > >> I was speaking about activemq.xml content, in connectors...like >> mentionned in the error >> Romain Manni-Bucau >> Twitter: @rmannibucau >> Blog: http://rmannibucau.wordpress.com/ >> LinkedIn: http://fr.linkedin.com/in/rmannibucau >> Github: https://github.com/rmannibucau >> >> >> >> 2014-01-31 Leonardo K. Shikida <[email protected]>: >> > no, that's my tomee.xml now >> > >> > <Resource id="Default JMS Resource Adapter" >> > type="ActiveMQResourceAdapter"> >> > BrokerXmlConfig = >> > >> xbean:file:/home/leoks/EclipseIndigo/workspace2/Servers/TomEE1.6.0-STABLE-config/activemq.xml >> > ServerUrl = tcp://0.0.0.0:61616 >> > </Resource> >> > >> > >> > [] >> > >> > Leo >> > >> > >> > On Fri, Jan 31, 2014 at 3:15 PM, Romain Manni-Bucau >> > <[email protected]>wrote: >> > >> >> you kept broker:tcp... url? this is an alternative to activemq.xml.... >> >> Romain Manni-Bucau >> >> Twitter: @rmannibucau >> >> Blog: http://rmannibucau.wordpress.com/ >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau >> >> Github: https://github.com/rmannibucau >> >> >> >> >> >> >> >> 2014-01-31 Leonardo K. Shikida <[email protected]>: >> >> > after adding kahadb from the maven repository and switching from >> >> > activemq-all to activemq-spring and defining the bean into >> activemq.xml >> >> as >> >> > >> >> > </broker> >> >> > >> >> > <bean id="oracle-ds" >> >> > class="org.apache.commons.dbcp.BasicDataSource" >> destroy-method="close"> >> >> > <property name="driverClassName" >> >> > value="oracle.jdbc.OracleDriver"/> >> >> > <property name="url" value="jdbc:oracle:thin:@localhost >> >> > :1521:XE"/> >> >> > <property name="username" value="xxx"/> >> >> > <property name="password" value="xxx"/> >> >> > <property name="poolPreparedStatements" value="true"/> >> >> > </bean> >> >> > >> >> > </beans> >> >> > >> >> > finally.... I am getting a new error >> >> > >> >> > SEVERE: Failed to load: URL >> >> > >> >> >> [file:/home/leoks/EclipseIndigo/workspace2/Servers/TomEE1.6.0-STABLE-config/activemq.xml], >> >> > reason: Error creating bean with name >> >> > 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in URL >> >> > >> >> >> [file:/home/leoks/EclipseIndigo/workspace2/Servers/TomEE1.6.0-STABLE-config/activemq.xml]: >> >> > Invocation of init method failed; nested exception is >> >> java.io.IOException: >> >> > Transport Connector could not be registered in JMX: Transport scheme >> NOT >> >> > recognized: [broker] >> >> > org.springframework.beans.factory.BeanCreationException: Error >> creating >> >> > bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' >> defined >> >> in >> >> > URL >> >> > >> >> >> [file:/home/leoks/EclipseIndigo/workspace2/Servers/TomEE1.6.0-STABLE-config/activemq.xml]: >> >> > Invocation of init method failed; nested exception is >> >> java.io.IOException: >> >> > Transport Connector could not be registered in JMX: Transport scheme >> NOT >> >> > recognized: [broker] >> >> > >> >> > after some google, some solutions seems to be related somehow to the >> >> > incapacity of activemq to load the XML (makes sense, since XML is a >> >> recent >> >> > technology, invented in 96, almost 20 years ago) >> >> > >> >> > I am pulling my hair off. >> >> > >> >> > I just want to give more memory to jms. >> >> > >> >> > :-( >> >> > >> >> > >> >> > >> >> > [] >> >> > >> >> > Leo >> >> > >> >> > >> >> > On Fri, Jan 31, 2014 at 2:37 PM, Leonardo K. Shikida < >> [email protected] >> >> >wrote: >> >> > >> >> >> I am almost there >> >> >> >> >> >> actually, I've included activemq-core-5.4.2.jar which seems to >> contain >> >> the >> >> >> desired class >> >> >> >> >> >> then I've added the absolute path to the activemq.xml file because I >> >> could >> >> >> not make it work from inside eclipse (I know, this is probably more >> like >> >> >> eclipse's fault) >> >> >> >> >> >> then I've changed some invalid XML such as >> >> >> >> >> >> <!-- <destinationPolicy> --> >> >> >> <!-- <policyMap> --> >> >> >> <!-- <policyEntries> --> >> >> >> <!-- <policyEntry queue=">" >> >> >> producerFlowControl="false" prioritizedMessages="true" >> useCache="false" >> >> >> expireMessagesPeriod="0" queuePrefetch="1" /> --> >> >> >> <!-- <pendingQueuePolicy> --> >> >> >> <!-- <vmQueueCursor /> --> >> >> >> <!-- </pendingQueuePolicy> --> >> >> >> <!-- </policyEntries> --> >> >> >> <!-- </policyMap> --> >> >> >> <!-- </destinationPolicy> --> >> >> >> >> >> >> and replaced with site's default >> >> >> >> >> >> <destinationPolicy> >> >> >> <policyMap> >> >> >> <policyEntries> >> >> >> <policyEntry topic=">" producerFlowControl="true"> >> >> >> <!-- The constantPendingMessageLimitStrategy is >> used >> >> >> to prevent >> >> >> slow topic consumers to block producers and >> >> >> affect other consumers >> >> >> by limiting the number of messages that are >> >> >> retained >> >> >> For more information, see: >> >> >> >> >> >> >> >> >> http://activemq.apache.org/slow-consumer-handling.html >> >> >> >> >> >> --> >> >> >> <pendingMessageLimitStrategy> >> >> >> <constantPendingMessageLimitStrategy >> limit="1000"/> >> >> >> </pendingMessageLimitStrategy> >> >> >> </policyEntry> >> >> >> <policyEntry queue=">" producerFlowControl="true" >> >> >> memoryLimit="1mb"> >> >> >> <!-- Use VM cursor for better latency >> >> >> For more information, see: >> >> >> >> >> >> >> http://activemq.apache.org/message-cursors.html >> >> >> >> >> >> <pendingQueuePolicy> >> >> >> <vmQueueCursor/> >> >> >> </pendingQueuePolicy> >> >> >> --> >> >> >> </policyEntry> >> >> >> </policyEntries> >> >> >> </policyMap> >> >> >> </destinationPolicy> >> >> >> >> >> >> and now it's just a matter of adjust the datasource from inside >> >> >> activemq.xml >> >> >> >> >> >> >> >> >> <persistenceAdapter> >> >> >> <jdbcPersistenceAdapter >> dataSource="#MyDataSource"/> >> >> >> </persistenceAdapter> >> >> >> >> >> >> >> >> >> I'll try activemq-spring-[version].jar soon, since core will probably >> >> give >> >> >> me more headaches when the classloader try to load some classes >> twice. >> >> >> >> >> >> Almost there, people, thanks for your help again >> >> >> >> >> >> >> >> >> [] >> >> >> >> >> >> Leo >> >> >> >> >> >> >> >> >> On Fri, Jan 31, 2014 at 2:31 PM, Andy < >> [email protected] >> >> >wrote: >> >> >> >> >> >>> A simple google reveals 'activemq-spring-[version].jar' - Add that >> to >> >> >>> your path and it should work. >> >> >>> >> >> >>> >> >> >> >> >> >>
