[ 
https://issues.apache.org/jira/browse/QPID-7366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15513665#comment-15513665
 ] 

Keith Wall edited comment on QPID-7366 at 9/22/16 4:01 PM:
-----------------------------------------------------------

Currently, the new feature allows me to inject a message containing a header 
with an empty key into the system.  If the such a message is converted for a 
0-8 client, the Broker fails with the following exception.  In 0-10 the same 
message fails on the client side on receipt.

In AMQP 0-9 the headers are transported as a field table.  Of field tables, the 
spec says (4.2.5.5) says that "Field names MUST start with a letter, '$' or '#' 
and may continue with letters, '$' or '#', digits, or underlines, to a maximum 
length of 128 characters.".  So this implies that message header names cannot 
be empty.  In AMQP 0-10, the spec doesn't impose the same restriction - it uses 
a 0-10 map for the application headers with str8 as keys.  There is no 
restriction disallowing empty keys.

As JMS disallows empty message property names. I suggest that 
{{publishMessage}} imposes the same restriction.    




{noformat}
2016-09-22 16:25:06,779         ERROR [IO-/127.0.0.1:52202] 
o.a.q.t.u.InternalBrokerHolder Uncaught exception from thread 
IO-/127.0.0.1:52202
java.lang.IllegalArgumentException: Property name must not be the empty string
        at 
org.apache.qpid.framing.FieldTable.checkPropertyName(FieldTable.java:778) 
~[classes/:na]
        at org.apache.qpid.framing.FieldTable.setProperty(FieldTable.java:140) 
~[classes/:na]
        at org.apache.qpid.framing.FieldTable.setString(FieldTable.java:558) 
~[classes/:na]
        at org.apache.qpid.framing.FieldTable.setObject(FieldTable.java:692) 
~[classes/:na]
        at org.apache.qpid.framing.FieldTable.put(FieldTable.java:1044) 
~[classes/:na]
        at 
org.apache.qpid.framing.FieldTable.convertToFieldTable(FieldTable.java:1210) 
~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convertMetaData(MessageConverter_Internal_to_v0_8.java:148)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convertToStoredMessage(MessageConverter_Internal_to_v0_8.java:75)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convert(MessageConverter_Internal_to_v0_8.java:69)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convert(MessageConverter_Internal_to_v0_8.java:48)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.ProtocolOutputConverterImpl.convertToAMQMessage(ProtocolOutputConverterImpl.java:83)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.ProtocolOutputConverterImpl.writeDeliver(ProtocolOutputConverterImpl.java:69)
 ~[classes/:na]
{no format}


There is a separate problem when the header value is null.  If a header key 
value pair has a null value and the message is sent to a 0-8 client, the Broker 
fails in the following way.  On the 0-10 path the key/value pair gets ignored.

For 0-8, field tables allow for null values expressed as VOID, so I think this 
may be a defect in {{FieldTable.put}}

{noformat}
2016-09-22 16:50:27,156         ERROR [IO-/127.0.0.1:52339] 
o.a.q.t.u.InternalBrokerHolder Uncaught exception from thread 
IO-/127.0.0.1:52339
org.apache.qpid.AMQPInvalidClassException: Only Primitive objects allowed. 
Object is: null
        at org.apache.qpid.framing.FieldTable.setObject(FieldTable.java:723) 
~[classes/:na]
        at org.apache.qpid.framing.FieldTable.put(FieldTable.java:1044) 
~[classes/:na]
        at 
org.apache.qpid.framing.FieldTable.convertToFieldTable(FieldTable.java:1210) 
~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convertMetaData(MessageConverter_Internal_to_v0_8.java:148)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convertToStoredMessage(MessageConverter_Internal_to_v0_8.java:75)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convert(MessageConverter_Internal_to_v0_8.java:69)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convert(MessageConverter_Internal_to_v0_8.java:48)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.ProtocolOutputConverterImpl.convertToAMQMessage(ProtocolOutputConverterImpl.java:83)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.ProtocolOutputConverterImpl.writeDeliver(ProtocolOutputConverterImpl.java:69)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.AMQPConnection_0_8Impl$WriteDeliverMethod.deliverToClient(AMQPConnection_0_8Impl.java:1274)
 ~[classes/:na]

{noformat}


was (Author: k-wall):
Currently, the new feature allows me to inject a message containing a header 
with an empty key into the system.  If the such a message is converted for a 
0-8 client, the Broker fails with the following exception.  In 0-10 the same 
message fails on the client side on receipt.

In AMQP 0-9 the headers are transported as a field table.  Of field tables, the 
spec says (4.2.5.5) says that "Field names MUST start with a letter, '$' or '#' 
and may continue with letters, '$' or '#', digits, or underlines, to a maximum 
length of 128 characters.".  So this implies that message header names cannot 
be empty.  In AMQP 0-10, the spec doesn't impose the same restriction - it uses 
a 0-10 map for the application headers with str8 as keys.  There is no 
restriction disallowing empty keys.

As JMS disallows empty message property names. I suggest that 
{{publishMessage}} imposes the same restriction.    




{noformat}
2016-09-22 16:25:06,779         ERROR [IO-/127.0.0.1:52202] 
o.a.q.t.u.InternalBrokerHolder Uncaught exception from thread 
IO-/127.0.0.1:52202
java.lang.IllegalArgumentException: Property name must not be the empty string
        at 
org.apache.qpid.framing.FieldTable.checkPropertyName(FieldTable.java:778) 
~[classes/:na]
        at org.apache.qpid.framing.FieldTable.setProperty(FieldTable.java:140) 
~[classes/:na]
        at org.apache.qpid.framing.FieldTable.setString(FieldTable.java:558) 
~[classes/:na]
        at org.apache.qpid.framing.FieldTable.setObject(FieldTable.java:692) 
~[classes/:na]
        at org.apache.qpid.framing.FieldTable.put(FieldTable.java:1044) 
~[classes/:na]
        at 
org.apache.qpid.framing.FieldTable.convertToFieldTable(FieldTable.java:1210) 
~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convertMetaData(MessageConverter_Internal_to_v0_8.java:148)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convertToStoredMessage(MessageConverter_Internal_to_v0_8.java:75)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convert(MessageConverter_Internal_to_v0_8.java:69)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.MessageConverter_Internal_to_v0_8.convert(MessageConverter_Internal_to_v0_8.java:48)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.ProtocolOutputConverterImpl.convertToAMQMessage(ProtocolOutputConverterImpl.java:83)
 ~[classes/:na]
        at 
org.apache.qpid.server.protocol.v0_8.ProtocolOutputConverterImpl.writeDeliver(ProtocolOutputConverterImpl.java:69)
 ~[classes/:na]
{noformat}

> [Java Broker] Add Management operation to VirtualHost to allow publishing of 
> messages through management
> --------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-7366
>                 URL: https://issues.apache.org/jira/browse/QPID-7366
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Java Broker
>            Reporter: Rob Godfrey
>            Assignee: Keith Wall
>             Fix For: qpid-java-6.1
>
>
> Sometimes it is useful to be able to publish messages into the broker without 
> requiring an AMQP client.  For this we can add a management operation to 
> allow for the publishing of messages over HTTP.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to