The application that I am developing is for users to send requests for some actions (import some external files into a designated system) to be taken. Users do not want to wait at their desk for the actions to be completed. Users can come back later to see logs regarding whether the actions are completed or some exceptions have be thrown.
I think the task falls into using JMS. And our team has decided to use the 'queue'.
I saw a weblogic example of persisting messages using the queue on the internet. But, I cannot access the entire code of that example because it was bundled with the WebLogic 5.1 ( I saw only portions of the code at the BEA site). And I am using the WebLogic 8.1.
The 'queue' example bundled with the WebLogic 8.1 do not persist messages.
As I understand, I have to:
1. configure a connection pool for the JMS database (the DBA has already created a couple of Oracle tables for this application);
2. configure a connection factory using the WebLogic configuraion wizard;
3. define JMS queue and give it a JNDI name so that it can be looked up in the Java code.
4. user requests must be in a transaction. A transacation commits if log messages are written to the database.
I am "new" in regard with actually running JMS.
I have successfully run all the JMS examples that came with the WebLogic 8.1, but, the 'queue' example that comes with the WebLogic 8.1 does not have a connection pool and is not in a transaction.
I am looking forward to finding an example showing how the 'queue' example can be modified to use a connection pool and to do transactions.
You need to create your connection pool and a data source, and associate that data source with the pool.
As for processing messages in the Queue: you need a class which implements the javax.jms.MessageListener interface. This can be a message-driven bean. If you use a MDB, its onMessage() method needs a transaction attribute of either Required or NotSupported.
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Everybody! Do the Funky Monkey! Like this tiny ad!