-
1. Re: Can't connect with JS Stomp client to HornetQ service
gaohoward May 31, 2013 9:19 AM (in response to dariusp)What version of HornetQ are you using? I'd suggest you try the stomp-websocket example first. The code in the example is very much similar to yours. After you get example up and running, it could be easier to find where is the problem by comparing the example with your own code.
Howard
-
2. Re: Can't connect with JS Stomp client to HornetQ service
dariusp May 31, 2013 10:28 AM (in response to gaohoward)My versions
HornetQ......... 2.2.21.SNAPSHOT (HQ_2_2_21_final, 122)
JBossAS......... 7.1.x.incremental.129
I am not sure about which example you talk, but If about this https://github.com/jmesnil/stomp-websocket , then I wrote my code fallow this. It can't connect to my HornetQ setup, but it can connect to torquebox stomplets. I assume that JS code it's good, maybe some default login and password exists ?
Little more info
With Chrome (Version 25.0.1364.160 Ubuntu 12.04 (25.0.1364.160-0ubuntu0.12.04.1)) I get this error:
WebSocket connection to 'ws://localhost:61614/stomp' failed: Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing
With Firefox (
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0) I get this error:
"NetworkError: 403 Forbidden - http://localhost:61614/stomp"
-
3. Re: Can't connect with JS Stomp client to HornetQ service
gaohoward May 31, 2013 10:16 AM (in response to dariusp)Make sure your security settings are correct (login/password) with AS 7. To find out if you need a default login/password, I suggest you first disable security on HornetQ (like <security-enabled>false</security-enabled) then run your script.
Howard
-
4. Re: Can't connect with JS Stomp client to HornetQ service
dariusp Jun 3, 2013 3:41 AM (in response to gaohoward)<security-enabled>false</security-enabled> is set, but it doesn't help. I still can't connect.
-
5. Re: Can't connect with JS Stomp client to HornetQ service
gaohoward Jun 3, 2013 4:06 AM (in response to dariusp)That's strange. I've tried the later version of AS/HornetQ and it works for me. I believe there is something different in your server configuration.
I uploaded my test client. It's extracted from hornetq's jms/stomp-websockets example. Can you try it with your server? (Open the index.html with your Chrome browser).
Howard
-
chat.zip 5.1 KB
-
-
6. Re: Can't connect with JS Stomp client to HornetQ service
dariusp Jun 3, 2013 4:46 AM (in response to dariusp)With your chat demo, I got exacly some error like with my code.
Can you share your hornetQ configuration?
Here is my
<hornetq-server>
<persistence-enabled>true</persistence-enabled>
<security-enabled>false</security-enabled>
<jmx-management-enabled>true</jmx-management-enabled>
<journal-file-size>102400</journal-file-size>
<journal-min-files>2</journal-min-files>
<connectors>
<netty-connector name="netty" socket-binding="messaging"/>
<netty-connector name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
</netty-connector>
<netty-connector name="stomp-ws" socket-binding="netty-stomp-ws" />
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
<acceptors>
<netty-acceptor name="netty" socket-binding="messaging"/>
<netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<netty-acceptor name="stomp" socket-binding="netty-stomp">
<param key="protocol" value="stomp" />
</netty-acceptor>
<netty-acceptor name="stomp-ws" socket-binding="netty-stomp-ws" >
<param key="protocol" value="stomp_ws"/>
</netty-acceptor>
<in-vm-acceptor name="in-vm" server-id="0"/>
</acceptors>
<security-settings>
<security-setting match="#">
<permission type="send" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
</security-setting>
</security-settings>
<address-settings>
<address-setting match="#">
<dead-letter-address>jms.queue.DLQ</dead-letter-address>
<expiry-address>jms.queue.ExpiryQueue</expiry-address>
<redelivery-delay>0</redelivery-delay>
<max-size-bytes>20971520</max-size-bytes>
<address-full-policy>PAGE</address-full-policy>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
</address-setting>
</address-settings>
<jms-connection-factories>
<connection-factory name="InVmConnectionFactory">
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/ConnectionFactory"/>
</entries>
<consumer-window-size>1</consumer-window-size>
</connection-factory>
<connection-factory name="RemoteConnectionFactory">
<connectors>
<connector-ref connector-name="netty"/>
<connector-ref connector-name="stomp-ws"/>
</connectors>
<entries>
<entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
</entries>
<consumer-window-size>1</consumer-window-size>
</connection-factory>
<pooled-connection-factory name="hornetq-ra">
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
</pooled-connection-factory>
</jms-connection-factories>
</hornetq-server>
I just try standalone version 2.3.0.Final, And its works well. But I need somehow run bundled version with torquebox.
-
7. Re: Can't connect with JS Stomp client to HornetQ service
gaohoward Jun 3, 2013 4:51 AM (in response to dariusp)Here is mine. by the way what's the purpose for
<netty-connector name="stomp-ws" socket-binding="netty-stomp-ws" /> ?
-
standalone-full.xml 21.4 KB
-
-
8. Re: Can't connect with JS Stomp client to HornetQ service
dariusp Jun 3, 2013 6:33 AM (in response to gaohoward)Then was that moment, when I try anything...
Seems like I found issue, hornetQ version (2.2.21) bundled with torquebox its not working. I just downloaded standalone version 2.3 and its work, downloaded 2.2.14 (I didn't found 2.2.21 version) and its not work.