Forum Stats

  • 3,750,522 Users
  • 2,250,187 Discussions


How does JMS work

I am a PL/SQL developer trying to understand JMS.  Our products front-end is developed using Java 8. Back-end is PL/SQL.

Ours is a billing application.  Up-to now the billing was done in PL/SQL, but now the architects have decided to move the billing to Java.

In order to do that we (PL/SQL back-end) has to supply the list of accounts to be billed to Java.

The Java side has a JMS queue. Problem is we tried writing to the JMS queue from PL/SQL but it was unsuccessful.

Now, how we have agreed to do is like this:

(1.) We have new Oracle table which will hold the list of accountIDs to be billed (along with some control columns).

(2.) Java will read this table (the trigger to read this is still unknown. We are working on it).

(3.) A Java process will read all the new rows to the table and write all those rows to the JMS queue.

(4.) JMS queue, every-time it a message is added will call a Java procedure to do the billing for the account.

(5.) Once the billing is complete it will update another Oracle table with accountID and if successful flag saying billing was OK or the billing errors (in a clob).

(6.) Once billing is finished for one account, the Java billing slave will write to the JMS indicating that billing process has run to completion for the account.

However we are still not sure whether this  will wok.  Our question are:

(1.) How does JMS really work.  When we write 400 accountIDs to the JMS queue (i.e. 400 messages) will the JMS start 400 billing slaves, instantly or

will the JMS queue account IDs be processed one at a time. That is, the JMS will call the Java procedure for the 1st account, process it and write to

JMS queue saying it is complete, then the other message in the queue will call the Java billing procedure for that account?

(3.) What will happen if the Java billing procedure fails?? What will happen to the JMS queue?

We have these questions which seem to confuse us.