Proposal for Issue
http://www.w3.org/Bugs/Public/show_bug.cgi?id=6431
WS-Eventing does not support pause and resume of subscriptions. The workaround is to use Unsubscribe/Subscribe pattern. But this may create overhead in the Event Source and Subscription Manager, as Subscribe and Unsubscribe may require extra processing, such as authentication and authorization checks, compared to pause/resume.
We propose adding Pause(SubscriptionManager) and Resume(SubscriptionManager) operations.
Proposed Changes
1. Add the following section 3 for Pause operation.
A Subscriber may need to temporarily suspend event notifications without terminating the subscription. Using Unsubscribe and Re-subscribe can achieve the same effect but incurs additional cost required by subscriptions, such as authentication and authorization.
To suspend event delivery related to a subscription, the subscriber sends a request of the following form to the subscription manager:
<s:Envelope
>
<s:Header
>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2004/08/eventing/Pause
</wsa:Action>
</s:Header>
<s:Body
>
<wse:Pause retain=xs:integer?
>
xs:any*
</wse:Pause>
</s:Body>
</s:Envelope>
/s:Envelope/s:Body/*/wse:Pause/@retain=0
Indicate theRequested
maximum number
of last most recent messages
to retain after the pause, and deliver
when the paused subscription is resumed.
Implied value is 0 indicating no message is retained. A negative value
indicates all messages are to be retained up to the limit that the
subscription manager allows. The
subscription manager may set its own limit for retention. If the
requested maximum number of messages to retainretention value exceeds that limit thatsubscription
manager subscription managerallows, the
subscription managerit MUST generate a
wse:invalidRetentionValue fault. The retained messages
are filtered by the filter, if any, as specified Section 433.1
before being retained.4 on event filtering.
If the request is accepted, the subscription manager MUST reply with a response of the following form:
<s:Envelope
>
<s:Header
>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2004/08/eventing/PauseResponse
</wsa:Action>
</s:Header>
<s:Body
>
<wse:PauseResponse retain=xs:integer?
>
xs:any*
</wse:PauseResponse>
</s:Body>
</s:Envelope>
/s:Envelope/s:Body/*/wse:Pause/@retain
Indicate tThe
maximum number of last most recent messages
the subscription manager agrees to retain. Implied value is the same as in
the request message. If the subscription manager cannot retain the agreed number
of messages during the pause, it MUST terminate the
subscription and generate a Subscription End message as
defined in Section 3.5.
If the subscription manager cannot
pause this subscription, the request MUST fail, and the subscription manager MAY MUST generate
a wse:UnableToPause fault indicating that the pause was not accepted.
Other components of the outline above are not further constrained by this specification.
Table x lists a hypothetical
request to pause the subscription created in Ttable
5 and retains only one the latest
message during pause.
Table x: Hypothetical request to pause the second subscription
(01) <s12:Envelope
(02) xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
(03) xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
(04) xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing"
(05) xmlns:ow="http://www.example.org/oceanwatch" >
(06) <s12:Header>
(07) <wsa:Action>
(08) http://schemas.xmlsoap.org/ws/2004/08/eventing/Pause
(09) </wsa:Action>
(10) <wsa:MessageID>
(11) uuid:bd88b3df-5db4-4392-9621-aee9160721f6
(12) </wsa:MessageID>
(13) <wsa:ReplyTo>
(14) <wsa:Address>http://www.example.com/MyEventSink</wsa:Address>
(15) </wsa:ReplyTo>
(16) <wsa:To>
(17) http://www.example.org/oceanwatch/SubscriptionManager
(18) </wsa:To>
(19) <wse:Identifier wsa:IsReferenceParameer=true>
(20) uuid:22e8a584-0d18-4228-b2a8-3716fa2097fa
(21) </wse:Identifier>
(22) </s12:Header>
(23) <s12:Body>
(24) <wse:Pause retain=1 />
(25) </s12:Body>
(26) </s12:Envelope>
Lines (07-09) indicate this is a
request to pause a subscription. Lines (16-21) indicate that the request is
sent to the subscription manager for the subscription created in Ttable
5 .
Table x+1 lists a hypothetical
response to the request in Ttable
x .
Table x+1: Hypothetical response to pause request
(01) <s12:Envelope
(02) xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
(03) xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
(04) xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing"
(05) xmlns:ow="http://www.example.org/oceanwatch" >
(06) <s12:Header>
(07) <wsa:Action>
(08) http://schemas.xmlsoap.org/ws/2004/08/eventing/PauseResponse
(09) </wsa:Action>
(10) <wsa:RelatesTo>
(11) uuid:bd88b3df-5db4-4392-9621-aee9160721f6
(12) </wsa:RelatesTo>
(13) <wsa:To>http://www.example.com/MyEventSink</wsa:To>
(14) </s12:Header>
(15) <s12:Body>
(16) <wse:PauseResponse />
(17) </s12:Body>
(18) </s12:Envelope>
Line (16) in Ttable
x+1 indicates the request is accepted.
2. Add the following section 3 for Resume operation.
To resume event delivery related to a paused subscription, the subscriber sends a request of the following form to the subscription manager:
<s:Envelope
>
<s:Header
>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2004/08/eventing/Resume
</wsa:Action>
</s:Header>
<s:Body
>
<wse:Resume
>
xs:any
</wse:Resume>
</s:Body>
</s:Envelope>
If the request is accepted, the subscription manager MUST reply with a response of the following form:
<s:Envelope
>
<s:Header
>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2004/08/eventing/ResumeResponse
</wsa:Action>
</s:Header>
<s:Body
>
<wse:ResumeResponse
>
xs:any
</wse:ResumeResponse>
</s:Body>
</s:Envelope>
If the subscription manager
cannot resume this subscription, the request MUST fail, and the subscription
manager MAY
MUST generate a wse:UnableToResume
fault indicating that the resumption was not accepted.
Other components of the outline above are not further constrained by this specification.
Table y lists a hypothetical
request to pause resume the
subscription created in Ttable
5
that was paused in Table x and retains only the latest
message during pause.
Table y: Hypothetical request to resume the second subscription
(01) <s12:Envelope
(02) xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
(03) xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
(04) xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing"
(05) xmlns:ow="http://www.example.org/oceanwatch" >
(06) <s12:Header>
(07) <wsa:Action>
(08) http://schemas.xmlsoap.org/ws/2004/08/eventing/Pause
(09) </wsa:Action>
(10) <wsa:MessageID>
(11) uuid:bd88b3df-5db4-4392-9621-aee9160721f6
(12) </wsa:MessageID>
(13) <wsa:ReplyTo>
(14) <wsa:Address>http://www.example.com/MyEventSink</wsa:Address>
(15) </wsa:ReplyTo>
(16) <wsa:To>
(17) http://www.example.org/oceanwatch/SubscriptionManager
(18) </wsa:To>
(19) <wse:Identifier wsa:IsReferenceParameer=true>
(20) uuid:22e8a584-0d18-4228-b2a8-3716fa2097fa
(21) </wse:Identifier>
(22) </s12:Header>
(23) <s12:Body>
(24) <wse:Resume />
(25) </s12:Body>
(26) </s12:Envelope>
Lines (07-0924)
indicate this is a request to pause resume a
subscription. Lines (16-21) indicate that the request is sent to the
subscription manager for the subscription created in Ttable
5 .
Table y+1 lists a hypothetical
response to the request in Ttable
y .
Table y+1: Hypothetical response to resume request
(01) <s12:Envelope
(02) xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
(03) xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
(04) xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing"
(05) xmlns:ow="http://www.example.org/oceanwatch" >
(06) <s12:Header>
(07) <wsa:Action>
(08) http://schemas.xmlsoap.org/ws/2004/08/eventing/PauseResponse
(09) </wsa:Action>
(10) <wsa:RelatesTo>
(11) uuid:bd88b3df-5db4-4392-9621-aee9160721f6
(12) </wsa:RelatesTo>
(13) <wsa:To>http://www.example.com/MyEventSink</wsa:To>
(14) </s12:Header>
(15) <s12:Body>
(16) <wse:ResumeResponse />
(17) </s12:Body>
(18) </s12:Envelope>
Line (16) in Ttable
y+1 indicates the request is accepted.