You should not use the client facade inside a lightweight component,
but rather the methods offered by the OutBinding parent classes.
Wrt to the exception, it sounds like a bug. The done method should not
be called here. Could you raise a JIRA please ?
On 10/26/06, moraleslos <[EMAIL PROTECTED]> wrote:
Guillaume, thanks for the explanation.
Now I have another related question. Everytime I use an async InOnly in one
of my components, I get this error message:
***********************************
java.lang.IllegalStateException: component is not owner
at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setStatus(MessageExchangeImpl.java:210)
at
org.apache.servicemix.client.ServiceMixClientFacade.done(ServiceMixClientFacade.java:198)
at
org.apache.servicemix.client.ServiceMixClientFacade.send(ServiceMixClientFacade.java:146)
at
com.test.integration.servicemix.ftp.EnhancedFTPPoller.sendAsyncFileMessage(ClientAPIUtil.java:109)
at
org.apache.servicemix.components.util.OutBinding.onMessageExchange(OutBinding.java:49)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:624)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:169)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:177)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:227)
...
****************************************
Now when I turn this InOnly exchange to be synchronous (sendSync(InOnly)), I
don't see any of these errors. Looking at the MessageExchangeImpl class, I
have no clue what or how all those status codes are used so I don't know how
to figure this out. Thanks in advance.
-los
gnodet wrote:
>
> First, the MEP is completely unrelated to the synchronous / asynchronous
> bit. You can send an InOnly synchronously or send an InOut
> asynchronoulsy.
> Then, all JBI exchanges have to be terminated by either a DONE status or
> an ERROR status (which is different from a fault). This also apply to
> InOnly
> and is the way to inform the consumer that the exchange has been handled
> when using a synchronous call.
>
> Synchronous InOut :
> channel.sendSync(inout);
> NormalizedMessage answer = inout.getOutMessage();
>
> Async InOut:
> channel.send(inout)
> The answer will be put in the delivery channel, so that the component
> need to poll the it (or implement MessageExchangeListener).
>
> On 10/26/06, moraleslos <[EMAIL PROTECTED]> wrote:
>>
>> I think I understand the service invocations / MEPs but am a bit confused
>> on
>> where the delivery channel fits in. I know if I just want to send an
>> async
>> message w/o expecting any response, I just create an InOnly and call
>> deliveryChannel.send(InOnly). If its a sync, I create an InOut and call
>> deliveryChannel.sendSync(InOut), and then get a response back via
>> InOut.getOutMessage().
>>
>> Now, sometimes I see in the smx source code that the exchange status is
>> set
>> to DONE and sends the message on the delivery channel. Is this done for
>> any
>> type of service invocation, i.e. whether it be a async or sync
>> invocation?
>> Or is this set for just a sync? The way I look at it, it should only be
>> done for a sync since the sender is expecting a response back whereas the
>> async caller doesn't care. Am I on target with this?
>>
>> Thanks in advance!
>>
>> -los
>> --
>> View this message in context:
>> http://www.nabble.com/SMX-Service-invocations-tf2514184.html#a7011818
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> Cheers,
> Guillaume Nodet
>
>
--
View this message in context:
http://www.nabble.com/SMX-Service-invocations-tf2514184.html#a7012524
Sent from the ServiceMix - User mailing list archive at Nabble.com.
--
Cheers,
Guillaume Nodet