spring cloud stream content-type RabbitMq 消息傳輸類型

Source Payload Target Payload content-typeheader (source message) content-typeheader (after conversion) Comments

POJOhtml

JSON Stringjava

ignoredspring

application/jsonjson

 

Tupleapp

JSON Stringspa

ignoredcode

application/jsonhtm

JSON is tailored for Tupleci

POJOget

String (toString())

ignored

text/plain, java.lang.String

 

POJO

byte[] (java.io serialized)

ignored

application/x-java-serialized-object

 

JSON byte[] or String

POJO

application/json (or none)

application/x-java-object

 

byte[] or String

Serializable

application/x-java-serialized-object

application/x-java-object

 

JSON byte[] or String

Tuple

application/json (or none)

application/x-spring-tuple

 

byte[]

String

any

text/plain, java.lang.String

will apply any Charset specified in the content-type header

String

byte[]

any

application/octet-stream

will apply any Charset specified in the content-type header

 

參考網址:

https://docs.spring.io/spring-cloud-stream/docs/Chelsea.SR2/reference/htmlsingle/index.html#mime-types

6.2. MIME types and Java types

相關文章
相關標籤/搜索