camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Block <andy.bl...@gmail.com>
Subject Re: Camel Websocket - Connection key not set
Date Wed, 06 May 2015 05:20:04 GMT
It sounds like the goal is to communicate with an existing websocket endpoint. The Camel websocket
component will create a websocket endpoint in a Jetty server for your route to communicate.
Other clients will connect to this endpoint as well. You are receiving this error because
by default. you need to specify the key of the client you intend to communicate with.If you
wanted to broadcast the message to all currently connected clients, you can set the sendToAll
parameter on the endpoint.

Since you already have a websocket endpoint exposed in a Node app, I would recommend using
the AHC component [1] instead as it allows for websocket client communication instead of instantiating
an endpoint as well. 

- Andy

[1] - http://camel.apache.org/ahc.html 
-- 
Andrew Block
M: (716) 870-2408

On May 5, 2015 at 11:44:02 PM, Harish Kumar (harish.kumard@tcs.com) wrote:

I have the below route in Camel  

from JMS --> Websocket  

The websocket is exposed in a node js appliation running separately. and  
this is my route specification  

/from("test-jms:queue:test.queue").convertBodyTo(String.class,  
"UTF-8").to("websocket://localhost");/  

When I run the code, i get the following exception  

java.lang.IllegalArgumentException: Failed to send message to single  
connection;  
connetion key not set.  
at  
org.apache.camel.component.websocket.WebsocketProducer.process(Websoc  
ketProducer.java:57)  
at  
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncP  
rocessorBridge.process(AsyncProcessorConverterHelper.java:61)  
at  
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:1  
29)  
at  
org.apache.camel.management.InstrumentationProcessor.process(Instrume  
ntationProcessor.java:77)  
at  
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE  
rrorHandler.java:448)  
at  
org.apache.camel.processor.CamelInternalProcessor.process(CamelIntern  
alProcessor.java:191)  
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)  
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)  
at  
org.apache.camel.processor.CamelInternalProcessor.process(CamelIntern  
alProcessor.java:191)  
at  
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp  
er.java:109)  
at  
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy  
ncProcessor.java:87)  
at  
org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endp  
ointMessageListener.java:103)  
at  
org.springframework.jms.listener.AbstractMessageListenerContainer.doI  
nvokeListener(AbstractMessageListenerContainer.java:699)  
at  
org.springframework.jms.listener.AbstractMessageListenerContainer.inv  
okeListener(AbstractMessageListenerContainer.java:637)  
at  
org.springframework.jms.listener.AbstractMessageListenerContainer.doE  
xecuteListener(AbstractMessageListenerContainer.java:605)  
at  
org.springframework.jms.listener.AbstractPollingMessageListenerContai  
ner.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)  
at  
org.springframework.jms.listener.AbstractPollingMessageListenerContai  
ner.receiveAndExecute(AbstractPollingMessageListenerContainer.java:246)  
at  
org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn  
cMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144  
)  
at  
org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn  
cMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:  
1136)  
at  
org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn  
cMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.  
java:1145)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor  
.java:615)  
at java.lang.Thread.run(Thread.java:724)  
[d #0 - JmsConsumer[test.queue]] EndpointMessageListener WARN  
Execution  
of JMS message listener failed. Caused by:  
[org.apache.camel.RuntimeCamelExcepti  
on - java.lang.IllegalArgumentException: Failed to send message to single  
connec  
tion; connetion key not set.]  
org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException:  
Fail  
ed to send message to single connection; connetion key not set.  
at  
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHe  
lper.java:1619)  
at  
org.apache.camel.component.jms.EndpointMessageListener$EndpointMessag  
eListenerAsyncCallback.done(EndpointMessageListener.java:186)  
at  
org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endp  
ointMessageListener.java:107)  
at  
org.springframework.jms.listener.AbstractMessageListenerContainer.doI  
nvokeListener(AbstractMessageListenerContainer.java:699)  
at  
org.springframework.jms.listener.AbstractMessageListenerContainer.inv  
okeListener(AbstractMessageListenerContainer.java:637)  
at  
org.springframework.jms.listener.AbstractMessageListenerContainer.doE  
xecuteListener(AbstractMessageListenerContainer.java:605)  
at  
org.springframework.jms.listener.AbstractPollingMessageListenerContai  
ner.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)  
at  
org.springframework.jms.listener.AbstractPollingMessageListenerContai  
ner.receiveAndExecute(AbstractPollingMessageListenerContainer.java:246)  
at  
org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn  
cMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144  
)  
at  
org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn  
cMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:  
1136)  
at  
org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn  
cMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.  
java:1145)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor  
.java:615)  
at java.lang.Thread.run(Thread.java:724)  
Caused by: java.lang.IllegalArgumentException: Failed to send message to  
single  
connection; connetion key not set.  
at  
org.apache.camel.component.websocket.WebsocketProducer.process(Websoc  
ketProducer.java:57)  
at  
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncP  
rocessorBridge.process(AsyncProcessorConverterHelper.java:61)  
at  
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:1  
29)  
at  
org.apache.camel.management.InstrumentationProcessor.process(Instrume  
ntationProcessor.java:77)  
at  
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE  
rrorHandler.java:448)  
at  
org.apache.camel.processor.CamelInternalProcessor.process(CamelIntern  
alProcessor.java:191)  
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)  
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)  
at  
org.apache.camel.processor.CamelInternalProcessor.process(CamelIntern  
alProcessor.java:191)  
at  
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp  
er.java:109)  
at  
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy  
ncProcessor.java:87)  
at  
org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endp  
ointMessageListener.java:103)  

Some light ??  



--  
View this message in context: http://camel.465427.n5.nabble.com/Camel-Websocket-Connection-key-not-set-tp5766728.html
 
Sent from the Camel - Users mailing list archive at Nabble.com.  

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message