Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

(WebLogic 8.1) Persist Messages Using JMS Queue

Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thanks in advance.
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
It's never done THAT before. Explain it to me tiny ad:
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic