Mina2 Camel Component disconnectOnNoReply not working
Hi all, I am hoping that someone can help me with my problem. I have a client application that sends XML messages to Camel. I am using Mina2 v2.11.1 component in Camel as a endpoint to consume incoming XML. I have no control over the client application and in most cases it requires a response to the request. However there are a few messages that do not require a response. I am finding that if I do not respond to every message then it will drop the connection, this is not desired as it needs to maintain the connection wether a response is sent or not. I tried to set the disconnectOnNoReply = false, but it does not seem to be working as it continues to drop the connection. My route in camel is setup as… camel:route camel:from uri=mina2:tcp://10.5.60.60:9000?codec=#myDecoderamp;disconnectOnNoReply=false/ camel:bean ref=OutputProcessor/ /camel:route Is it possible that I am doing something wrong in my encoder that is causing this to happen? My encoder looks like… @Override public void encode(IoSession is, Object o, ProtocolEncoderOutput peo) throws Exception { if (o != null) { IoBuffer ioBuffer = IoBuffer.allocate(512, false); ioBuffer.setAutoExpand(true); ioBuffer.setAutoShrink(true); byte[] responseByteArr = (byte[]) o; ioBuffer.put(responseByteArr); ioBuffer.flip();//Flip it or there will be nothing to send peo.write(ioBuffer); peo.flush(); } } If anyone can shed some light on this I would really appreciate it! Thanks! - Tim
Regarding DIRMINA-912
I am just curious if there is a downside to this issue that I am not seeing. I have seen this in my MINA application; I have inbound/outbound executor filters as described in the issue and have seen where my inbound threads are *sometimes* processing IoEventType.WRITE events. I don't see any adverse effects of this, my messages are being put on the wire, but am checking in with the list to be sure. I am running mina-2.0.7. https://issues.apache.org/jira/browse/DIRMINA-912 Thanks! Mike
Re: Regarding DIRMINA-912
Le 8/22/13 11:51 PM, Mike McKnight a écrit : I am just curious if there is a downside to this issue that I am not seeing. I have seen this in my MINA application; I have inbound/outbound executor filters as described in the issue and have seen where my inbound threads are *sometimes* processing IoEventType.WRITE events. I don't see any adverse effects of this, my messages are being put on the wire, but am checking in with the list to be sure. If your protocol is stateless, I don't think it's a problem. -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
Re: Regarding DIRMINA-912
Agreed...I think I may run into an issue when I am running a ThrottlingFilter for IoEventType.WRITE events. I think that if the filter were written such that if the interval between the last message sent to an IoSession were not long enough, say 8ms, then the filter would need to sleep for some amount of time and if this bug is in play then I could envision other events like IoEventType.MESSAGE_RECEIVED not getting handled until the thread became available for that IoSession. Mike On 08/22/2013 04:51 PM, Emmanuel Lécharny wrote: Le 8/22/13 11:51 PM, Mike McKnight a écrit : I am just curious if there is a downside to this issue that I am not seeing. I have seen this in my MINA application; I have inbound/outbound executor filters as described in the issue and have seen where my inbound threads are *sometimes* processing IoEventType.WRITE events. I don't see any adverse effects of this, my messages are being put on the wire, but am checking in with the list to be sure. If your protocol is stateless, I don't think it's a problem.