[Standards-JIG] JEP-0079 (AMP): conditions reversed?

Tijl Houtbeckers thoutbeckers at splendo.com
Tue May 31 15:45:10 UTC 2005


On Tue, 31 May 2005 12:57:16 +0200, Ralph Meijer <jabber.org at ralphm.ik.nu>  
wrote:

> I was thinking about using AMP in combination with pubsub, and thus
> started reading the AMP JEP carefully.

That always gives me a headache.

> Take the following example taken
> from section 5.1 (indented):
>
>     The <message/> stanza is nearly ideal for data transport, but to  
> ensure
>     reliability it is often desirable that such messages not be  
> delivered to
>     any resource but that specified. To facilitate this, the sending  
> entity
>     includes a <rule action='drop' condition='match-resource'
>     value='exact'/> (if failure notification is unnecessary) or <rule
>     action='error' condition='match-resource' value='exact'/> (if failure
>     notification is required). The following example illustrates this  
> using
>     In-Band Bytestreams [9]:
>
>     Example 10. Sending a message for reliable data transport
>
>     <message to='francisco at hamlet.lit/pda'
> 	     from='bernardo at hamlet.lit/elsinore'
> 	     id='ibb1'>
>       <data xmlns='http://jabber.org/protocol/ibb' sid='mySID' seq='0'>
> 	qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ
> 	WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu
> 	IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P
> 	AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH
> 	kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA
>       </data>
>       <amp xmlns='http://jabber.org/protocol/amp' per-hop='true'>
> 	<rule condition='expire-at' value='2004-09-10T08:33:14Z'
>     action='error'/>
> 	<rule condition='match-resource' value='exact' action='error'/>
>       </amp>
>     </message>
> 	
>
>     In the above case, the sender would receive an error reply if the
>     message could not be delivered specifically to
>     "francisco at hamlet.lit/pda" within 500 seconds.
>
>     Example 11. Failed reliable data transport message
>
>     <message from='hamlet.lit'
> 	     to='bernardo at hamlet.lit/elsinore'
> 	     id='ibb1'>
>       <data xmlns='http://jabber.org/protocol/ibb' sid='mySID' seq='0'>
> 	qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ
> 	WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu
> 	IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P
> 	AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH
> 	kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA
>       </data>
>       <amp xmlns='http://jabber.org/protocol/amp'
> 	  from='bernardo at hamlet.lit/elsinore'
> 	  to='francisco at hamlet.lit/pda'>
> 	<rule condition='match-resource' value='exact' action='error'/>
>       </amp>
>       <error type='modify' code='500'>
> 	<undefined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
> 	<failed-rules xmlns='http://jabber.org/protocol/amp#errors'>
> 	  <rule condition='match-resource' value='exact' action='error'/>
> 	</failed-rules>
>       </error>
>     </message>
>
> As I see it, the condition match-resource, using the value 'exact',
> would only match if the resource *did* match. So, if it could be
> delivered, the message would get dropped?

I've written before to the list that this seemingly "inverted" behaviour  
is difficult to grasp. Apperently even for the JEP authors (maybe PSA  
added this example, and MM is the orginal author?)

The example is wrong, because the wrong "value" is used. The value should  
be "other".

>
> Also, what happens in the case when the default action is offline
> storage? Does the resource still match?

If you want to prevent offline storage, add a "deliver" rule. (could be  
added to the IBB example). However you're right, whether sending it to  
"storage" counts as delivering the message, it's not clear at the moment.

>
> I think only the expire-at condition is correctly defined, and that the
> others should be reversed in their meaning.
>

Currently AMP is used to pick up on specific conditions as specified by  
you to execute an action (error, drop, notifications etc). What you  
suggest is to use AMP to execute an action, UNLESS all conditions  
specified by you are met? I too think that would make AMP a little easier  
to work with, but it's quite a change from how AMP works now.





More information about the Standards mailing list