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.

 

3.x Pause

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

Requested maximum number of 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. The subscription manager may set its own limit for retention. If the requested retention value exceeds that limit , the subscription manager MUST generate a wse:invalidRetentionValue fault. The messages are filtered by the filter, if any, as specified Section 3.1 before being retained.

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

The maximum number of 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 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 Table 5 and retain only one 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 Table 5 .

Table x+1 lists a hypothetical response to the request in Table 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 Table x+1 indicates the request is accepted.

 

2.      Add the following section 3 for Resume operation.

 

3.y Resume

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 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 resume the subscription created in Table 5 that was paused in Table x.

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 (24) indicate this is a request to resume a subscription. Lines (16-21) indicate that the request is sent to the subscription manager for the subscription created in Table 5 .

Table y+1 lists a hypothetical response to the request in Table 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 Table y+1 indicates the request is accepted.