You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by stephanion2002 <st...@gmail.com> on 2010/09/08 12:54:41 UTC

How to store everything in DB

Hi,

In our project, we have configured Mysql to be used in place of ActiveMQ's
KahaDB by configuring the ActiveMQ's config file. Now, we have to store all
the info for all the topics, queues, and passed messages etc. in mysql. How
can we do that. Do we have to do all that through our java code or are there
any configurations available which can be done at the Activemq side.

Many thanks,
Kshitiz Garg 
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2531110.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to store everything in DB

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi Tobias,

there's a little utility class that can help you with that

https://fisheye6.atlassian.com/browse/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/GenerateJDBCStatements.java?r=HEAD

but generally, it's better to create it on the dev db and then dump
ddls you need

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 Wed, Sep 29, 2010 at 1:40 PM, Tobias Trelle
<to...@codecentric.de> wrote:
>
>
> Gary Tully wrote:
>>
>> ActiveMQ will create all the relevant tables automatically at startup.
>>
>
> In case the ActiveMQ db user does not have the permission to create tables
> (what most db admins will prefer), is there a DDL script (or at least a
> table description) that creates the tables in advance? Depending on the size
> of the messages, it might be important to set table spaces etc.
>
> TIA,
> Tobias
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2718802.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: How to store everything in DB

Posted by Tobias Trelle <to...@codecentric.de>.

Gary Tully wrote:
> 
> ActiveMQ will create all the relevant tables automatically at startup.
> 

In case the ActiveMQ db user does not have the permission to create tables
(what most db admins will prefer), is there a DDL script (or at least a
table description) that creates the tables in advance? Depending on the size
of the messages, it might be important to set table spaces etc.

TIA,
Tobias

-- 
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2718802.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to store everything in DB

Posted by Gary Tully <ga...@gmail.com>.
ActiveMQ will create all the relevant tables automatically at startup.

On 8 September 2010 11:54, stephanion2002 <st...@gmail.com> wrote:
>
> Hi,
>
> In our project, we have configured Mysql to be used in place of ActiveMQ's
> KahaDB by configuring the ActiveMQ's config file. Now, we have to store all
> the info for all the topics, queues, and passed messages etc. in mysql. How
> can we do that. Do we have to do all that through our java code or are there
> any configurations available which can be done at the Activemq side.
>
> Many thanks,
> Kshitiz Garg
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2531110.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: How to monitor queue size programmatically?

Posted by Don Santillan <do...@gmail.com>.
Hello,

I saw the unit test and noticed that the mbeanServer was derived from 
the broker instance which is BrokerService type.

In my case, I am not using BrokerService. My producer/consumer is using 
"vm" protocol, such as "vm://localbroker".

How am I able to get a reference to my broker in this setup so that I 
can get a reference to the mbeanServer?

Also note that in my test (patterned to MBeanTest.java), where I am 
using BrokerService as a broker, the line "mbeanServer = 
broker.getManagementContext().getMBeanServer();" throws a compilation 
error that says "The method getMBeanServer() from the type 
ManagementContext is not visible". So I tried using "mbeanServer = 
broker.getManagementContext().findTigerMBeanServer();" and it still 
worked in my test.

-don

Dejan Bosanac wrote:
> Also checkout unit test, like this one
>
> http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java?view=markup
>
> to see how to do it programatically.
>
> 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 Wed, Sep 8, 2010 at 2:51 PM, Tracy Snell <ts...@gmail.com> wrote:
>   
>> That info is exposed through JMX. Fire up jconsole and browse and you'll see it.
>>
>> On Sep 8, 2010, at 8:47 AM, Don Santillan wrote:
>>
>>     
>>> Hello,
>>>
>>> Is there a way to monitor or count the queue size programmatically?
>>>
>>> Can I see a sample code snippet?
>>>
>>> Thanks!
>>> Don
>>>       
>>     
>
>   

Re: How to monitor queue size programmatically?

Posted by Dejan Bosanac <de...@nighttale.net>.
Also checkout unit test, like this one

http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java?view=markup

to see how to do it programatically.

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 Wed, Sep 8, 2010 at 2:51 PM, Tracy Snell <ts...@gmail.com> wrote:
> That info is exposed through JMX. Fire up jconsole and browse and you'll see it.
>
> On Sep 8, 2010, at 8:47 AM, Don Santillan wrote:
>
>> Hello,
>>
>> Is there a way to monitor or count the queue size programmatically?
>>
>> Can I see a sample code snippet?
>>
>> Thanks!
>> Don
>
>

Re: How to monitor queue size programmatically?

Posted by Tracy Snell <ts...@gmail.com>.
That info is exposed through JMX. Fire up jconsole and browse and you'll see it.

On Sep 8, 2010, at 8:47 AM, Don Santillan wrote:

> Hello,
> 
> Is there a way to monitor or count the queue size programmatically?
> 
> Can I see a sample code snippet?
> 
> Thanks!
> Don


Re: How to monitor queue size programmatically?

Posted by stephanion2002 <st...@gmail.com>.
Don,

Gary has just told me today to explore these for queue monitoring and
all.....and we are still exploring :)

http://activemq.apache.org/mirrored-queues.html
http://activemq.apache.org/virtual-destinations.html
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2531237.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

How to monitor queue size programmatically?

Posted by Don Santillan <do...@gmail.com>.
Hello,

Is there a way to monitor or count the queue size programmatically?

Can I see a sample code snippet?

Thanks!
Don

Re: How to store everything in DB

Posted by stephanion2002 <st...@gmail.com>.
Thanks Gary ! I will explore it and reply on the thread.
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2531195.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to store everything in DB

Posted by Gary Tully <ga...@gmail.com>.
look at the tests:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/

On 8 September 2010 14:11, stephanion2002 <st...@gmail.com> wrote:
>
>
> Gary Tully wrote:
>>
>> Look at virtual destinations, you can configure a destination mirror:
>> http://activemq.apache.org/mirrored-queues.html
>> http://activemq.apache.org/virtual-destinations.html
>>
>> On 8 September 2010 13:04, stephanion2002 <st...@gmail.com>
>> wrote:
>>>
>>> Thanks Gary,
>>>
>>> Actually we need to store some "important" messages even after they are
>>> delivered to a subscriber of a topic. Seems they get deleted after the
>>> delivery.
>>>
>>> Kshitiz
>>> --
>>> View this message in context:
>>> http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2531177.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>
>>
>>
>> --
>> http://blog.garytully.com
>>
>> Open Source Integration
>> http://fusesource.com
>>
>>
>
> Gary,
>
> are there any sample app/code available for such a requirement.
>
> Thanks!
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2531252.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: How to store everything in DB

Posted by stephanion2002 <st...@gmail.com>.

Gary Tully wrote:
> 
> Look at virtual destinations, you can configure a destination mirror:
> http://activemq.apache.org/mirrored-queues.html
> http://activemq.apache.org/virtual-destinations.html
> 
> On 8 September 2010 13:04, stephanion2002 <st...@gmail.com>
> wrote:
>>
>> Thanks Gary,
>>
>> Actually we need to store some "important" messages even after they are
>> delivered to a subscriber of a topic. Seems they get deleted after the
>> delivery.
>>
>> Kshitiz
>> --
>> View this message in context:
>> http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2531177.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 
> 

Gary, 

are there any sample app/code available for such a requirement. 

Thanks!
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2531252.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to store everything in DB

Posted by Gary Tully <ga...@gmail.com>.
Look at virtual destinations, you can configure a destination mirror:
http://activemq.apache.org/mirrored-queues.html
http://activemq.apache.org/virtual-destinations.html

On 8 September 2010 13:04, stephanion2002 <st...@gmail.com> wrote:
>
> Thanks Gary,
>
> Actually we need to store some "important" messages even after they are
> delivered to a subscriber of a topic. Seems they get deleted after the
> delivery.
>
> Kshitiz
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2531177.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: How to store everything in DB

Posted by stephanion2002 <st...@gmail.com>.
Thanks Gary,

Actually we need to store some "important" messages even after they are
delivered to a subscriber of a topic. Seems they get deleted after the
delivery.

Kshitiz
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-store-everything-in-DB-tp2531110p2531177.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.