ACK w/ transaction header confusion

362 views
Skip to first unread message

espretto rasu

unread,
Oct 14, 2014, 7:10:43 AM10/14/14
to stomp...@googlegroups.com
the following quote is from version 1.2  but applies to all versions

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.

If ACK frames are to tell the server that the client has processed a MESSAGE from it why would an ACK be part of a transaction if MESSAGEs are never part of any transaction? If I'm not mistaken, transactions are a server-side feature to accumulate a client's SENDs to be COMMITted or ABORTed later. if the server wants to assure the client it has processed a message it would send a RECEIPT frame. what am i missing here?

Hiram Chirino

unread,
Oct 14, 2014, 10:36:00 AM10/14/14
to stomp-spec
The analogy is:

Server sends clients RECEIPTs for SENDs sent by the client
as
Clients send servers ACKs for MESSAGEs sent by the server.

Transactions are used to mark/group client frames as a unit of work.
Since SENDs and ACKs are sent by clients, thats why those are the ones
that get the transaction header.
> --
> You received this message because you are subscribed to the Google Groups
> "stomp-spec" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to stomp-spec+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Hiram Chirino
Engineering | Red Hat, Inc.
hchi...@redhat.com | fusesource.com | redhat.com
skype: hiramchirino | twitter: @hiramchirino

espretto rasu

unread,
Oct 15, 2014, 7:03:45 AM10/15/14
to stomp...@googlegroups.com, hi...@hiramchirino.com
could you give me an example scenario in which an ACK would be a sensible part of a transaction?

Hiram Chirino

unread,
Oct 15, 2014, 9:23:23 AM10/15/14
to stomp-spec
Lets say you want to consume a message and send a message as a single
unit of work. You would send the ACK for the messages consume as part
of the transaction that also sends a new message.

Johannes Amsel

unread,
Oct 25, 2018, 1:25:00 PM10/25/18
to stomp-spec
Hi,
I still don't get it. The client could send as many SEND's as he wants to the server in a transaction. He could also send ACKS, for sure, but which MESSAGES should he ACK?
As I understand it, the process is as follows:
1. The Client sends a BEGIN frame
2. The Client sends as many SEND frames as he wants
3. The Server receives this frames but waits until the client sends a COMMIT frame with its processing
4. The Client sends a COMMIT frame
5. The Server processes the messages in the transaction 
    -> Depending on the message, the server sends a RECEIPT to the client or generates some MESSAGE's to clients

I have no Idea how there could be a scenario where the client starts a transaction but the server sends messages in this transaction...  

Hiram Chirino

unread,
Oct 25, 2018, 1:29:32 PM10/25/18
to stomp...@googlegroups.com
Transactions only apply to sends and acks a client sends to the server. The server will send the client messages in response to subscriptions that the client creates.   If no subscription  is created the the server will never send the client a message and there will be nothing for him to ack. 
hchi...@redhat.com | redhat.com
skype: hiramchirino | twitter: @hiramchirino
Reply all
Reply to author
Forward
0 new messages