Win a copy of Functional Design and Architecture this week in the Functional programming forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

(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.
 
Everybody! Do the Funky Monkey! Like this tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic