On Sunday 28 March 2010 6:44:42 pm Coder One wrote:
> For custom transport and @Oneway methods, I got the client side right, but
> the service side perplexes me. Here is the current code. Using logs, I
> can see that getInbuiltBackChannel() is called even when the function is
> @Oneway. Is that supposed to happen?
Yes. For some transports (like http), the destination needs to know the
request is done so the 202 can be sent back.
> How should I setup myListener() to
> prevent getInbuiltBackChannel() from being called? After all, it is a
> oneway function.
In your getInbuiltBackChannel method, call
message.get(Exchange.class).isOneWay() and if it's a oneway and you DON'T need
to do anything, just return a dummy Conduit. Might be a good enhancement
request to allow the OneWayInterceptor to allow a null return.
Dan
>
> Thanks...
>
> public class MyDestination
> implements MyListener
> extends AbstractMultiplexDestination
> {
> public void myListener(InputStream msgData)
> {
> MessageImpl cxfMsg = new MessageImpl();
> cxfMsg.setContent(InputStream.class,msgData);
> cxfMsg.setDestination(this);
> incomingObserver.onMessage(cxfMsg);
> }
>
> protected Conduit getInbuiltBackChannel(Message cxfMsg)
> {
> // Why is this function called when there is a @Oneway function?
> }
> }
--
Daniel Kulp
[email protected]
http://dankulp.com/blog