1 Reply Latest reply on Apr 8, 2005 8:59 AM by jamesstrachan

    send messages from Statefull to anoteher one.

    jordi fabregat Newbie

      Dear All,

      I have an easy question to resolve,

      Which is the better communication architecture between two Statefull beans.

      Statefull bean A (producer)
      Statefull bean B (consumer)

      its possible? i don't know how communicate the MDB who recibes de messages with the Statefulbean B (consumer.)

      Thanks in advance for your help.

        • 1. Re: send messages from Statefull to anoteher one.
          jamesstrachan Newbie

          I don't know why you need two stateful session beans.

          Most design problems resolve themselves to stateless session beans that invoke operations on (or send messages to) entity beans that represent the business data.

          You should be able to send messages to the consumer session bean B by producer bean A directly calling business methods on the consumer bean.

          You would only need to use a Message Driven Bean in the middle if you need asynchronous behaviour - to deliver a message without waiting for the response.

          JBoss will optimise direct method calls to "pass by reference" for good performance.

          If you use MDB's, the messages must be serialized to be put on a message queue, and then deserialized before being consumed. This is a performance drag.