Saturday, January 30, 2010

Weblogic JMS, The PointBase 30MB Limit, And Switching To MySQL


I've been running into this problem lately that occurs when dumping messages into Weblogic JMS queues on a developer's workstation. The underlying problem is that the PointBase database provided with Weblogic has a hard-and-fast size limit of 30MB. The last thing the company I work for wants to spend money on is database licenses on developers' boxes, especially when there are plenty of free options available.

I'm pretty comfortable with MySQL, and always have it installed on any developer box I'm using. But, Weblogic supports a
long list of alternative DB types, so pick one you like: Adabase, Cloudscape, DB2, Derby, EnterpriseDB, FirstSQl, MS/DB, Informix, Ingres, MS SQL, MaxDB, Oracle, PostgresSQL, Progress, and Sybase.

My original goal was to rip out PointBase entirely, and use MySQL exclusively. There may be a way to do that, but it seems that it's a matter of going through and replacing each configured PointBase datasource with a MySQL datasource, then switching over. In the meantime, I just replaced the one datasource I needed to store JMS messages. Assuming you already have Weblogic and your database of choice installed, it boils down to about four steps: Creating the database, creating the datasource, creating the JDBC store, and creating a JMS JDBC store. Most of the info is from links I hunted down and pulled together to make this list, so links back to the original docs are included.

Creating The Database

Okay, this one's really hard. ;) Here's the MySQL command:
mysql -uroot -e 'create database wls'
I just picked the DB name. We'll use it later. The name doesn't matter, just be consistent.

Creating The JDBC Data Source

  • Navigate Services->JDBC->DataSources->New. The name and JDNI name don't matter, again, be consistent.
    • Name = mysql-wls
    • JNDI name = jdbc/mysql/wls
    • Database type = mysql
    • Driver = com.mysql.jdbc.Driver

  • Click Next. I took the defaults:
    • Supports Global checked
    • One-phase commit

  • Click Next.
    • Database name = wls
    • Host = localhost
    • User = root
    • Password = <your root's pswd>

  • Services->JDBC->DataSources->mysql-wls->Targets
    • Servers=examplesServer

Creating The JDBC Store

  • Services->Persistent Stores->New->Create JDBC Store
    • Name=mysql-jms
    • Target=examplesServer
    • Datasource=mysql-wls
    • Prefix=jms_

Creating The JMS JDBC Store

  • Navigate to Services->Messaging->JMS Servers->examplesJMSServer
    • Persistent Store->mysql-jms

As a final thought, you may want to make your Queues persistent. ;) There's not much point setting this up if you're keeping your messages in memory:

  • Navigate to Services->Messaging->JMS Modules-><module>-><queue> ->Overrides,Delivery Mode Override=Persistent


Kevin Clark said...

Thanks for the post. Do you have any suggestions about getting a server started once you hit the 30MB limit?

Don Branson said...

I don't necessarily have a good answer on that - what I did on my dev machine was to rename the pointbase dir out of the way, then copy in someone else's that had not hit the limit. There's got to be a better way, but I had to go with quick-and-dirty.