...
AMQP type | java type | Target mime-type | Comment |
---|---|---|---|
string | String | text/plain | |
list of primitive types (double,float,string,byte[],boolean,byte,short,int,long, char) | java.util.List | jms/stream-message | |
map with primitive value types (double,float,string,byte[],boolean,byte,short,int,long, char) | java.util.Map | jms/map-message | Should null be included into the allowed types? |
list | java.util.List | amqp/list | |
map | java.util.Map | amqp/map | |
binary | java.lang.Serializable | application/java-object-stream | |
binary | byte[] | application/octet-stream |
AMQP 1.0 to AMQP 0-8..0-9-1
Conversion follows this algorithm:
- A converter is determined from...
- if message has a body...
- data
- ...else from typeHint which is taken from...
- from the message annotation "x-opt-jms-msg-type"
- from the message property "content-type"
- ...if no typeHint is found and message has no body then "text/plain" is used
- ...else throw MessageConversionException
- if message has a body...
- Mime type of the converted message is set from the converter unless
- typeHint is "application/java-object-stream" or "application/x-java-serialized-object" in which case it is set to "application/java-object-stream"
- typeHint is a known text mime type (see JMS bindmap) in which case it is set to "text/plain"
AMQP 1.0 | AMQP 0-8 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
content-type | x-opt-jms-msg-type | body type | content-type | body | Comments | Implemented | ||||||
- | - | - | text/plain | - | ||||||||
- | - | data | application/octet-stream | content of data value | ||||||||
* | BYTE_MESSAGE | data | application/octet-stream | - | ||||||||
* | BYTE_MESSAGE | - | application/octet-stream | - | ||||||||
application/x-java-serialized-object | - | data | application/java-object-stream | content of data value | ||||||||
application/x-java-serialized-object | - | - | application/java-object-stream | - | ||||||||
* | OBJECT_MESSAGE | data | application/java-object-stream | content of data value | ||||||||
* | OBJECT_MESSAGE | - | application/java-object-stream | - | ||||||||
- | - | amqp-sequence (if simple type is used )jms/stream-message | list with amqp-sequence values | - | STREAM_MESSAGE | amqp-sequence (if simple type is used ) | jms/stream-message | list with amqp-sequence values | ||||
- | STREAM_MESSAGE | - | jms/stream-message | empty list | ||||||||
- | -/ 4STREAM_MESSAGE | amqp-sequence (if non simple type is use) | throw MessageConversionException | |||||||||
- | - | amqp-value with value of map with string keys (of length <255) and simple type values (string, boolean, long, integer, short, byte, float, double, byte[]) | amqp/map | 0-10 encoded map | ||||||||
- | amqp-value with value of map with either non string keys or non simple values, or string key with length > 255 | throw MessageConversionException | ||||||||||
- | MAP_MESSAGE | - | amqp/map | empty 0-10 encoded map | ||||||||
MAP_MESSAGE | amqp-value with value of map with either non string keys or non simple values, or string key with length > 255 | throw MessageConversionException | ||||||||||
- | TEXT_MESSAGE | - | text/plain | - | ||||||||
text/plain | - | - | text/plain | - | ||||||||
- | - | amqp vallue value with string or null | text/plain | string value | ||||||||
* | TEXT_MESSAGE | amqp vallue value with string or null | text/plain | string value | ||||||||
text/* | - | data | text/* | data bytes as string | ||||||||
application/xml | - | data | application/xml | data bytes as string | ||||||||
application/*+xml | - | data | application/*+xml | data bytes as string | ||||||||
application/xml-dtd | - | data | application/xml-dtd | data bytes as string | ||||||||
application/json | - | data | application/json | data bytes as string | ||||||||
application/*+json | - | data | application/*+json | data bytes as string | ||||||||
application/javascript | - | data | application/javascript | data bytes as string | ||||||||
application/ecmascript | - | data | application/ecmascript | data bytes as string | ||||||||
* | * | * | throw MessageConversionException |
...