We are using spring stomp over websockets, backed by ActiveMQ 5.11.1. When the client ACKs a message, I get this exception:
"<<< ERROR
content-type:text/plain message:Unexpected ACK received for message-id [ID\cjanus-61128-1430365808166-2\c1\c-1\c1\c1] content-length:722
org.apache.activemq.transport.stomp.ProtocolException: Unexpected ACK received for message-id [ID:janus-61128-1430365808166-2:1:-1:1:1] at org.apache.activemq.transport.stomp.ProtocolConverter.onStompAck(ProtocolConverter.java:462) at org.apache.activemq.transport.stomp.ProtocolConverter.onStompCommand(ProtocolConverter.java:247) at org.apache.activemq.transport.stomp.StompTransportFilter.onCommand(StompTransportFilter.java:75) at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83) at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214) at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196) at java.lang.Thread.run(Thread.java:744)
Here is the client code:
var sub_id = stompClient.subscribe('/user/guest/msg', function(greeting){
x = JSON.parse(greeting.body);
var message_id = greeting.headers['message-id']
stompClient.ack(message_id, sub_id);
}, {ack: 'client'});
I tried to set the ack to client-individual and that didn't help. Can some one tell me what I am missing/doing wrong?
Which STOMP version (1.0, 1.1 or 1.2) does the connection use? STOMP 1.2 has a breaking change:
The ACK frame MUST include an id header matching the ack header of the MESSAGE being acknowledged.
I suggest to capture the STOMP traffic with a packet sniffer or a debugger and compare the headers with the specification.