Kale Blankenship created AMQ-6881:
-------------------------------------

             Summary: Error during transfer when sender doesn't include 
initial-delivery-count in attach
                 Key: AMQ-6881
                 URL: https://issues.apache.org/jira/browse/AMQ-6881
             Project: ActiveMQ
          Issue Type: Bug
          Components: AMQP
            Reporter: Kale Blankenship
            Priority: Minor


I'm not sure whether this will be considered a bug, but I figured I'd at least 
let you know.

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 ActiveMQ/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)

Reply via email to