A simple way to look at the differences is that clients submit a
CommandId with their commands. AMPS then uses that
CommandId when it needs to refer to the command later on.
Here's a quick breakdown from the point of view of the AMPS server:
CommandIdidentifies a specific command. Clients provide this on commands to AMPS, and AMPS returns it in the ack messages for that command. The CommandId is also provided on the query results and subscription results to indicate the command that ran the query and/or registered the subscription, as follows:
QueryIdis returned on SOW results, and provides the
CommandIdof the SOW query command or the
QueryIdspecified on the SOW query. For messages returned from a
sowcommand, only the
QueryIdis set on the message.
SubIdsare returned on messages received from a subscription, and is the
CommandIdof the subscribe command that entered the subscription, or the
SubIdspecified on the subscribe command. Notice that, when modifying a subscription with the
replaceoption, you use the
SubIdof the subscription to tell AMPS which subscription to replace. For messages returned from a
SubIdis set on the
group_endmessages and the
The AMPS clients fill in a
CommandId where necessary if one is not provided, and return that
CommandId for use in correlating later messages to and from AMPS.
In the AMPS HAClients, bookmark subscribe commands use a
SubId to locate and resume subscriptions: in this case, to correctly resume a subscription, the AMPS HAClient interfaces request that the application provide a
SubId. The client then uses that
SubId to resume the subscription as necessary, and handles populating the
CommandId properly for a bookmark subscribe.
We document these header fields in more detail in the AMPS Command Reference, available from the 60East website.