On 10/16/07, Andreas Schaefer (2) <[EMAIL PROTECTED]> wrote:
> Hi
>
> I try to figure out what is going wrong with the ServiceMix Bean component
> when used with an asynchronous message exchange (send()). There is a good
> chance to I do not understand how the message exchange should work. This is
> what I tried:
>
> - Bean SU 1 sends an In-Out ME to another Bean SU 2 with send() on the
> Delivery Channel
> - B SU 2 handles the message and puts in an Out normalized message and then
> sends the ME back with send() on its Delivery Channel
>
> What I see is that the Delivery Channel is sending the "Mirror" ME which is
> nearly the same but just has the opposite role (here "consumer"). This means
> that the message is sent back to the Consumer Bean Endpoint because that is
> the address set in the Mirror ME.

Yeah.  The thing is that in JBI, an exchange is sent from a component
to an endpoint.  In an InOut mep, the provider will send the exchange
with the out message inside, the nmr will route it to the consumer
component, which will dispatch it to the consumer endpoint.  The
endpoint processes the response and need to send back the exchange
with a DONE status.  The mirror stuff is used internally.

>
> Is my assumption right that when a message is read from the NMR that it goes
> through the Provider endpoint and when the message is sent back that it then
> goes first through the Consumer endpoint of the same service or should it go
> to the Consumer endpoint of the calling service?

I don't understand what is the difference you make between "Consumer
endpoint of the same service" and " Consumer endpoint of the calling
service" ? Do you mean the POJO instance ?

> If the consumer endpoint of he SAME service is called then who is
> responsible on sending the message back to the calling service (B SU 1) and
> is there a way to do this automatically (meaning with having to code
> anything in the Bean SUs)?
>

If you don't implement MessageExchangeListener and you want to use
InOut asynchronously, then you need to use the @Callback annotation
and the Destination.

Else, I think the problem is that the component does not track that a
given endpoint acts as a consumer and send an exchange, so that it can
not route it back to the endpoint.  This would require wrapping the
DeliveryChannel or simply overriding the sendConsumerExchange method
from the component.  All exchanges sent from endpoints could be
tracked, but we still don't have any way to call the bean, unless it
has a @Callback.

Can you post your beans, because servicemix-bean has different ways of
writing a bean, so...

> Thank you
>
>
> Andreas Schaefer
> CEO of Madplanet.com Inc.
> [EMAIL PROTECTED]
>
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Reply via email to