vert-x3 / vertx-amqp-client

An AMQP client for Vert.x
Apache License 2.0
17 stars 18 forks source link

Content-Encoding gets set to the wrong value #29

Closed UglyHobbitFeet closed 4 years ago

UglyHobbitFeet commented 4 years ago

The Content-Encoding seems to get overwritten by vertx. amqp internally and set to the same value of Content-Type.

AmqpMessage msg = AmqpMessage.create()
                .contentEncoding("UTF-8")
                .contentType("application/json").build();
System.out.println("ContentEncoding:"+msg.contentEncoding());
System.out.println("ContentType:"+msg.contentType());

I'm using Vert.x 3.8.5

gemmellr commented 4 years ago

I just noticed this myself when diffing branches to check over some test improvement backports.

I'd first note that UTF-8 isnt actually a content encoding (for detail see http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-properties and related links), so you probably want to forego using the content encoding field anyway. However, still a bug though, so...

The issue was actually resolved on master some time ago in 88a32526aaee9a7d0d8f212df73644b370b9db44 but not backported. I've picked the fix into the 3.9 branch in fc5e7ea685f7fedc6fe31fe6b165b40c0f5b7c28. (Added test in 17ae036a04382ad386021cc6cb93f3eb1d1c7eb7 and 019db59bebd9671c44894e9b6f49a2b887f29d4c ).