Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.19
-
None
Description
The Java Broker permits a client to negotiate (connection.tune, connection.tune-ok) the AMQP frame-size to zero, only to fail later (during message delivery) with the following obscure exception:
2012-11-06 15:50:51,550 ERROR [IoReceiver - /127.0.0.1:36210] (AMQProtocolEngine.java:248) - Unexpected exception when processing datablock java.lang.IllegalArgumentException at java.nio.Buffer.limit(Buffer.java:249) at org.apache.qpid.server.store.StoredMemoryMessage.getContent(StoredMemoryMessage.java:121) at org.apache.qpid.server.message.AMQMessage.getContent(AMQMessage.java:246) at org.apache.qpid.server.output.ProtocolOutputConverterImpl$MessageContentSourceBody.writePayload(ProtocolOutputConverterImpl.java:165) at org.apache.qpid.framing.AMQFrame.writeFrames(AMQFrame.java:123) at org.apache.qpid.server.output.ProtocolOutputConverterImpl$CompositeAMQBodyBlock.writePayload(ProtocolOutputConverterImpl.java:381) at org.apache.qpid.server.protocol.AMQProtocolEngine.asByteBuffer(AMQProtocolEngine.java:408) at org.apache.qpid.server.protocol.AMQProtocolEngine.writeFrame(AMQProtocolEngine.java:541) at org.apache.qpid.server.output.ProtocolOutputConverterImpl.writeFrame(ProtocolOutputConverterImpl.java:342) at org.apache.qpid.server.output.ProtocolOutputConverterImpl.writeMessageDelivery(ProtocolOutputConverterImpl.java:126) at org.apache.qpid.server.output.ProtocolOutputConverterImpl.writeMessageDelivery(ProtocolOutputConverterImpl.java:96) at org.apache.qpid.server.output.ProtocolOutputConverterImpl.writeDeliver(ProtocolOutputConverterImpl.java:71) at org.apache.qpid.server.protocol.AMQProtocolEngine$WriteDeliverMethod.deliverToClient(AMQProtocolEngine.java:1449) at org.apache.qpid.server.subscription.SubscriptionImpl.sendToClient(SubscriptionImpl.java:666) at org.apache.qpid.server.subscription.SubscriptionImpl$AckSubscription.send(SubscriptionImpl.java:286) at org.apache.qpid.server.queue.SimpleAMQQueue.deliverMessage(SimpleAMQQueue.java:834) at org.apache.qpid.server.queue.SimpleAMQQueue.deliverToSubscription(SimpleAMQQueue.java:753) at org.apache.qpid.server.queue.SimpleAMQQueue.enqueue(SimpleAMQQueue.java:701) at org.apache.qpid.server.AMQChannel$MessageDeliveryAction.postCommit(AMQChannel.java:1203) at org.apache.qpid.server.AMQChannel$AsyncCommand.complete(AMQChannel.java:1623) at org.apache.qpid.server.AMQChannel.sync(AMQChannel.java:1593)
It is easy for a user of the Python client to fall foul of this problem as it's API current requires that the user remembers to pass all tune-parameters (rather than simply those the user wishes to change). This in itself is probably a defect.
However, regardless of any client shortcoming, the underlying problem here is the Java Broker. The AMQP spec (0-8..0.10) requires that the Broker should reject an attempt to reduce the frame-size below 4096.
0-8..0-9-1 Until the frame-max has been negotiated, both peers MUST accept frames of up to frame-min-size octets large, and the minimum negotiated value for frame-max is also frame-min-size (frame-min-size=4096) [
0-10 Until the max-frame-size has been negotiated, both peers MUST accept frames of up to MIN-MAX-FRAME-SIZE octets large, and the minimum negotiated value for max-frame-size is also MIN-MAX-FRAME-SIZE. (MIN-MAX-FRAME-SIZE=4096)