Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SLSB VS MDB

 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The output goes to database. For storing We are gonna use DAO.

-Jignesh
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it advisable to go for EJB solution or normal thread pool will be okay?

-Jignesh
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rojer,
We have decied to go for threading.

Connection pooling, let me work out.

-Jignesh
 
Hemanth Pallavajula
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

One small doubt, what is the full form of SLSB?
 
Hemanth Pallavajula
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh! sorry.

I got it. Its StateLess Session Bean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic