Hi,

I do not think it is a good architecture to use a synchronous component (the
session bean) to access information that can only be obtained asynchronously. I
would suggest two approaches :
- make your client both an EJB client and a JMS client : the client invokes the
session bean to request the information from the JMS source and subscribe to the
corresponding Topic.
- if you don't want your client use JMS, let it poll a session bean to get the
result: of course the client initiates the request the same way as above; your JMS
source sends the info to a Message-driven Bean which will store it in an entity
bean; the polling method of your session bean will access the entity bean to check
if the data has arrived ...

Best Regards,

Fran�ois

> Bill Leonard wrote:
> >
> > I have a client that sends a synchronous request to my session bean and
> > expects the response to be sent synchronously.  In order to fulfill the
> > request, the session bean talks to a component that uses JMS.  Therefore,
> > the session bean publishes the request to the JMS-based component.  Now, the
> > response from the JMS-based component is received only by subscribing to a
> > topic.  In order for my session bean to return the response to the client in
> > the same thread (synchronously), it has to do one of the following:
> >
> > 1) the session bean can poll the destination using the
> > MessageConsumer.receive()methods.
> > 2) block on some event (??); Its MessageListener code would then receive the
> > published response (in a thread started by the JMS provider).  It would then
> > signal the event on the session_bean.  The session bean would become
> > unblocked and return the response to the client.
> >
> > I know (1) can be done.  Is (2) possible?
> >
> > Also, I first thought that Message Driven Beans might be helpful but, after
> > reading about them, I see that in the above scenario, I'm still faced with
> > trying to get a session bean to act synchronously.  If I used an MDB instead
> > of a session bean, the client would then have to communicate with the MDB
> > using publish/subscribe (and I wanted the client to communicate
> > synchronously)

--
==================================================================
Fran�ois EXERTIER         Evidian (Groupe Bull)
     1, rue de Provence,  BP 208,  38432 Echirolles cedex, FRANCE
     mailto:[EMAIL PROTECTED]
     http://www.evidian.com/jonas   http://www.objectweb.org/jonas
     Tel: +33 (0)4 76 29 71 51  -  Fax:   +33 (0)4 76 29 77 30
==================================================================

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to