If you think the behavior of camel-websocket can be better you can fill a JIRA on Camel JIRA.
https://issues.apache.org/jira/browse/CAMEL -- Andrea Cosentino ---------------------------------- Apache Camel PMC Member Apache Karaf Committer Apache Servicemix Committer Email: ancosen1...@yahoo.com Twitter: @oscerd2 Github: oscerd On Sunday, October 30, 2016 5:55 PM, "Ingram, Stuart" <ingra...@upmc.edu> wrote: Thanks Jim for looking into this. Confirmation that it's broken vs something I'm doing wrong is a big time saver. Will check back in on the next release. The 'camel-websockets' package works for me to a certain degree but opens up multiple random ports per client connection making it completely unsuitable for my purposes unfortunately, hence the interest in 'ahc-ws'. Didn't find much in the way of documentation on the 'camel-websockets' behavior or ways to configure it's port behavior beyond the initial connection. -----Original Message----- From: Jim Pirkle [mailto:jim.pir...@gmail.com] Sent: Sunday, October 30, 2016 9:55 AM To: users@camel.apache.org Subject: Re: Camel-ahc-ws netty runtime problems I tried the 2.18.0 state packages, but had compile errors. Decided to wait for 2.18.1 before trying to resolve problems On Fri, Oct 28, 2016, 8:55 PM Ingram, Stuart <ingra...@upmc.edu> wrote: > Thanks Claus! I wasn't aware of the *-starter packages for Camel. > Much appreciated for the pointer. > > Moving to the 'camel-ahc-ws-starter' package and adjusting all other > camel* packages I now get a different exception. > > Any help/pointers are appreciated. Thanks > > > java.util.concurrent.ExecutionException: java.lang.IllegalStateException: > Invalid Status Code 404 > at > org.asynchttpclient.netty.NettyResponseFuture.done(NettyResponseFuture > .java:228) > ~[async-http-client-2.0.15.jar:na] > at > org.asynchttpclient.netty.handler.WebSocketHandler$UpgradeCallback.cal > l(WebSocketHandler.java:100) > ~[async-http-client-2.0.15.jar:na] > at > org.asynchttpclient.netty.handler.AsyncHttpClientHandler.channelRead(A > syncHttpClientHandler.java:73) > ~[async-http-client-2.0.15.jar:na] > at > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abstr > actChannelHandlerContext.java:366) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abstr > actChannelHandlerContext.java:352) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstrac > tChannelHandlerContext.java:345) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandler > Context.fireChannelRead(CombinedChannelDuplexHandler.java:435) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMess > ageDecoder.java:293) ~[netty-codec-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageD > ecoder.java:267) ~[netty-codec-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChan > nelDuplexHandler.java:250) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abstr > actChannelHandlerContext.java:366) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abstr > actChannelHandlerContext.java:352) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstrac > tChannelHandlerContext.java:345) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(Defaul > tChannelPipeline.java:1294) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abstr > actChannelHandlerContext.java:366) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abstr > actChannelHandlerContext.java:352) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannel > Pipeline.java:911) ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(Abstrac > tNioByteChannel.java:131) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java > :611) ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEven > tLoop.java:552) ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.jav > a:466) ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438) > ~[netty-transport-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadE > ventExecutor.java:140) ~[netty-common-4.0.41.Final.jar:4.0.41.Final] > at > io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator > .run(DefaultThreadFactory.java:144) > ~[netty-common-4.0.41.Final.jar:4.0.41.Final] > at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91] Caused > by: java.lang.IllegalStateException: Invalid Status Code 404 > at > org.asynchttpclient.ws.WebSocketUpgradeHandler.onCompleted(WebSocketUp > gradeHandler.java:81) > ~[async-http-client-2.0.15.jar:na] > at > org.asynchttpclient.ws.WebSocketUpgradeHandler.onCompleted(WebSocketUp > gradeHandler.java:29) > ~[async-http-client-2.0.15.jar:na] > at > org.asynchttpclient.netty.NettyResponseFuture.getContent(NettyResponse > Future.java:188) > ~[async-http-client-2.0.15.jar:na] > at > org.asynchttpclient.netty.NettyResponseFuture.done(NettyResponseFuture > .java:223) > ~[async-http-client-2.0.15.jar:na] > ... 24 common frames omitted > > -----Original Message----- > From: Claus Ibsen [mailto:claus.ib...@gmail.com] > Sent: Friday, October 28, 2016 3:20 AM > To: users@camel.apache.org > Subject: Re: Camel-ahc-ws netty runtime problems > > When using Spring Boot and Camel 2.18 onwards you should use the > -starter components, eg camel-ahc-ws-starter and so on. > > > > On Tue, Oct 25, 2016 at 8:21 PM, Ingram, Stuart <ingra...@upmc.edu> wrote: > > Using the following dependencies > > > > compile('org.apache.camel:camel-jackson:2.18.0') > > compile('org.apache.camel:camel-metrics:2.18.0') > > compile('org.apache.camel:camel-spring-boot-starter:2.18.0') > > compile('org.apache.camel:camel-spring-redis:2.18.0') > > compile('org.apache.camel:camel-stream:2.18.0') > > compile('org.apache.camel:camel-ahc-ws:2.18.0') > > compile('org.springframework.boot:spring-boot-actuator') > > compile("org.springframework.boot:spring-boot-starter-web") > > > > And the following ahc-ws definition in Spring Boot > > > > ......... > > .multicast() > > .parallelProcessing() > > > > .pipeline() > > .marshal().json(JsonLibrary.Jackson) > > .convertBodyTo(String.class) // Avoids string serialization > issues in websocket component. > > .to("ahc-ws://localhost:8080/votes?sendToAll=true") > > .end() > > ......... > > > > At runtime I get the following error when publishing to this sink > > > > 2016-10-25 11:41:45.689 INFO 1864 --- [ #7 - Multicast] > o.a.camel.component.ahc.ws.WsEndpoint : Reconnecting websocket: > ws://localhost:8080/votes?sendToAll=true > > 2016-10-25 11:41:45.777 ERROR 1864 --- [ #7 - Multicast] > > o.a.camel.processor.DefaultErrorHandler : Failed delivery for > > (MessageId: ID-singram-mint172-42019-1477410101007-0-56 on ExchangeId: > > ID-singram-mint172-42019-1477410101007-0-59). Exhausted after > > delivery > > attempt: 1 caught: java.util.concurrent.ExecutionException: > > java.net.ConnectException: > > io.netty.channel.DefaultChannelId.newInstance()Lio/netty/channel/Def > > au > > ltChannelId; > > > > java.util.concurrent.ExecutionException: java.net.ConnectException: > io.netty.channel.DefaultChannelId.newInstance()Lio/netty/channel/Defau > ltChannelId; > > at > org.asynchttpclient.netty.NettyResponseFuture.abort(NettyResponseFutur > e.java:239) > ~[async-http-client-2.0.15.jar:na] > > at > org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(Netty > ConnectListener.java:162) > ~[async-http-client-2.0.15.jar:na] > > at > org.asynchttpclient.netty.request.NettyChannelConnector$1.onFailure(Ne > ttyChannelConnector.java:103) > ~[async-http-client-2.0.15.jar:na] > > at > org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplet > e(SimpleChannelFutureListener.java:28) > ~[async-http-client-2.0.15.jar:na] > > at > org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplet > e(SimpleChannelFutureListener.java:20) > ~[async-http-client-2.0.15.jar:na] > > at > io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise > .java:514) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultProm > ise.java:488) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.util.concurrent.DefaultPromise.access$000(DefaultPromise.java > :34) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.util.concurrent.DefaultPromise$1.run(DefaultPromise.java:438) > ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.util.concurrent.GlobalEventExecutor$TaskRunner.run(GlobalEven > tExecutor.java:233) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator > .run(DefaultThreadFactory.java:144) > ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91] > > Caused > > by: java.net.ConnectException: > io.netty.channel.DefaultChannelId.newInstance()Lio/netty/channel/Defau > ltChannelId; > > at > org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(Netty > ConnectListener.java:160) > ~[async-http-client-2.0.15.jar:na] > > ... 10 common frames omitted Caused by: > > java.lang.NoSuchMethodError: > io.netty.channel.DefaultChannelId.newInstance()Lio/netty/channel/Defau > ltChannelId; > > at > io.netty.channel.AbstractChannel.newId(AbstractChannel.java:107) > ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.channel.AbstractChannel.<init>(AbstractChannel.java:79) > ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.channel.nio.AbstractNioChannel.<init>(AbstractNioChannel.java > :84) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.channel.nio.AbstractNioByteChannel.<init>(AbstractNioByteChan > nel.java:54) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.j > ava:98) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.j > ava:88) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.j > ava:81) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.j > ava:74) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > org.asynchttpclient.netty.channel.NioSocketChannelFactory.newChannel(N > ioSocketChannelFactory.java:25) > ~[async-http-client-2.0.15.jar:na] > > at > org.asynchttpclient.netty.channel.NioSocketChannelFactory.newChannel(N > ioSocketChannelFactory.java:19) > ~[async-http-client-2.0.15.jar:na] > > at > io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap > .java:319) ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at > io.netty.bootstrap.Bootstrap.doResolveAndConnect(Bootstrap.java:163) > ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > at io.netty.bootstrap.Bootstrap.connect(Bootstrap.java:156) > > ~[netty-all-4.1.5.Final.jar:4.1.5.Final] > > > > Any thoughts on what's going on/missing? > > > > I did notice that the dependency tree is a little odd in that > > netty-all > (see bottom) is 4.1.5 and all other netty dependencies are 4.0.41. > This was generated with 'gradle dependencies' > > > > +--- org.apache.camel:camel-ahc-ws:2.18.0 > > | +--- org.apache.camel:camel-core:2.18.0 (*) > > | \--- org.apache.camel:camel-ahc:2.18.0 > > | +--- org.apache.camel:camel-core:2.18.0 (*) > > | +--- org.asynchttpclient:async-http-client:2.0.15 > > | | +--- > org.asynchttpclient:async-http-client-netty-utils:2.0.15 > > | | | +--- io.netty:netty-buffer:4.0.41.Final > > | | | | \--- io.netty:netty-common:4.0.41.Final > > | | | \--- org.slf4j:slf4j-api:1.7.21 > > | | +--- io.netty:netty-codec-http:4.0.41.Final > > | | | +--- io.netty:netty-codec:4.0.41.Final > > | | | | \--- io.netty:netty-transport:4.0.41.Final > > | | | | \--- io.netty:netty-buffer:4.0.41.Final (*) > > | | | \--- io.netty:netty-handler:4.0.41.Final > > | | | +--- io.netty:netty-buffer:4.0.41.Final (*) > > | | | +--- io.netty:netty-transport:4.0.41.Final (*) > > | | | \--- io.netty:netty-codec:4.0.41.Final (*) > > | | +--- io.netty:netty-transport-native-epoll:4.0.41.Final > > | | | +--- io.netty:netty-common:4.0.41.Final > > | | | +--- io.netty:netty-buffer:4.0.41.Final (*) > > | | | \--- io.netty:netty-transport:4.0.41.Final (*) > > | | +--- org.asynchttpclient:netty-resolver-dns:2.0.15 > > | | | +--- org.asynchttpclient:netty-resolver:2.0.15 > > | | | | +--- io.netty:netty-common:4.0.41.Final > > | | | | \--- org.slf4j:slf4j-api:1.7.21 > > | | | +--- org.asynchttpclient:netty-codec-dns:2.0.15 > > | | | | +--- io.netty:netty-codec:4.0.41.Final (*) > > | | | | \--- org.slf4j:slf4j-api:1.7.21 > > | | | +--- io.netty:netty-transport:4.0.41.Final (*) > > | | | \--- org.slf4j:slf4j-api:1.7.21 > > | | +--- org.reactivestreams:reactive-streams:1.0.0 > > | | +--- com.typesafe.netty:netty-reactive-streams:1.0.7 > > | | | +--- io.netty:netty-handler:4.0.39.Final -> > 4.0.41.Final (*) > > | | | \--- org.reactivestreams:reactive-streams:1.0.0 > > | | +--- org.javassist:javassist:3.20.0-GA > > | | \--- org.slf4j:slf4j-api:1.7.21 > > | \--- io.netty:netty-all:4.1.5.Final > > > > Any assistance would be greatly appreciated > > > > Thanks > > - Stuart > > > > > > -- > Claus Ibsen > ----------------- > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 >