Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

AMQP 0-9.1 type

Used in JMS Client

AMQP 0-10 types

void

boolean

char

int8

int16

int32

int64

float

double

map

list

uuid

str16

vbin32

datetime

dec32

dec64

uint8

uint16

uint32

uint64

short-string

yes

 

 

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

long-string

yes

 

 

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

field-array

no ***

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

field-table

yes ***

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

float

yes

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

double

yes

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

void

yes

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

boolean

yes

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

byte (short-short-int)

yes

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

short (short-int)

yes

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

integer (long-int)

yes

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

long (long-long-int)

yes

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

unsigned byte(short-short-uint)

no

 

 

 

?

 

 

 

 

 

 

 

 

 

 

 

 

 

   X

 

 

 

unsigned short (short-uint)

no

 

 

 

 

?

 

 

 

 

 

 

 

 

 

 

 

 

  

    X

 

 

unsigned integer (long-uint)

no

 

 

 

 

 

?

 

 

 

 

 

 

 

 

 

 

 

 

 

   X

 

unsigned long (long-long-unit)

no

 

 

 

 

 

 

?

 

 

 

 

 

 

 

 

 

 

 

 

  

  X

timestamp

no ****

 

 

 

 

 

 

?

 

 

 

 

 

 

 

     X

 

 

 

 

 

 

decimal (decimal-value)

no *****

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  X

 

 

 

 

 

binary *

yes **

 

 

 

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

ascii string *

no

 

 

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

wide string *

no

 

 

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

ascii character *

no

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

...

****  Timestamp type is used for specifying message timestamp as part of message properties. Values of type "java.util.Date" are not allowed to be used passed into Message#setObjectProperty(String,Object)  where they are encoded as timestamps

*****  Decimal types is used to encoded javatype java.math.BigDecimal in is allowed to pass into Message#setObjectProperty(String,Object). It is encoded as decimal

AMQP 0-10 types conversion into AMQP 0-8...0-9-1

...

AMQP 1-0 type

Used in JMS Client

AMQP 0-9-1 types

short-string

long-string

timestamp

field-array

field-table

float

double

decimal

void

boolean

byte

ubyte

short

ushort

int

uint

long

ulong

binary

ascii str

wide str

ascii char

null

yes

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

boolean

yes

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

ubyte

no

 

 

 

 

 

 

 

 

 

 

 

X

?

 

 

 

 

 

 

 

 

 

ushort

no

 

 

 

 

 

 

 

 

 

 

 

 

 

X

?

 

 

 

 

 

 

 

uint

no

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

?

 

 

 

 

 

ulong

no

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

?

X

 

 

 

 

byte

yes

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

short

yes

 

 

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

int

yes

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

long

yes

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

float

yes

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

double

yes

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

decimal32

no

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

decimal64

no

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

decimal128

no

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

char

no

 

 X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

? ****

timestamp

no

 

 

 X

 

 

 

 

 

 

 

 

 

 

 

 

 

?

 

 

 

 

 

uuid ***

no

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

 

 

 

binary

yes

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

 

 

 

string

yes

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

symbol

no

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

list

no

 

 

 

X**

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

map

no

 

 

 

 

X *

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

array

no

 

 

 

 X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

* - 1.0 map allows any type in keys whilst 0-8...0-9-1 FiledTable type only allows type  supports only short-strings string as a key type. For string keys with length greater than 256, an exception is thrown on conversion.** - list in AMQP 1.0 is a sequence of polymorphic values valued FieldArray is not.

*** - UUID type is unsupported by AMQP 0-8/0-9.x. An exception is thrown on attempt to convert. Should it be converted into short string?

...

AMQP 0-10 message

AMQP 1-0 message

Implemented

 

Property origin

Property name

Type

Section name

Property name

Type

Comments

delivery-properties

delivery-mode

uint8

header

durable

unsigned byte

 

Y

delivery-properties

priority

uint8

header

priority

unsigned byte

 

Y

delivery-properties

ttl

uint64

header

ttl

milliseconds/ulong

 

Y

delivery-properties

expiration

datetime

header

absolute-expiry-time

timestamp/ulong

 

Y

delivery-properties

timestamp

datetime

properties

creation-time

timestamp/ulong

 

N

delivery-properties

redelivered

bit

header

first-acquirer

boolean

 

N

delivery-properties

routing-key

str8

properties

subject

string

 

N

delivery-properties

exchange

str8

properties

to

string

 

N

delivery-properties

immediate

bit

 

 

 

 

 

delivery-properties

discard-unroutable

bit

   

 

 

message-properties

content-type

str8

properties

content-type

symbol

"application/java-object-stream" replaced with "application/x-java-serialized-object"

Y

message-properties

content-encoding

str8

properties

content-encoding

symbol

 

Y

message-properties

message-id

uuid

properties

message-id

binary

 

Y

message-properties

correlation-id

vbin16

properties

correlation-id

binary

 

Y

message-properties

user-id

vbin16

properties

user-id

binary

 

Y

message-properties

reply-to

reply-to

properties

reply-to

string

 

Y

message-properties

app-id

vbin16

application-properties

application-id

string

 

N

message-properties

application-headers

map

application-properties

* 

 

Y

message-properties

content-length

uint64

 

 

 

 

 

message-properies headers

qpid.subject

str8

properties

subject

string

 

 Y

message properies headers

JMSXGroupID

str8

properties

group-id

string

 

 N

message properties headers

JMSXGroupSeq

int

properties

group-sequence

sequence number

 

 N

message-propertiescontent-typestr8message-annotationjms-typestring N

AMQP 0-10 message properties conversion into AMQP 0-8...0-9-1 message properties

...

AMQP 1-0 message

AMQP 0-10 message

Implemented

 

Section name

Property name

Type

Property segment

Property name

type

Comments

header

durable

boolean

delivery-properties

delivery-mode

uint8

 

Y

header

priority

unsigned byte

delivery-properties

priority

uint8

 

Y

header

ttl /absolute-expiry-time

milliseconds/ulong

delivery-properties

ttl

uint64

 

Y

properties

content-type

symbol

message-properties

content-type

str8

 

Y

properties

content-encoding

symbol

message-properties

content-encoding

str8

 

Y

properties

message-id

binary

message-properties

message-id

uuid

 

Y

properties

correlation-id

binary

message-properties

correlation-id

vbin16

 

Y

properties

user-id

binary

message-properties

user-id

vbin16

 

Y

properties

reply-to

string

message-properties

reply-to

reply-to

 

Y

properties

creation-time

timestamp /ulong

delivery-properties

timestamp

datetime

 

N

properties

subject

string

message-properies

headers['qpid.subject'] and routing-key

str8

 

N

properties

group-id

string

message-properies

headers['JMSXGroupID']

str8

 

N

properties

group-sequence

sequence number

message properies

headers['JMSXGroupSeq'

str8

 

N

properties

to

string

delivery-properties

exchange

str8

 

N

properties

to

string

delivery-properties

routing-key

str8

 

N

application-properties

 - map

message-properties

application-headers

map

 

Y

content

  

delivery-properties

content-length

 

 

Y

message-annotationjms-typestringmessage-propertiescontent-typestr8 N

Message types conversion

...

Conversion of message content from AMQP 0-8...0-9-1 into AMQP 0-10 and back is simply a matter of copying the content bytes.

Conversion of message content from AMQP 0-8...0-10 into AMQP 1-0 is based on mime-type of the message (which is set as message property 'content-type'). Depending from mime-type the message content is converted into amqp:amqp-value or amqp:data formats. The table below contains the list of mime-types and corresponding AMQP 1-0 types. * is used to indicate any other mime type which is not listed in the table.

mime type

content type

text/plain

amqp:amqp-value containing string

text/xml

amqp:amqp-value containing string

jms/stream-message

amqp:amqp-value containing list

jms/map-message

amqp:amqp-value containing map

amqp/list

amqp:amqp-value containing list

amqp/map

amqp:amqp-value containing map

*

amqp:data containing binary

Conversion of message content from AMQP 1-0 to AQMQP 0-x is based on the AMQP type used in AMQP 1-0 message

AMQP type

java type

Target protocol

Target mime-type

Comment

string

String

0-8...0-10

text/plain

 

list of primitive types (double,float,string,byte[],boolean,byte,short,int,long, char)

java.util.List

0-8...0-10

jms/stream-message

 

map with primitive value types (double,float,string,byte[],boolean,byte,short,int,long, char)

java.util.Map

0-8...0-10

jms/map-message

Should null be included into the allowed types?

list

java.util.List

0-10

amqp/list

 

map

java.util.Map

0-10

amqp/map

 

binary

java.lang.Serializable

0-8...0-10

application/java-object-stream

 

binary

byte[]

0-8...0-10

application/octet-stream

 

At the moment the conversion into AMQP 1-0 might end-up in unexpected message types, for example, stream message can be received as object message and map message can be received as object message. It seems the same applies to conversion from AMQP 1-0 into AMQP 0-x

Conversion issues

This section summarises existing conversion issues

Issue description

Protocols

Missing Type conversion (decimal, uuid (0-10 --> 0-8...0-9-1))

All

Inaccurate Type conversion (unsigned types are converted into types (all), timestamps are converted into long (all), utf chars are converted into ascii chars, binary types are converted into signed (0-10))

All

Unsupported property key or value (uuid is unsupported in 0-8...0-9-1, decimal is unsupported in 0-10, etc)

All

Missing conversion of message propertiesAll

Conversion of application properties from AMQP 1-0 into AMQP 0-x headers (0-8...0-9-1 FieldTable and 0-10 map) when application properties length exceeds 255 character ( or contains non-ascii characters or start with illegal characters)

1-0 --> 0-x

Conversion of AMQP 0.x headers (represented as 0-8...0-9-1 FieldTable or 0-10 map) into AMQP 1-0  application properties when headers values are not primitives (for example, maps, collections, etc)

0-x --> 1-0

Conversion of Map content from AMQP 1-0 into AMQP 0-x Map Message when keys are not strings1-0 --> 0-x
JMS message type is changed when converted from AMQP 0.x into AMQP 1.0 (jms-type annotation is not set)0-x --> 1-0
JMS message type is changed when converted from AMQP 1-0 into AMQP 0.x (jms-type annotation is not respected)1-0 --> 0-x

Handling of conversion error

The converter modules should employ the following strategies when message cannot be converted into target protocol format (for example, due to unsupported types, values, etc)

  • log conversion failure and close connection with appropriate error
  • log conversion failure and move message into DLQ or delete the message if no DLQ is configured
  • log conversion failure and skip the message (similar as if the client rejected the message)

The approaches above can be configured on broker or virtual host using context variables.
Closing the connections should be a default behaviour.

 

TODO

 

.