Hi,
We had to let go of an EJB Architecture using MDB/SLSB/EBs because we had a Thread.wait requirement in a particular use case, which couldn't be supported by the EJBs.
Any thoughts?
Thanks,
Avijeet
-
Thread.wait() and EJBs (9 messages)
- Posted by: Avijeet Dash
- Posted on: July 22 2005 15:40 EDT
Threaded Messages (9)
- Thread.wait() and EJBs by jason li on July 24 2005 23:30 EDT
- Thread.wait() and EJBs by Rakesh Malpani on July 26 2005 09:21 EDT
- Thread.wait() and EJBs by Avijeet Dash on July 26 2005 14:05 EDT
- Thread.wait() and EJBs by Rakesh Malpani on July 28 2005 13:33 EDT
- Thread.wait() and EJBs by sawan parihar on July 29 2005 05:40 EDT
- Thread.wait() and EJBs by D S on August 01 2005 12:44 EDT
-
Thread.wait() and EJBs by bill gross on August 09 2005 09:04 EDT
- Thread.wait() and EJBs by Avijeet Dash on August 13 2005 09:16 EDT
-
Thread.wait() and EJBs by bill gross on August 09 2005 09:04 EDT
- Thread.wait() and EJBs by Avijeet Dash on August 05 2005 21:06 EDT
-
Thread.wait() and EJBs[ Go to top ]
- Posted by: jason li
- Posted on: July 24 2005 23:30 EDT
- in response to Avijeet Dash
U may simulate "thread.wait()&thread.notify()" using JMS or MDB
like this in EJB:
doBusiness();
//block unti receive a message
Message notifyMessage = jmsReceiver.receive();
doOtherBusiness(); -
Thread.wait() and EJBs[ Go to top ]
- Posted by: Rakesh Malpani
- Posted on: July 26 2005 09:21 EDT
- in response to Avijeet Dash
Per the specifications, you should not be doing something like that. Its not supported since that can cause problems, like what if the EJB is passivated.. you can extrapolate what all can happen I am sure.
Hope this helps.
Rakesh. -
Thread.wait() and EJBs[ Go to top ]
- Posted by: Avijeet Dash
- Posted on: July 26 2005 14:05 EDT
- in response to Rakesh Malpani
Ok, Let me try put a different question - if you have a requirement like processing messages in order, how wud you enforce it a MDB/EJB solution.
Regards, -
Thread.wait() and EJBs[ Go to top ]
- Posted by: Rakesh Malpani
- Posted on: July 28 2005 13:33 EDT
- in response to Avijeet Dash
I am not sure why this is so complicated.. I guess I am missing some of the background information. By default if you set up a reliable message queue, the messages are available in the order they were posted. As far as processing goes, if you want them to be processed sequentially only, then you don't need multiple threads. You can do all the processing in a single thread contineously.
Hope this helps.
Rakesh. -
Thread.wait() and EJBs[ Go to top ]
- Posted by: sawan parihar
- Posted on: July 29 2005 05:40 EDT
- in response to Rakesh Malpani
if you have a requirement like processing messages in order, how wud you enforce it a MDB/EJB solution.
I don't thin that you can rely on the message delivery as the specs doesn't make it mandatory that the messages will be delivered in right order. I am not sure about ejb 3.0 but ejb 2.0 specs doesn't required the message delivery in the right order.
Hope it helps. -
Thread.wait() and EJBs[ Go to top ]
- Posted by: D S
- Posted on: August 01 2005 12:44 EDT
- in response to Rakesh Malpani
By default, the delivery order is unspecified, and there is no requirement in the JMS spec that messages will be delivered in the order in which they are required, or in any particular order at all. The JMS provider can deliver the messages in any order it wants by default.
However, most JMS providers have a mechanism for specifying the order in which messages are to be delivered. WebLogic, for example, uses Destination Keys to specify the order in which messages are to be delivered.
So using WebLogic you could achieve what you want by deploying one instance of the MDB only and then specifying that messages are to be delivered in order of JMSTimestamp (assuming that either there is a single source for the messages or that there are multiple sources which can be relied on to have co-ordinated timestamps). -
Thread.wait() and EJBs[ Go to top ]
- Posted by: bill gross
- Posted on: August 09 2005 21:04 EDT
- in response to D S
Also keep in mind that even with a single mdb that in high volume scenarios messages may be processed by multiple ejb instances concurently... furthur obscuring sequencing.
Is it possible to bundle the entire sequense of requests in a single message? (assuming the size of the bundle is not prohibitive). -
Thread.wait() and EJBs[ Go to top ]
- Posted by: Avijeet Dash
- Posted on: August 13 2005 09:16 EDT
- in response to bill gross
The scenario is like this - 1) Add 2) update, but if the update message comes first then, it has to wait. And bundleing Add, update in one message is a good idea, but It can't be applied across multiple coarse-grained transactions.
-thanks -
Thread.wait() and EJBs[ Go to top ]
- Posted by: Avijeet Dash
- Posted on: August 05 2005 21:06 EDT
- in response to Rakesh Malpani
Multiple threads help in achieving scalability, and all the messages are not required to be processed sequentially, but only those messages which are related to some entity. I am not very sure if we can ensure any ordering in queues, like other said its not given.
thanks-