[
https://issues.apache.org/jira/browse/AMQ-4740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14352886#comment-14352886
]
Sebastian Sjödin commented on AMQ-4740:
---------------------------------------
The StompSocket IOException seems to still be an issue with ActiveMQ 5.11.1
(and jetty-8.1.17).
I did some further investigations, and it seems like the java.io.IOException is
caused by a java.io.EOFException that in its turn is caused by an InputStream
being closed (since there is no more data to be read) and this is not handled
gracefully. Quickly added a try-catch block for EOFException and it now seems
to work. Should probably be handled in a better way though than what is in the
attached AMQ-4740-EOF.diff.
This patch does not solve the heart-beat issue though, but by applying the
suggested code from Claudio in AMQ-5155 this seems to work fine, at least when
testing with stomp.js:
{noformat}
Opening Web Socket...
Web Socket Opened...
>>> CONNECT
login:
passcode:password
accept-version:1.1,1.0
heart-beat:10000,10000
<<< CONNECTED
heart-beat:10000,10000
session:ID:server01-55719-1425899064567-4:58
server:ActiveMQ/5.11.1
version:1.1
connected to server ActiveMQ/5.11.1
send PING every 10000ms
check PONG every 10000ms
connected to Stomp
>>> SUBSCRIBE
id:sub-0
destination:/topic/chat.general
<<< PONG
>>> PING
<<< PONG
>>> PING
<<< PONG
>>> PING
<<< PONG
>>> PING
<<< PONG
>>> PING
<<< PONG
{noformat}
> heart-beat is disabled when connecting to web socket
> ----------------------------------------------------
>
> Key: AMQ-4740
> URL: https://issues.apache.org/jira/browse/AMQ-4740
> Project: ActiveMQ
> Issue Type: Bug
> Affects Versions: 5.8.0, 5.10.0
> Environment: Google Chrome 29.0.1547.76 (Official Build 223446)
> Reporter: Jeff Mesnil
> Fix For: 5.9.1, 5.10.0
>
> Attachments: AMQ-4740-EOF.diff, AMQ-4740.patch
>
>
> If I use the stomp.js library to connect to ActiveMQ over its WebSocket url
> (ws://localhost:61614), the CONNECTED frame returns with disabled heart-beat:
> CONNECTED
> heart-beat:0,0
> session:ID:retsina.local-63633-1380117269290-2:1
> server:ActiveMQ/5.8.0
> version:1.1
> If I connect to its TCP socket (localhost:61613), the CONNECT frame will have
> heart-beat:
> CONNECTED
> heart-beat:10000,10000
> session:ID:retsina.local-63384-1380115729700-2:12
> server:ActiveMQ/5.8.0
> version:1.1
> In both case, the stomp.js send the same CONNECT frame with heart-beat:
> CONNECT
> login:user
> passcode:password
> accept-version:1.1,1.0
> heart-beat:10000,10000
> Is heart-beat disabled on purpose for Web Socket? Please note that the
> stomp.js does support heart-beat (using window.setInterval in a Web browser)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)