On 26/08/16 20:18, Matt Broadstone wrote:
it appears that `release` in the
python client is in fact sending a `modified` outcome!

Sorry! Attached is the fixed example with which I also see the expected behaviour:

[0x5590136bb570]:  -> SASL
[0x5590136bb570]:  <- SASL
[0x5590136bb570]:0 <- @sasl-mechanisms(64) 
[sasl-server-mechanisms=@PN_SYMBOL[:ANONYMOUS, :PLAIN]]
[0x5590136bb570]:0 -> @sasl-init(65) [mechanism=:ANONYMOUS, 
initial-response=b"[email protected]"]
[0x5590136bb570]:0 <- @sasl-outcome(68) [code=0]
[0x5590136bb570]:  -> AMQP
[0x5590136bb570]:0 -> @open(16) [container-id="d397c93a-d592-4312-99bc-e02178b836c0", 
hostname="localhost", channel-max=32767]
[0x5590136bb570]:0 -> @begin(17) [next-outgoing-id=0, 
incoming-window=2147483647, outgoing-window=2147483647]
[0x5590136bb570]:0 -> @attach(18) [name="d397c93a-d592-4312-99bc-e02178b836c0-examples", 
handle=0, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) 
[address="examples", durable=0, timeout=0, dynamic=false], target=@target(41) [durable=0, 
timeout=0, dynamic=false], initial-delivery-count=0]
[0x5590136bb570]:0 -> @attach(18) [name="d397c93a-d592-4312-99bc-e02178b836c0-examples", 
handle=1, role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [durable=0, timeout=0, 
dynamic=false], target=@target(41) [address="examples", durable=0, timeout=0, 
dynamic=false], initial-delivery-count=0]
[0x5590136bb570]:0 -> @flow(19) [incoming-window=2147483647, 
next-outgoing-id=0, outgoing-window=2147483647, handle=0, delivery-count=0, 
link-credit=10, drain=false]
[0x5590136bb570]:  <- AMQP
[0x5590136bb570]:0 <- @open(16) [container-id="a6022696-2483-49f5-8ea6-a6f50db0e7ae", channel-max=32767, 
offered-capabilities=@PN_SYMBOL[:"ANONYMOUS-RELAY"], properties={:product="qpid-cpp", :version="0.35", 
:platform="Linux", :host="localhost.localdomain"}]
[0x5590136bb570]:0 <- @begin(17) [remote-channel=0, next-outgoing-id=0, 
incoming-window=2147483647, outgoing-window=2147483647]
[0x5590136bb570]:0 <- @attach(18) [name="d397c93a-d592-4312-99bc-e02178b836c0-examples", 
handle=0, role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) 
[address="examples", durable=0, timeout=0, dynamic=false, distribution-mode=:move], 
target=@target(41) [durable=0, timeout=0, dynamic=false], initial-delivery-count=0]
[0x5590136bb570]:0 <- @attach(18) [name="d397c93a-d592-4312-99bc-e02178b836c0-examples", 
handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [durable=0, timeout=0, 
dynamic=false], target=@target(41) [address="examples", durable=0, timeout=0, 
dynamic=false], initial-delivery-count=0]
[0x5590136bb570]:0 <- @flow(19) [next-incoming-id=0, 
incoming-window=2147483647, next-outgoing-id=0, outgoing-window=2147483647, 
handle=1, delivery-count=0, link-credit=500, drain=false]
[0x5590136bb570]:0 -> @transfer(20) [handle=1, delivery-id=0, delivery-tag=b"1", 
message-format=0, settled=false, more=false] (78) 
"\x00Sp\xd0\x00\x00\x00\x0b\x00\x00\x00\x05BP\x04@BR\x00\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 <- @flow(19) [next-incoming-id=1, 
incoming-window=2147483647, next-outgoing-id=0, outgoing-window=2147483647, 
handle=1, delivery-count=1, link-credit=500, drain=false]
[0x5590136bb570]:0 <- @transfer(20) [handle=0, delivery-id=0, 
delivery-tag=b"\x00\x00\x00\x00", message-format=0, settled=false, more=false] (70) 
"\x00Sp\xc0\x06\x04BP\x04@A\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 <- @disposition(21) [role=true, first=0, last=0, 
settled=true, state=@accepted(36) []]
[0x5590136bb570]:0 -> @disposition(21) [role=true, first=0, last=0, 
settled=true, state=@released(38) []]
[0x5590136bb570]:0 <- @transfer(20) [handle=0, delivery-id=1, 
delivery-tag=b"\x00\x00\x00\x01", message-format=0, settled=false, more=false] (70) 
"\x00Sp\xc0\x06\x04BP\x04@A\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 -> @flow(19) [next-incoming-id=2, 
incoming-window=2147483647, next-outgoing-id=1, outgoing-window=2147483647, 
handle=0, delivery-count=2, link-credit=9, drain=false]
[0x5590136bb570]:0 -> @disposition(21) [role=true, first=1, last=1, 
settled=true, state=@released(38) []]
[0x5590136bb570]:0 <- @transfer(20) [handle=0, delivery-id=2, 
delivery-tag=b"\x00\x00\x00\x02", message-format=0, settled=false, more=false] (70) 
"\x00Sp\xc0\x06\x04BP\x04@A\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 -> @flow(19) [next-incoming-id=3, 
incoming-window=2147483647, next-outgoing-id=1, outgoing-window=2147483647, 
handle=0, delivery-count=3, link-credit=9, drain=false]
[0x5590136bb570]:0 -> @disposition(21) [role=true, first=2, last=2, 
settled=true, state=@released(38) []]
[0x5590136bb570]:0 <- @transfer(20) [handle=0, delivery-id=3, 
delivery-tag=b"\x00\x00\x00\x03", message-format=0, settled=false, more=false] (70) 
"\x00Sp\xc0\x06\x04BP\x04@A\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 -> @flow(19) [next-incoming-id=4, 
incoming-window=2147483647, next-outgoing-id=1, outgoing-window=2147483647, 
handle=0, delivery-count=4, link-credit=9, drain=false]
[0x5590136bb570]:0 -> @disposition(21) [role=true, first=3, last=3, 
settled=true, state=@released(38) []]
[0x5590136bb570]:0 <- @transfer(20) [handle=0, delivery-id=4, 
delivery-tag=b"\x00\x00\x00\x04", message-format=0, settled=false, more=false] (70) 
"\x00Sp\xc0\x06\x04BP\x04@A\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 -> @flow(19) [next-incoming-id=5, 
incoming-window=2147483647, next-outgoing-id=1, outgoing-window=2147483647, 
handle=0, delivery-count=5, link-credit=9, drain=false]
[0x5590136bb570]:0 -> @disposition(21) [role=true, first=4, last=4, 
settled=true, state=@released(38) []]
[0x5590136bb570]:0 <- @transfer(20) [handle=0, delivery-id=5, 
delivery-tag=b"\x00\x00\x00\x05", message-format=0, settled=false, more=false] (70) 
"\x00Sp\xc0\x06\x04BP\x04@A\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 -> @flow(19) [next-incoming-id=6, 
incoming-window=2147483647, next-outgoing-id=1, outgoing-window=2147483647, 
handle=0, delivery-count=6, link-credit=9, drain=false]
[0x5590136bb570]:0 -> @disposition(21) [role=true, first=5, last=5, 
settled=true, state=@released(38) []]
[0x5590136bb570]:0 <- @transfer(20) [handle=0, delivery-id=6, 
delivery-tag=b"\x00\x00\x00\x06", message-format=0, settled=false, more=false] (70) 
"\x00Sp\xc0\x06\x04BP\x04@A\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 -> @flow(19) [next-incoming-id=7, 
incoming-window=2147483647, next-outgoing-id=1, outgoing-window=2147483647, 
handle=0, delivery-count=7, link-credit=9, drain=false]
[0x5590136bb570]:0 -> @disposition(21) [role=true, first=6, last=6, 
settled=true, state=@released(38) []]
[0x5590136bb570]:0 <- @transfer(20) [handle=0, delivery-id=7, 
delivery-tag=b"\x00\x00\x00\x07", message-format=0, settled=false, more=false] (70) 
"\x00Sp\xc0\x06\x04BP\x04@A\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 -> @flow(19) [next-incoming-id=8, 
incoming-window=2147483647, next-outgoing-id=1, outgoing-window=2147483647, 
handle=0, delivery-count=8, link-credit=9, drain=false]
[0x5590136bb570]:0 -> @disposition(21) [role=true, first=7, last=7, 
settled=true, state=@released(38) []]
[0x5590136bb570]:0 <- @transfer(20) [handle=0, delivery-id=8, 
delivery-tag=b"\x00\x00\x00\x08", message-format=0, settled=false, more=false] (70) 
"\x00Sp\xc0\x06\x04BP\x04@A\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 -> @flow(19) [next-incoming-id=9, 
incoming-window=2147483647, next-outgoing-id=1, outgoing-window=2147483647, 
handle=0, delivery-count=9, link-credit=9, drain=false]
[0x5590136bb570]:0 -> @disposition(21) [role=true, first=8, last=8, 
settled=true, state=@released(38) []]
[0x5590136bb570]:0 <- @transfer(20) [handle=0, delivery-id=9, 
delivery-tag=b"\x00\x00\x00\x09", message-format=0, settled=false, more=false] (70) 
"\x00Sp\xc0\x06\x04BP\x04@A\x00Ss\xd0\x00\x00\x00"\x00\x00\x00\x0d@@@@@@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00Sw\xa1\x0ctest
 message"
[0x5590136bb570]:0 -> @disposition(21) [role=true, first=9, last=9, 
settled=true, state=@released(38) []]
[0x5590136bb570]:0 -> @detach(22) [handle=0, closed=true]
[0x5590136bb570]:0 -> @close(24) []
[0x5590136bb570]:  -> EOS
[0x5590136bb570]:0 <- @detach(22) [handle=0, closed=true]
[0x5590136bb570]:0 <- @close(24) []
[0x5590136bb570]:  <- EOS
[gordon@localhost python]$

#!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

from __future__ import print_function
import optparse
from proton import Message, Url
from proton.handlers import MessagingHandler
from proton.reactor import Container

class Recv(MessagingHandler):
    def __init__(self, url, count):
        super(Recv, self).__init__(auto_accept=False)
        self.url = Url(url)
        self.expected = count
        self.received = 0

    def on_start(self, event):
        conn = event.container.connect(self.url)
        event.container.create_receiver(conn, self.url.path)
        event.container.create_sender(conn, self.url.path).send(Message(body=u'test message'))

    def on_message(self, event):
        self.received += 1
        if self.received == self.expected:
            event.receiver.close()
            event.connection.close()
        self.release(event.delivery, False)

parser = optparse.OptionParser(usage="usage: %prog [options]")
parser.add_option("-a", "--address", default="localhost:5672/examples",
                  help="address from which messages are received (default %default)")
parser.add_option("-m", "--messages", type="int", default=10,
                  help="number of messages to receive; 0 receives indefinitely (default %default)")
opts, args = parser.parse_args()

try:
    Container(Recv(opts.address, opts.messages)).run()
except KeyboardInterrupt: pass




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to