Uploaded image for project: 'AMQ Clients'
  1. AMQ Clients
  2. ENTMQCL-513

[python] Allow rejecting messages inside of a transaction

    XMLWordPrintable

Details

    • Story
    • Resolution: Unresolved
    • Minor
    • None
    • 1.1.0-GA
    • amqp-python-client
    • None

    Description

      Rollback with python proton client does not happen if I settle the message (accept it) before doing the rollback. The message will not be redelivered if I try to receive it again afterwards.

      I looked at AMQP standard and honestly I do not understand this section about this http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transactions-v1.0-os.html#doc-idp145616. When attempted with qpid-jms, the message will be redelivered, even if I called Message#acknowledge on it.

      Workaround is not to settle (not to call self.accept(message) in the python client.

      PN_TRACE_FRM looks like this

      % PN_TRACE_FRM=1 node_data/clients/aac5_receiver.py  --timeout 10 --broker-url "127.0.0.1:5672/test_transaction_send_rollback_commit_delivery_count" --log-msgs interop --count 1 --tx-endloop-action rollback
      [0x192f710]:  -> SASL
      [0x192f710]:  <- SASL
      [0x192f710]:0 <- @sasl-mechanisms(64) [sasl-server-mechanisms=@PN_SYMBOL[:PLAIN, :ANONYMOUS]]
      [0x192f710]:0 -> @sasl-init(65) [mechanism=:ANONYMOUS, initial-response=b"anonymous"]
      [0x192f710]:0 <- @sasl-outcome(68) [code=0]
      [0x192f710]:  <- AMQP
      [0x192f710]:  -> AMQP
      [0x192f710]:0 -> @open(16) [container-id="577640b4-9b33-49fb-80a8-a48806f4f674", hostname="127.0.0.1", channel-max=32767]
      [0x192f710]:0 -> @begin(17) [next-outgoing-id=0, incoming-window=2147483647, outgoing-window=2147483647]
      [0x192f710]:0 -> @attach(18) [name="577640b4-9b33-49fb-80a8-a48806f4f674-test_transaction_send_rollback_commit_delivery_count", handle=0, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="test_transaction_send_rollback_commit_delivery_count", durable=0, timeout=0, dynamic=false], target=@target(41) [durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
      [0x192f710]:0 -> @attach(18) [name="txn-ctrl", handle=1, role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [durable=0, timeout=0, dynamic=false], target=@coordinator(48) [capabilities=:"amqp:local-transactions"], initial-delivery-count=0]
      [0x192f710]:0 <- @open(16) [container-id="amq", max-frame-size=4294967295, channel-max=65535, idle-time-out=30000, offered-capabilities=@PN_SYMBOL[:"sole-connection-for-container", :"DELAYED_DELIVERY", :"SHARED-SUBS", :"ANONYMOUS-RELAY"], properties={:product="apache-activemq-artemis", :version="2.2.0-SNAPSHOT"}]
      [0x192f710]:0 <- @begin(17) [remote-channel=0, next-outgoing-id=1, incoming-window=2147483647, outgoing-window=2147483647, handle-max=65535]
      [0x192f710]:0 <- @attach(18) [name="577640b4-9b33-49fb-80a8-a48806f4f674-test_transaction_send_rollback_commit_delivery_count", handle=0, role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="test_transaction_send_rollback_commit_delivery_count"], target=@target(41) [], incomplete-unsettled=false, initial-delivery-count=0]
      [0x192f710]:0 <- @attach(18) [name="txn-ctrl", handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [], target=@coordinator(48) [capabilities=@PN_SYMBOL[:"amqp:local-transactions", :"amqp:multi-txns-per-ssn", :"amqp:multi-ssns-per-txn"]]]
      [0x192f710]:0 <- @flow(19) [next-incoming-id=0, incoming-window=2147483647, next-outgoing-id=1, outgoing-window=2147483647, handle=1, delivery-count=0, link-credit=1000]
      [0x192f710]:0 -> @transfer(20) [handle=1, delivery-id=0, delivery-tag=b"1", message-format=0, settled=false, more=false] (94) "\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\x00\xa3\x11amqp:declare:list\xd0\x00\x00\x00\x05\x00\x00\x00\x01@"
      [0x192f710]:0 <- @disposition(21) [role=true, first=0, last=0, settled=true, state=@declared(51) [txn-id=b"a95501dd-6c85-11e7-8c85-185e0fec8ce5"]]
      [0x192f710]:0 -> @flow(19) [next-incoming-id=1, incoming-window=2147483647, next-outgoing-id=1, outgoing-window=2147483647, handle=0, delivery-count=0, link-credit=1, drain=false]
      [0x192f710]:0 <- @transfer(20) [handle=0, delivery-id=0, delivery-tag=b"0", message-format=0] (86) "\x00Sp\xc0\x07\x05BP\x04@BC\x00Ss\xd0\x00\x00\x00-\x00\x00\x00\x0d@@@@@@\xa3\x0atext/plain@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@R\x00@\x00St\xd1\x00\x00\x00\x04\x00\x00\x00\x00\x00Sw\xa1\x04None"
      {'address': None, 'content': 'None', 'content-encoding': None, 'content-type': 'text/plain', 'correlation-id': None, 'creation-time': 0, 'delivery-count': 0, 'durable': False, 'absolute-expiry-time': 0, 'first-acquirer': False, 'group-id': None, 'group-sequence': 0, 'id': None, 'priority': 4, 'properties': {}, 'reply-to': None, 'reply-to-group-id': None, 'subject': None, 'ttl': 0, 'user-id': None}
      [0x192f710]:0 -> @transfer(20) [handle=1, delivery-id=1, delivery-tag=b"2", message-format=0, settled=false, more=false] (134) "\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\x00\xa3\x13amqp:discharge:list\xd0\x00\x00\x00+\x00\x00\x00\x02\xa0$a95501dd-6c85-11e7-8c85-185e0fec8ce5A"
      [0x192f710]:0 -> @disposition(21) [role=true, first=0, last=0, settled=true, state=@accepted(36) []]
      [0x192f710]:0 <- @disposition(21) [role=true, first=1, last=1, settled=true, state=@accepted(36) []]
      [0x192f710]:0 -> @detach(22) [handle=1, closed=true]
      [0x192f710]:0 -> @close(24) []
      [0x192f710]:  -> EOS
      [0x192f710]:0 <- @detach(22) [handle=1, closed=true]
      [0x192f710]:0 <- @close(24) []
      [0x192f710]:  <- EOS
      

      Attachments

        Issue Links

          Activity

            People

              jross@redhat.com Justin Ross
              jdanek@redhat.com Jiri Daněk
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: