ESB DB setup
slaboure Nov 25, 2006 3:56 PMHello,
I've seen that as part of the ESB configuration, multiple compile-time options are available to either work on a PostgresSQL or HSQLDB database. While this is all fine if you are about to build your own ESB from the source, it might be benefitial to offer options for the pre-packaged ESB.
By default, I imagine we are going to provide a pre-packaged ESB working on a minimal MK (or MC in the future) that doesn't required any further configuration (much like the AS). To that end, the only real possibility is to offer an HSQLDB default setup with additional optional configuration files available for other DB.
Optional configuration files are usually found in the JBOSS_HOME/docs folder for the AS, the same could be done for the ESB.
For the base behaviour we could either i) provide the ESB with a preconfigured ESB or ii) setup a mechanism to setup the DB at runtime.
I am not a fan of i) as DB files (especially HSQLDB) might get dirty and then the users will not be able to fix that issue easily (excpet if you are able to read proprietary binary formats on the fly and write them as well).
For option ii), one easy option is to keep providing the Beanshell deployer currently available in JBoss AS (or any other script deployer) and provide a setup-esb.bsh script that would perform all necessary duties. For example:
- test that no ESB table exist yet.
- if that is the case, create the table
- populate it with basic/example data
- etc.
None of these checks (or any additional setup steps) are necessarily trivial when simply relying on a SQL script (useless at runtime btw), but are really trivial when running them from a beanshell script that can rely on JDBC, JNDI, the ESB itself, JVM options, OS information, etc.
Some sample scripts are available as part of the AS and, at least in the past, available for the Portal setup that uses such scripts so setup its default DB environment as well.
Cheers,
Sacha