You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by pratibhaG <pr...@in2m.com> on 2008/11/12 08:25:11 UTC
Problem when using brokerName attribute
Hi,
I am using activemq inside servicemix.
In my activemq.xml I have following configuration.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:amq="http://activemq.org/config/1.0">
<amq:broker id="broker" depends-on="jmxServer" useShutdownHook="false">
<amq:managementContext>
<bean class="org.apache.activemq.broker.jmx.ManagementContext">
<property name="createConnector" value="false" />
</bean>
</amq:managementContext>
<amq:persistenceAdapter>
<amq:jdbcPersistenceAdapter dataSource="#activemq-ds"/>
</amq:persistenceAdapter>
<amq:transportConnectors>
<amq:transportConnector uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
</amq:transportConnectors>
<amq:networkConnectors>
</amq:networkConnectors>
<amq:destinations>
<amq:queue physicalName="resolved.error.queue" />
</amq:destinations>
</amq:broker>
<bean id="activemq-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="${driverClassName}"/>
<property name="url" value="${jdbcURL}"/>
<property name="username" value="${username}"/>
<property name="password" value="${password}"/>
<property name="poolPreparedStatements"
value="${poolPreparedStatements}"/>
</bean>
</beans>
when I changed the line
<amq:broker id="broker" depends-on="jmxServer" useShutdownHook="false">
to
<amq:broker id="broker" brokerName= "myBroker" depends-on="jmxServer"
useShutdownHook="false">
I have just added a new attribute brokerName
I see the strange behavior:
This is what happens when I don't use the brokerName= "myBroker" attribute.:
Servicemix keeps all the data in its data directory. When I delete data
directory I lose every data that I had. So after deleting data directory my
servicemix would be fresh to create new data on startup.
This is what happens when I use the brokerName= "myBroker" attribute.:
Servicemix keeps all the data in its data directory. When I delete data
directory some data is persisting. So after deleting data directory my
servicemix would not be fresh it still gets some of the data that I had
earlier.
Why is it so?
What the attribute brokerName do? When to use it and when not? Is it
responsible for data persistent?
-----Pratibha
--
View this message in context: http://www.nabble.com/Problem-when-using-brokerName-attribute-tp20455380p20455380.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Problem when using brokerName attribute
Posted by Dejan Bosanac <de...@ttmsolutions.com>.
It shouldn't do anything special to your broker ...
You can also try setting dataDirectory to the <amq:broker> element.
Anyhow, since you are using relational database for the storage, are you
sure you're starting your broker with a clean database (in case you are
not using Derby)?
If you are using Derby, databaseName property is actually a folder name
where the database is created.
Cheers
--
Dejan Bosanac
http://www.ttmsolutions.com - get a free ActiveMQ user guide
ActiveMQ in Action - http://www.manning.com/snyder/
Scripting in Java - http://www.scriptinginjava.net
pratibhaG wrote:
> It did not solve the problem.
>
> I am just wondered about the magic brokerName does.
>
> I want to know what happens when we set this attribute.
>
> Please provide me some documentation.
>
Re: Problem when using brokerName attribute
Posted by pratibhaG <pr...@in2m.com>.
It did not solve the problem.
I am just wonder about the magic brokerName does.
I want to know what happens when we set this attribute.
Please provide me some documentation.
--
View this message in context: http://www.nabble.com/Problem-when-using-brokerName-attribute-tp20455380p20456419.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Problem when using brokerName attribute
Posted by Dejan Bosanac <de...@ttmsolutions.com>.
Hi,
try controlling your data directory explicitly with the dataDirectory
parameter. For example:
<journaledJDBC dataDirectory="../activemq-data" dataSource="#activemq-ds"/>
Cheers
--
Dejan Bosanac
http://www.ttmsolutions.com - get a free ActiveMQ user guide
ActiveMQ in Action - http://www.manning.com/snyder/
Scripting in Java - http://www.scriptinginjava.net
pratibhaG wrote:
> Hi,
> I am using activemq inside servicemix.
>
> In my activemq.xml I have following configuration.
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <beans xmlns:amq="http://activemq.org/config/1.0">
>
>
> <amq:broker id="broker" depends-on="jmxServer" useShutdownHook="false">
>
>
> <amq:managementContext>
> <bean class="org.apache.activemq.broker.jmx.ManagementContext">
> <property name="createConnector" value="false" />
> </bean>
> </amq:managementContext>
>
>
> <amq:persistenceAdapter>
>
> <amq:jdbcPersistenceAdapter dataSource="#activemq-ds"/>
>
> </amq:persistenceAdapter>
>
> <amq:transportConnectors>
>
> <amq:transportConnector uri="tcp://localhost:61616"
> discoveryUri="multicast://default"/>
> </amq:transportConnectors>
>
> <amq:networkConnectors>
>
> </amq:networkConnectors>
>
> <amq:destinations>
> <amq:queue physicalName="resolved.error.queue" />
> </amq:destinations>
> </amq:broker>
>
> <bean id="activemq-ds" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
> <property name="driverClassName" value="${driverClassName}"/>
> <property name="url" value="${jdbcURL}"/>
> <property name="username" value="${username}"/>
> <property name="password" value="${password}"/>
> <property name="poolPreparedStatements"
> value="${poolPreparedStatements}"/>
> </bean>
>
> </beans>
>
>
> when I changed the line
> <amq:broker id="broker" depends-on="jmxServer" useShutdownHook="false">
> to
> <amq:broker id="broker" brokerName= "myBroker" depends-on="jmxServer"
> useShutdownHook="false">
>
> I have just added a new attribute brokerName
>
> I see the strange behavior:
>
> This is what happens when I don't use the brokerName= "myBroker" attribute.:
> Servicemix keeps all the data in its data directory. When I delete data
> directory I lose every data that I had. So after deleting data directory my
> servicemix would be fresh to create new data on startup.
>
> This is what happens when I use the brokerName= "myBroker" attribute.:
> Servicemix keeps all the data in its data directory. When I delete data
> directory some data is persisting. So after deleting data directory my
> servicemix would not be fresh it still gets some of the data that I had
> earlier.
>
> Why is it so?
> What the attribute brokerName do? When to use it and when not? Is it
> responsible for data persistent?
>
> -----Pratibha
>
>
>