You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by milltj <mi...@drop-tank.com> on 2013/08/21 17:58:00 UTC
Mina BufferDataException when using disconnectOnNoReply option
Ok, So I decided to go back to the drawing board and decided to run some
tests.
First, I implemented a very simple decoder that contains the following code:
@Override
protected boolean doDecode(IoSession is, IoBuffer ib,
ProtocolDecoderOutput pdo) throws Exception {
System.out.println("IoBuffer hasRemaining: " + ib.hasRemaining());
System.out.println("IoBuffer remaining: " + ib.remaining());
byte[] data = new byte[ib.remaining()];
ib.get(data);
System.out.println("IoBuffer read: " + new String(data));
return true;
}
Then I implemented my route in the camel-context as...
<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
<camel:route>
<camel:from
uri="mina2:tcp://10.5.60.60:9000?codec=#gilbarcoDecoder" />
<camel:bean ref="testBean"/>
</camel:route>
</camel:camelContext>
When I run this it will successfully read the input and output the received
message to the console. However when I change the route to..
<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
<camel:route>
<camel:from
uri="mina2:tcp://10.5.60.60:9000?disconnectOnNoReply=false;codec=#gilbarcoDecoder"
/>
<camel:bean ref="testBean"/>
</camel:route>
</camel:camelContext>
Then I get the following error message and it never calls the doDecode
method..
org.apache.camel.CamelException:
org.apache.mina.filter.codec.ProtocolDecoderException:
org.apache.mina.core.buffer.BufferDataException: dataLength: 1347375948
(Hexdump: REMOVED FOR BREVITY)
at
org.apache.camel.component.mina2.Mina2Consumer$ReceiveHandler.exceptionCaught(Mina2Consumer.java:312)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.exceptionCaught(DefaultIoFilterChain.java:672)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:461)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1100(DefaultIoFilterChain.java:47)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.exceptionCaught(DefaultIoFilterChain.java:760)
at
org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:93)
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
at
org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:769)
at
org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:761)
at
org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:703)
at java.lang.Thread.run(Thread.java:722)
Not sure exactly why this is occurring. Is it the way I have configured my
route? Or is this a bug in the Mina2 2.11.1 component?
- Tim
--
View this message in context: http://camel.465427.n5.nabble.com/Mina-Synchronous-Communication-tp5737223p5737692.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Mina BufferDataException when using disconnectOnNoReply option
Posted by Christian Müller <ch...@gmail.com>.
Good catch!
mina2:tcp://10.5.60.60:9000?disconnectOnNoReply=false;codec=#gilbarcoDecodershould
be mina2:tcp://
10.5.60.60:9000?disconnectOnNoReply=false&codec=#gilbarcoDecoder
Best,
Christian
-----------------
Software Integration Specialist
Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html
https://www.linkedin.com/pub/christian-mueller/11/551/642
On Fri, Aug 23, 2013 at 12:19 AM, Pontus Ullgren <ul...@gmail.com> wrote:
> I have never used the mina component so I could be out on thin ice here.
> But I am not sure about the ';' to separate the parameters. Should it not
> be '&'?
>
> Best regards
> Pontus
> Den 21 aug 2013 17:58 skrev "milltj" <mi...@drop-tank.com>:
>
> > Ok, So I decided to go back to the drawing board and decided to run some
> > tests.
> >
> > First, I implemented a very simple decoder that contains the following
> > code:
> >
> > @Override
> > protected boolean doDecode(IoSession is, IoBuffer ib,
> > ProtocolDecoderOutput pdo) throws Exception {
> >
> > System.out.println("IoBuffer hasRemaining: " + ib.hasRemaining());
> > System.out.println("IoBuffer remaining: " + ib.remaining());
> > byte[] data = new byte[ib.remaining()];
> > ib.get(data);
> > System.out.println("IoBuffer read: " + new String(data));
> >
> > return true;
> >
> > }
> >
> > Then I implemented my route in the camel-context as...
> >
> > <camel:camelContext xmlns="http://camel.apache.org/schema/spring">
> > <camel:route>
> > <camel:from
> > uri="mina2:tcp://10.5.60.60:9000?codec=#gilbarcoDecoder" />
> > <camel:bean ref="testBean"/>
> > </camel:route>
> > </camel:camelContext>
> >
> > When I run this it will successfully read the input and output the
> received
> > message to the console. However when I change the route to..
> >
> > <camel:camelContext xmlns="http://camel.apache.org/schema/spring">
> > <camel:route>
> > <camel:from
> > uri="mina2:tcp://
> > 10.5.60.60:9000?disconnectOnNoReply=false;codec=#gilbarcoDecoder"
> > />
> > <camel:bean ref="testBean"/>
> > </camel:route>
> > </camel:camelContext>
> >
> > Then I get the following error message and it never calls the doDecode
> > method..
> > org.apache.camel.CamelException:
> > org.apache.mina.filter.codec.ProtocolDecoderException:
> > org.apache.mina.core.buffer.BufferDataException: dataLength: 1347375948
> > (Hexdump: REMOVED FOR BREVITY)
> > at
> >
> >
> org.apache.camel.component.mina2.Mina2Consumer$ReceiveHandler.exceptionCaught(Mina2Consumer.java:312)
> > at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.exceptionCaught(DefaultIoFilterChain.java:672)
> > at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:461)
> > at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1100(DefaultIoFilterChain.java:47)
> > at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.exceptionCaught(DefaultIoFilterChain.java:760)
> > at
> >
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:93)
> > at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
> > at
> >
> >
> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:769)
> > at
> >
> >
> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:761)
> > at
> >
> >
> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:703)
> > at java.lang.Thread.run(Thread.java:722)
> >
> >
> > Not sure exactly why this is occurring. Is it the way I have configured
> my
> > route? Or is this a bug in the Mina2 2.11.1 component?
> >
> > - Tim
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Mina-Synchronous-Communication-tp5737223p5737692.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
Re: disconnectOnNoReply not working...
Posted by "itsavvy.ankur" <ia...@gmail.com>.
milltj wrote
> Pontus:
>
> You are correct. I realized it was incorrect it should be...
>
>
> <camel:camelContext xmlns="http://camel.apache.org/schema/spring">
>
>
> <camel:route>
>
>
> <camel:from uri="mina2:tcp://
> 10.5.60.60:9000?disconnectOnNoReply=false&codec=#gilbarcoDecoder"
> />
>
>
> <camel:bean ref="testBean"/>
>
>
> </camel:route>
>
>
> </camel:camelContext>
> That corrects the datalength error, but unfortunately it is still
> disconnecting when a response is not sent back to the client.
Hi, did you manage to get around your problem of the disconnecting when no
response is sent ? I think I have run into a similar issue where some
messages(requests) in my protocol do not have a response back. More info
here
<http://camel.465427.n5.nabble.com/Apache-Camel-Mina2-ExchangePattern-td5765184.html>
--
View this message in context: http://camel.465427.n5.nabble.com/Mina-Synchronous-Communication-tp5737223p5765257.html
Sent from the Camel - Users mailing list archive at Nabble.com.
disconnectOnNoReply not working...
Posted by milltj <mi...@drop-tank.com>.
Pontus:
You are correct. I realized it was incorrect it should be...
<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
<camel:route>
<camel:from uri="mina2:tcp://
10.5.60.60:9000?disconnectOnNoReply=false<b>&*codec=#gilbarcoDecoder"
/>
<camel:bean ref="testBean"/>
</camel:route>
</camel:camelContext>
That corrects the datalength error, but unfortunately it is still
disconnecting when a response is not sent back to the client.
--
View this message in context: http://camel.465427.n5.nabble.com/Mina-Synchronous-Communication-tp5737223p5737792.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Mina BufferDataException when using disconnectOnNoReply option
Posted by Pontus Ullgren <ul...@gmail.com>.
I have never used the mina component so I could be out on thin ice here.
But I am not sure about the ';' to separate the parameters. Should it not
be '&'?
Best regards
Pontus
Den 21 aug 2013 17:58 skrev "milltj" <mi...@drop-tank.com>:
> Ok, So I decided to go back to the drawing board and decided to run some
> tests.
>
> First, I implemented a very simple decoder that contains the following
> code:
>
> @Override
> protected boolean doDecode(IoSession is, IoBuffer ib,
> ProtocolDecoderOutput pdo) throws Exception {
>
> System.out.println("IoBuffer hasRemaining: " + ib.hasRemaining());
> System.out.println("IoBuffer remaining: " + ib.remaining());
> byte[] data = new byte[ib.remaining()];
> ib.get(data);
> System.out.println("IoBuffer read: " + new String(data));
>
> return true;
>
> }
>
> Then I implemented my route in the camel-context as...
>
> <camel:camelContext xmlns="http://camel.apache.org/schema/spring">
> <camel:route>
> <camel:from
> uri="mina2:tcp://10.5.60.60:9000?codec=#gilbarcoDecoder" />
> <camel:bean ref="testBean"/>
> </camel:route>
> </camel:camelContext>
>
> When I run this it will successfully read the input and output the received
> message to the console. However when I change the route to..
>
> <camel:camelContext xmlns="http://camel.apache.org/schema/spring">
> <camel:route>
> <camel:from
> uri="mina2:tcp://
> 10.5.60.60:9000?disconnectOnNoReply=false;codec=#gilbarcoDecoder"
> />
> <camel:bean ref="testBean"/>
> </camel:route>
> </camel:camelContext>
>
> Then I get the following error message and it never calls the doDecode
> method..
> org.apache.camel.CamelException:
> org.apache.mina.filter.codec.ProtocolDecoderException:
> org.apache.mina.core.buffer.BufferDataException: dataLength: 1347375948
> (Hexdump: REMOVED FOR BREVITY)
> at
>
> org.apache.camel.component.mina2.Mina2Consumer$ReceiveHandler.exceptionCaught(Mina2Consumer.java:312)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.exceptionCaught(DefaultIoFilterChain.java:672)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:461)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1100(DefaultIoFilterChain.java:47)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.exceptionCaught(DefaultIoFilterChain.java:760)
> at
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:93)
> at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
> at
>
> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:769)
> at
>
> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:761)
> at
>
> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:703)
> at java.lang.Thread.run(Thread.java:722)
>
>
> Not sure exactly why this is occurring. Is it the way I have configured my
> route? Or is this a bug in the Mina2 2.11.1 component?
>
> - Tim
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Mina-Synchronous-Communication-tp5737223p5737692.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>