File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes SLSB VS MDB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "SLSB VS MDB" Watch "SLSB VS MDB" New topic
Author

SLSB VS MDB

Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

Hi Friends,

I am in a process of architecting a new software. In which our requirement is to integerate EJB with Quartz scheduler. The process is to read bunch of mails, parse the xml files attached with it.The mails can be thousands.

Now the options I am thinking are :
1. Create a cron job which calls SLSB at specific interval. In turn session bean reads mail box through helper class and then parse it.
But here only 1 session bean processed, so 1 mail at a time.
Is there any way that instead of 1 session bean I can call no of beans from the pool and then then can process number of mails together.

2. Create a cron job which calls a class to read mails at specific interval. And then those mails delievered to a TOPIC and in turn Consumer(ie. message driven beans) process them asynchroneously.


Which one is the best solution. Is there any way to use multiple session beans instead of only 1 SLSB.

-Jignesh
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
It is unclear why you want to use EJB technology to read a mailbox and parse the XML. What then happens to the parsed output?


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

The output goes to database. For storing We are gonna use DAO.

-Jignesh
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Well, if you are going to use an EJB system, I'd go for option 2. Get the class to read the mailbox, parse the XML and create an object - maybe an ObjectMessage type. Then for each email, send a message to a queue. The Container will process each message in a separate thread. You'll need an appropriately-sized MDB pool.
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

Is it advisable to go for EJB solution or normal thread pool will be okay?

-Jignesh
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Threading is easier, cheaper, can't see a reason for EJB. Think about pooling the JDBC Connections if your design requires a lot of opening and closing of Connections. I can't comment on any of the Connection Pool products available, I'm afraid, as all my experience with connection pooling is with WebLogic Server. However, this may help.

Open Source Database Connection Pools
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

Thanks Rojer,
We have decied to go for threading.

Connection pooling, let me work out.

-Jignesh
Hemanth Pallavajula
Ranch Hand

Joined: Oct 07, 2004
Posts: 38
Hi,

One small doubt, what is the full form of SLSB?


Cheers,<br />Hemanth...<br />(When opportunity doesn't knock, build a door.)
Hemanth Pallavajula
Ranch Hand

Joined: Oct 07, 2004
Posts: 38
Oh! sorry.

I got it. Its StateLess Session Bean.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SLSB VS MDB