stomp / stomp-spec

STOMP Protocol Specification
http://stomp.github.io/
78 stars 30 forks source link

Correct the ACK frame specification #59

Closed lishali12345 closed 11 years ago

lishali12345 commented 11 years ago

The original document miss the subscription header, and the id header in ACK frame should be message-id

LionelCons commented 11 years ago

The ACK frame is correct. The spec contains:

The ACK frame MUST include an id header matching the ack header of the MESSAGE being acknowledged. Optionally, a transaction header MAY be specified, indicating that the message acknowledgment SHOULD be part of the named transaction.

lishali12345 commented 11 years ago

You mean the id header in the ACK frame should be as same as the message it acknowledged, so the id header will be "message-id" actually?

lishali12345 commented 11 years ago

And I found the id header of ACK frame in the spec in version 1.1 is "message-id", I don't know why it's changed in version 1.2.Does it mean the STOMP server can use any id header, and the id header of client ACK frame just need to match the id header of the message which will be acknowledged?

LionelCons commented 11 years ago

In STOMP 1.2, the "id" header of the ACK frame must be identical to the "ack" header of the matching MESSAGE frame. This has nothing to do with the "message-id" header and yes, the STOMP server can use any value for the MESSAGE "ack" header. For more information on why it changed, see https://github.com/stomp/stomp-spec/issues/46. In short: "message-id" may be used for other purposes and should not be used by STOMP, the MESSAGE "ack" header is used by the server to verify the delivery of a given MESSAGE frame.

STOMP 1.1 is indeed different.

lishali12345 commented 11 years ago

I got it, Thanks a lot.