rabbitmq / rabbitmq-server

Open source RabbitMQ: core server and tier 1 (built-in) plugins
https://www.rabbitmq.com/
Other
12.28k stars 3.91k forks source link

Produce better error messages for unsupported values of boolean headers #2564

Open jegade opened 7 years ago

jegade commented 7 years ago

I tried to persistent my messages with the persistent-Header, but instead of value=true i wrote value=1 which results in an processing error, without further information.

It would be great to support "1" or create a proper error message, like "Unsupported value for persistent-Header, please use true/false"

filter: (ip or ip6) and ( port 61613 )
####
T 172.23.0.5:44098 -> 172.23.0.4:61613 [AP]
CONNECT
passcode:guest
login:guest

.
##
T 172.23.0.4:61613 -> 172.23.0.5:44098 [AP]
CONNECTED
server:RabbitMQ/3.6.10
session:session-CjCUqTY2FL3AmHUkS4Lflg
heart-beat:0,0
version:1.0

.

##
T 172.23.0.5:44098 -> 172.23.0.4:61613 [AP]
SEND
destination:/queue/elastic
persistent:1
receipt:session-CjCUqTY2FL3AmHUkS4Lflg-1

{"hello":"World","count":1}.
#
T 172.23.0.4:61613 -> 172.23.0.5:44098 [AP]
ERROR
message:Processing error
content-type:text/plain
version:1.0,1.1,1.2
content-length:16

Processing error.

###^Cexit
15 received, 0 dropped
michaelklishin commented 7 years ago

The STOMP spec is very accommodating when it comes to header values.

I don't think supporting "1" as "true" is a good idea. Producing better messages for boolean fields sounds good.