Stateful Session Bean + Message Driven Bean = ?


EJB design: Stateful Session Bean + Message Driven Bean = ?

  1. Stateful Session Bean + Message Driven Bean = ? (2 messages)

    Dear all,

    I am now working on a problem which need to have a dispatcher EJB which bind to a parameter-defined topic. After it bind to the topic, it just work like a MDB. I have try SSB with no luck. What should I do with the activiation and passivation for the SSB which listen to a topic?

    Thanks for you help
  2. First read more about MDB and J2ee restrictions.

    Second: You cannot use SSB for asynchronous calls, it violates J2EE specification.In order to support asynchronous calls you have to start thread, but it is against J2EE spec. ONLY container can start threads.
    You can read from the queue, but no way you can get onMessage work directly in SSB.

    You can use MDB to call your SSB.
  3. Thanks for your answer.

    This seems a dead end for me. I need to find another way to do it. If others could suggest anyway of doing the job, I am much appreciated.

    Thanks to all