| Bud Curtis 2004-10-19, 8:56 pm |
| The project we are currently developing receives database triggered
events using an Oracle AQ messaging server and a receiving MDB. It
turns out the Oracle AQ is not delivering the messages reliably. We
intend to replace the AQ with our own process in the J2EE application
server. This process will query the database for stored database
changes (stored by the new triggers), and then post the changes on the
application server through the application server's JMS. In the same
XA transaction posting the JMS message the database entries will be
removed so they will not be available onthe next query.
The question I have is how to implement the repeating/cyclic J2EE
process that quiries the database for the triggered stored database
changes.
(1) One suggestion is to spin off a separate thread within the current
MDB that would repeatedly query the database and post any new changes
on the servers JMS. I am always concerned about adding threads onto
the J2EE server instance, so this one concerns me.
(2) Another suggestion is to develop another MDB that would send
itself a low priority message to make the database query. When the
message is received the new MDB would query the database, post any new
database change messages, and then send itself a message to start the
process over again.
I would be very interrested in any suggestions or warning on how to
deploy a cyclic/repeated service like the one I briefly described
here.
Thank you for your time,
Bud Curtis
|