RE: camel-atmosphere-websocket + TomEE

2018-05-22 Thread Shultz, Dmitry
It works but there is one annoying thing though - the exception below is logged 
when client disconnects:

14:38:11.133 [http-nio-8080-exec-6] ERROR o.a.container.JSR356Endpoint - 
java.io.IOException: java.io.IOException: An established connection was aborted 
by the software in your host machine
at 
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:315)
at 
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:258)
at 
org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:592)
at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:512)
at 
org.apache.tomcat.websocket.WsFrameBase.processDataControl(WsFrameBase.java:347)
at 
org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:289)
at 
org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133)
at 
org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:82)
at 
org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:171)
at 
org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:151)
at 
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148)
at 
org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54)
at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53)
at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457)
at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: An established connection was aborted by the 
software in your host machine
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:134)
at 
org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101)
at 
org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:157)
at 
org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doWrite(NioEndpoint.java:1261)
at 
org.apache.tomcat.util.net.SocketWrapperBase.doWrite(SocketWrapperBase.java:670)
at 
org.apache.tomcat.util.net.SocketWrapperBase.flushBlocking(SocketWrapperBase.java:607)
at 
org.apache.tomcat.util.net.SocketWrapperBase.flush(SocketWrapperBase.java:597)
at 
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:95)
at 
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:494)
at 
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:309)
... 19 common frames omitted

There is some solution for preventing it 
(https://stackoverflow.com/questions/25662371/websocket-error-by-closing-a-page-via-browser-an-established-connection-was-ab)
 but I don't know where to stick the ' @OnError annotation.  Any ideas?

Dmitry



-Original Message-
From: Shultz, Dmitry [mailto:dmitry_shu...@kaltire.com] 
Sent: Tuesday, May 22, 2018 11:17 AM
To: users@camel.apache.org
Subject: RE: camel-atmosphere-websocket + TomEE

Thanks a lot Zoran, mapping 
org.apache.camel.component.atmosphere.websocket.CamelWebSocketServlet works!


Cheers,
Dmitry


-Original Message-
From: Zoran Regvart [mailto:zo...@regvart.com]
Sent: Friday, May 18, 2018 6:30 AM
To: users@camel.apache.org
Subject: Re: camel-atmosphere-websocket + TomEE

Hi Dmitry,
I think you need to use
org.apache.camel.component.atmosphere.websocket.CamelWebSocketServlet
instead of or in addition to the default 
org.apache.camel.component.servlet.CamelHttpTransportServlet.

From what I can see CamelWebSocketServlet extends from 
CamelHttpTransportServlet so just replacing it should help in your case.

zoran

On Thu, May 17, 2018 at 11:22 PM, Shultz, Dmitry  
wrote:
> Hi All,
>
> I'm running CDI + JSF + Deltaspike + Camel web app in TomEE. My web.xml 
> contains following config for the servle

RE: camel-atmosphere-websocket + TomEE

2018-05-22 Thread Shultz, Dmitry
Thanks a lot Zoran, mapping 
org.apache.camel.component.atmosphere.websocket.CamelWebSocketServlet works!


Cheers,
Dmitry


-Original Message-
From: Zoran Regvart [mailto:zo...@regvart.com] 
Sent: Friday, May 18, 2018 6:30 AM
To: users@camel.apache.org
Subject: Re: camel-atmosphere-websocket + TomEE

Hi Dmitry,
I think you need to use
org.apache.camel.component.atmosphere.websocket.CamelWebSocketServlet
instead of or in addition to the default 
org.apache.camel.component.servlet.CamelHttpTransportServlet.

From what I can see CamelWebSocketServlet extends from 
CamelHttpTransportServlet so just replacing it should help in your case.

zoran

On Thu, May 17, 2018 at 11:22 PM, Shultz, Dmitry  
wrote:
> Hi All,
>
> I'm running CDI + JSF + Deltaspike + Camel web app in TomEE. My web.xml 
> contains following config for the servlets:
>
>
> Faces Servlet
> javax.faces.webapp.FacesServlet
> 1
> 
> 
> Faces Servlet
> *.xhtml
> 
> 
> dashboard.xhtml
> 
>
> 
> Camel Http Transport Servlet
> CamelServlet
> 
> org.apache.camel.component.servlet.CamelHttpTransportServlet
> 1
> 
>
> 
> 
> CamelServlet
> /rest/*
> 
>
> It's all works good except of camel-atmosphere-websocket, when I create route:
>
> from("atmosphere-websocket:///mypath");
>
> from("direct:ws").to("atmosphere-websocket:///mypath?sendToAll=true");
>
> HTTP Client is not able to connect to the WS, getting:
>
> WebSocket connection to 'ws://localhost:8080/my-app/rest/mypath' 
> failed: Error during WebSocket handshake: Unexpected response code: 
> 404
>
> Is there anything I'm missing?
>
> Actually, I'm not sure if camel-atmosphere-websocket actually creates 
> the server endpoint (the same as this one for example: 
> https://github.com/WASdev/sample.microprofile.meetingapp/blob/master/s
> rc/main/java/net/wasdev/samples/microProfile/meetings/MeetingNotifier.
> java)
>
> Cheers,
> Dmitry
>
>



--
Zoran Regvart


RE: Config parameters in splitter group attribute, was: Re: camel-atmosphere-websocket + TomEE

2018-05-22 Thread Mills, Gary (GE Digital)
Thanks so much Zoran, 

I've been able to actually get this working using properties place holder.  I 
found Claus's answer to a similar question on net. Lots of digging but I 
finally found it. 
my quest for info and answers didn't go deep enough. I found this was already 
encounted and answered by Claus Ibsen. Please see if you run in to this need.

Validation error with integer property (camel)

http://camel.apache.org/using-propertyplaceholder.html

under section "Using Property Placeholders for Any Kind of Attribute in the XML 
DSL"

here is what I did following these instructions.

added property prefix namespace 
xmlns:prop="http://camel.apache.org/schema/placeholder";

then modified the tokenize attribute


I'm using the property placeholder



this works like a charm. thank you Claus and Zoran


Gary Lee Mills
GE Middleware Engineer
Work:  331-777-2318
Cell: 630-607-9639

-Original Message-
From: Zoran Regvart [mailto:zo...@regvart.com] 
Sent: Tuesday, May 22, 2018 4:38 AM
To: Mills, Gary (GE Digital) ; users@camel.apache.org
Subject: EXT: Config parameters in splitter group attribute, was: Re: 
camel-atmosphere-websocket + TomEE

Hi Gary,
I think you can use property placeholders for `group` in version 2.20 onwards. 
The support for that was added in CAMEL-11421[1].

zoran

[1] https://issues.apache.org/jira/browse/CAMEL-11421

On Fri, May 18, 2018 at 5:35 PM, Mills, Gary (GE Digital)  
wrote:
> can you inject a value from the config params file in to the splitter group 
> attribute? if so, what is the proper way of doing it? thanks!
>
> Is this possible? What am I doing wrong? Thank you!
>
> 
>  
> 
>  
>
> 
>  
> 
>  
>
> Gary Lee Mills
> Work:  331-777-2318


--
Zoran Regvart


Config parameters in splitter group attribute, was: Re: camel-atmosphere-websocket + TomEE

2018-05-22 Thread Zoran Regvart
Hi Gary,
I think you can use property placeholders for `group` in version 2.20
onwards. The support for that was added in CAMEL-11421[1].

zoran

[1] https://issues.apache.org/jira/browse/CAMEL-11421

On Fri, May 18, 2018 at 5:35 PM, Mills, Gary (GE Digital)
 wrote:
> can you inject a value from the config params file in to the splitter group 
> attribute? if so, what is the proper way of doing it? thanks!
>
> Is this possible? What am I doing wrong? Thank you!
>
> 
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
> 
>
> Gary Lee Mills
> Work:  331-777-2318


-- 
Zoran Regvart


RE: camel-atmosphere-websocket + TomEE

2018-05-18 Thread Mills, Gary (GE Digital)
can you inject a value from the config params file in to the splitter group 
attribute? if so, what is the proper way of doing it? thanks!

Is this possible? What am I doing wrong? Thank you!





 






 


Gary Lee Mills
Work:  331-777-2318

-Original Message-
From: Shultz, Dmitry [mailto:dmitry_shu...@kaltire.com] 
Sent: Thursday, May 17, 2018 4:23 PM
To: users@camel.apache.org
Subject: EXT: camel-atmosphere-websocket + TomEE

Hi All,

I'm running CDI + JSF + Deltaspike + Camel web app in TomEE. My web.xml 
contains following config for the servlets:

   
Faces Servlet
javax.faces.webapp.FacesServlet
1


Faces Servlet
*.xhtml


dashboard.xhtml



Camel Http Transport Servlet
CamelServlet

org.apache.camel.component.servlet.CamelHttpTransportServlet
1




CamelServlet
/rest/*


It's all works good except of camel-atmosphere-websocket, when I create route:

from("atmosphere-websocket:///mypath");

from("direct:ws").to("atmosphere-websocket:///mypath?sendToAll=true");

HTTP Client is not able to connect to the WS, getting:

WebSocket connection to 'ws://localhost:8080/my-app/rest/mypath' failed: Error 
during WebSocket handshake: Unexpected response code: 404

Is there anything I'm missing?

Actually, I'm not sure if camel-atmosphere-websocket actually creates the 
server endpoint (the same as this one for example: 
https://github.com/WASdev/sample.microprofile.meetingapp/blob/master/src/main/java/net/wasdev/samples/microProfile/meetings/MeetingNotifier.java)

Cheers,
Dmitry




Re: camel-atmosphere-websocket + TomEE

2018-05-18 Thread Zoran Regvart
Hi Dmitry,
I think you need to use
org.apache.camel.component.atmosphere.websocket.CamelWebSocketServlet
instead of or in addition to the default
org.apache.camel.component.servlet.CamelHttpTransportServlet.

>From what I can see CamelWebSocketServlet extends from
CamelHttpTransportServlet so just replacing it should help in your
case.

zoran

On Thu, May 17, 2018 at 11:22 PM, Shultz, Dmitry
 wrote:
> Hi All,
>
> I'm running CDI + JSF + Deltaspike + Camel web app in TomEE. My web.xml 
> contains following config for the servlets:
>
>
> Faces Servlet
> javax.faces.webapp.FacesServlet
> 1
> 
> 
> Faces Servlet
> *.xhtml
> 
> 
> dashboard.xhtml
> 
>
> 
> Camel Http Transport Servlet
> CamelServlet
> 
> org.apache.camel.component.servlet.CamelHttpTransportServlet
> 1
> 
>
> 
> 
> CamelServlet
> /rest/*
> 
>
> It's all works good except of camel-atmosphere-websocket, when I create route:
>
> from("atmosphere-websocket:///mypath");
>
> from("direct:ws").to("atmosphere-websocket:///mypath?sendToAll=true");
>
> HTTP Client is not able to connect to the WS, getting:
>
> WebSocket connection to 'ws://localhost:8080/my-app/rest/mypath' failed: 
> Error during WebSocket handshake: Unexpected response code: 404
>
> Is there anything I'm missing?
>
> Actually, I'm not sure if camel-atmosphere-websocket actually creates the 
> server endpoint (the same as this one for example: 
> https://github.com/WASdev/sample.microprofile.meetingapp/blob/master/src/main/java/net/wasdev/samples/microProfile/meetings/MeetingNotifier.java)
>
> Cheers,
> Dmitry
>
>



-- 
Zoran Regvart


camel-atmosphere-websocket + TomEE

2018-05-17 Thread Shultz, Dmitry
Hi All,

I'm running CDI + JSF + Deltaspike + Camel web app in TomEE. My web.xml 
contains following config for the servlets:

   
Faces Servlet
javax.faces.webapp.FacesServlet
1


Faces Servlet
*.xhtml


dashboard.xhtml



Camel Http Transport Servlet
CamelServlet

org.apache.camel.component.servlet.CamelHttpTransportServlet
1




CamelServlet
/rest/*


It's all works good except of camel-atmosphere-websocket, when I create route:

from("atmosphere-websocket:///mypath");

from("direct:ws").to("atmosphere-websocket:///mypath?sendToAll=true");

HTTP Client is not able to connect to the WS, getting:

WebSocket connection to 'ws://localhost:8080/my-app/rest/mypath' failed: Error 
during WebSocket handshake: Unexpected response code: 404

Is there anything I'm missing?

Actually, I'm not sure if camel-atmosphere-websocket actually creates the 
server endpoint (the same as this one for example: 
https://github.com/WASdev/sample.microprofile.meetingapp/blob/master/src/main/java/net/wasdev/samples/microProfile/meetings/MeetingNotifier.java)

Cheers,
Dmitry