Forum Home » Fuse Distributions » Fuse Message Broker

Thread: jdbc master/slave groups of brokers sharing the same database instance

 
This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Mar 19, 2012 9:21 PM Last Post By: mikmela
mikmela

Posts: 3
Registered: 01/31/12
jdbc master/slave groups of brokers sharing the same database instance
Posted: Jan 31, 2012 6:42 PM
 
  Click to reply to this thread Reply
As it was mentioned in http://activemq.2283324.n4.nabble.com/activemq-user-Network-of-brokers-and-db-schema-td2342357.html#a2342360 "Its technically possible to patch the JDBC message store to include a broker ID column in all the tables to allow the same JDBC database to be
used for multiple brokers..."
Understanding all drawbacks of such approach, we would like to use "shared database instance" approach for multiple master/slave groups of brokers as a default configuration to simplify client's burden in administration of our product. Our software allowing to create/configure multiple brokers in master/slave groups dynamically via GUI. The problem is the current ActiveMQ master/slave default implementation requires a separate database instance for each master/slave group.
I was wondering if someone has implemented somethinng like this?
Looking into the source I can see that most of the SQL statements will need to be customized... This, seems, can be done via <statements> element in configuration xml... Possibly, we'll need own jdbcadapter similar to SybaseJDBCAdapter or OracleJDBCAdapter, or just extend JDBCPersistenceAdapter. DefaultDatabaseLocker might require to be extended as well... Is this correct assessment, or much more is involved?

I'd appreciate any help on this matter...

gtully

Posts: 133
Registered: 02/08/08
Re: jdbc master/slave groups of brokers sharing the same database instance
Posted: Feb 7, 2012 12:17 PM   in response to: mikmela in response to: mikmela
 
  Click to reply to this thread Reply
Did you have any joy with using the statements.tablePrefix attribute on a per broker pair basis? This will allow them to isolate their use of tables.
mikmela

Posts: 3
Registered: 01/31/12
Re: jdbc master/slave groups of brokers sharing the same database instance
Posted: Mar 19, 2012 9:21 PM   in response to: mikmela in response to: mikmela
 
  Click to reply to this thread Reply
Well, we needed a solution when multiple brokers share the same set of activemq tables. So, eventually we went for implementation that I described in my question... The key was to introduce a broker_id field.