A subscriber sends a SUBSCRIBE_UPDATE to a publisher to modify an existing subscription.
When updating the Subscription Filter (see Section 5.1.2),
the Start Location MUST not decrease, as an attempt to
to do so could fail. If Objects with Locations smaller than the current
subscription's Largest Location are required, FETCH can be used to retrieve
them. A publisher MUST terminate the session with a PROTOCOL_VIOLATION if the
SUBSCRIBE_UPDATE violates this rule.
When a subscriber narrows their subscription (increase the Start Location and/or decrease the End Group), it might still receive objects outside the new range if the publisher sent them before the update was processed. When a subscriber increases the End Location, the Largest Object at the publisher might already be larger than the previous End Location. This will create a gap in the subscription. The REQUEST_OK in response to the SUBSCRIBE_UPDATE will include the LARGEST_OBJECT parameter, and the subscriber can issue a FETCH to retrieve the omitted Objects, if any.
The receiver of a SUBSCRIBE_UPDATE MUST respond with exactly one REQUEST_OK
or REQUEST_ERROR message indicating if the update was successful. When an
update is unsuccessful, the publisher MUST also terminate the subscription with
PUBLISH_DONE with error code UPDATE_FAILED.
Like SUBSCRIBE, End Group MUST be greater than or equal to the Group specified
in Start.
If a parameter previously set on the subscription in SUBSCRIBE, PUBLISH_OK
or SUBSCRIBE_UPDATE is not present in SUBSCRIBE_UPDATE, its value remains
unchanged.
There is no mechanism to remove a parameter from a subscription.
The format of SUBSCRIBE_UPDATE is as follows:
SUBSCRIBE_UPDATE Message {
Type (i) = 0x2,
Length (16),
Request ID (i),
Subscription Request ID (i),
Number of Parameters (i),
Parameters (..) ...
}
-
Request ID: See Section 9.1.
-
Subscription Request ID: The Request ID of the SUBSCRIBE (Section 9.9) this message is updating. This MUST match an existing Request ID. The publisher MUST close the session with `
PROTOCOL_VIOLATIONif the subscriber specifies an invalid Subscription Request ID. -
Parameters: The parameters are defined in Section 9.2.1.