Kale Blankenship created PROTON-1740:
----------------------------------------

             Summary: Error during transfer when sender doesn't include 
initial-delivery-count in attach
                 Key: PROTON-1740
                 URL: https://issues.apache.org/jira/browse/PROTON-1740
             Project: Qpid Proton
          Issue Type: Bug
          Components: proton-j
            Reporter: Kale Blankenship
            Priority: Minor


I originally opened this against ActiveMQ (AMQ-6881) and it was suggested I 
open it here instead as the error occurs within Proton.

I ran across this issue while testing my Go AMQP implementation against 
ActiveMQ. When attempting to send messages to ActiveMQ the connection would be 
terminated an error like `AmqpProtocolException: Could not decode AMQP frame: 
hex: ...`. I eventually tracked this down to my client not including 
initial-delivery-count in the attach. The spec is clear that the field "MUST 
NOT be null if role is sender," so it was an oversight on my part.

I was surprised that the failure occurred when the first transfer frame was 
sent rather than the malformed attach. Though my Java knowledge is very 
limited, the stack trace I was able to get (by removing some of the handling) 
implies that the delivery-count in Proton was not initialized during the attach 
and then caused a NullPointerException when the delivery-count was incremented 
while processing the transfer.

```
java.lang.NullPointerException
at 
org.apache.qpid.proton.engine.impl.TransportLink.incrementDeliveryCount(TransportLink.java:202)
at 
org.apache.qpid.proton.engine.impl.TransportSession.handleTransfer(TransportSession.java:326)
at 
org.apache.qpid.proton.engine.impl.TransportImpl.handleTransfer(TransportImpl.java:1266)
at 
org.apache.qpid.proton.engine.impl.TransportImpl.handleTransfer(TransportImpl.java:66)
at org.apache.qpid.proton.amqp.transport.Transfer.invoke(Transfer.java:160)
at 
org.apache.qpid.proton.engine.impl.TransportImpl.handleFrame(TransportImpl.java:1384)
at org.apache.qpid.proton.engine.impl.FrameParser.input(FrameParser.java:418)
at org.apache.qpid.proton.engine.impl.FrameParser.process(FrameParser.java:527)
at 
org.apache.qpid.proton.engine.impl.SaslImpl$SaslTransportWrapper.reallyProcessInput(SaslImpl.java:658)
at 
org.apache.qpid.proton.engine.impl.SaslImpl$SaslTransportWrapper.process(SaslImpl.java:607)
at 
org.apache.qpid.proton.engine.impl.HandshakeSniffingTransportWrapper.process(HandshakeSniffingTransportWrapper.java:101)
at 
org.apache.qpid.proton.engine.impl.TransportImpl.process(TransportImpl.java:1495)
at 
org.apache.qpid.proton.engine.impl.TransportImpl.processInput(TransportImpl.java:1453)
at 
org.apache.qpid.proton.engine.impl.TransportImpl.input(TransportImpl.java:298)
at 
org.apache.activemq.transport.amqp.protocol.AmqpConnection.onAMQPData(AmqpConnection.java:373)
at 
org.apache.activemq.transport.amqp.AmqpTransportFilter.onCommand(AmqpTransportFilter.java:109)
at 
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:233)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)
at java.base/java.lang.Thread.run(Thread.java:844)
```



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to