Versions Compared

Key

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

 

Table of Contents

Qpid Broker-J supports message conversion from one protocol into another. For example, when message is published with AMQP 0-9-1 and consumed using AMQP 1.0, the Broker takes care about converting the message from AMQP 0-9-1 format into AMQP 1.0. This page provides a summary of how conversion from one protocol into another works.

...

Message properties conversion matrices

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

...

.0 message properties

AMQP 0-8...0-9-1 message

AMQP 1-.0 message

Property origin

Property name

type

Section name

Property name

Type

Comments

Implemented

message property

delivery mode

octet

header

durable

boolean

true when 'delivery mode'=2, otherwise false

Y

message property

priority

octet

header

priority

unsigned byte

 

Y

message property

expiration

short-string

header

ttl

milliseconds

expiration - 'arrival-time'; absolute-expiry-time is not used. see QPID-7872

Y

message property

content type

short-string

properties

content-type

symbol

value '"application/java-object-stream' changed to 'application/x-java-serialized-object'

Y

message property

encoding

short-string

properties

content-encoding

symbol

 

Y

message property

message id

short-string

properties

message-id

string

used to convert to binary in AMQP 1.0

Y

message property

correlation id

short-string

properties

correlation-id

string

used to convert to binary in AMQP 1.0

Y

message property

user id

short-string

properties

user-id

binary

 

Y

message property

reply to

short-string

properties

reply-to

string

if binding url the value is changed to <exchange name>/<routing key> or <exchange_name>/<queue_name> or <exchange_name> or <queue name> or <routing key> depending on whether <exchange name>, <routing key> or <queue name> is specified. Original value if not a valid BURL.

No address support.

Y

message property

timestamp

timestamp

properties

creation-time

timestamp

 

Y

message property

type

short-string

properties

subject

string

See JMS bindmap spec. setting "qpid.subject" in the message properties takes precedence over this.

Y

message property

application id

short-string

 

 

 

 

N

message property

cluster id

short-string

 

 

 

 

N

message property

headers

field-table

application-properties

* 

every entry except for 'qpid.subject' is put into application-properties as separate property.

Y

message property 'headers'

qpid.subject

short-string

properties

subject

string

This takes precedence over the message property "type".

Y

message property 'headers'

JMSXGroupID

short-string

properties

group-id

string

see JMS bindmap

Y

message property 'headers'

JMSXGroupSeq

int

properties

group-sequence

sequence number

see JMS bindmap

Y

message delivery count

 

int

header

delivery-count

uint

dynamically set on sending

Y

message delivery count

 

int

header

first-acquirer

boolean

 

N

basic.publish

routing-key

short-string

properties

to

string

"to" property should be set to <exchange>/<routing-key>

Y

basic.publish

exchange

short-string

properties

to

string

"to" property should be set to <exchange>/<routing-key>

Y
basic.publishmandatorybit    N
basic.publishimmediatebit    N
message propertycontent-typeshort-stringmessage-annotationsx-opt-jms-msg-typstring N

...

AMQP 0-8...0-9-1 message

AMQP 0-10 message

Implemented

Property origin

Property name

type

Header entry

Property name

Type

Comments

message property

delivery mode

octet

delivery-properties

delivery-mode

uint8

 

Y

message property

priority

octet

delivery-properties

priority

uint8

 

Y

message property

expiration

short-string

delivery-properties

expiration

datetime

this is currently modeled as a long

Y

message property

expiration

short-string

delivery-properties

ttl

uint64

expiration - 'arrival-time'

Y

message property

timestamp

long

delivery-properties

timestamp

datetime

this is currently modeled as a long

Y

message property

content type

short-string

message-properties

content-type

str8

 

Y

message property

encoding

short-string

message-properties

content-encoding

str8

 

Y

message property

message id

short-string

message-properties

message-id

uuid

removes 'ID:', if value cannot be converted into uuida new uuid is generated from the existing messageId

Y

message property

correlation id

short-string

message-properties

correlation-id

vbin16

 

Y

message property

user id

short-string

message-properties

user-id

vbin16

 

Y

message property

reply to

short-string

message-properties

reply-to

reply-to

 

Y

message property

application id

short-string

message-properties

app-id

vbin16

 

Y

message property

headers

field-table

message-properties

application-headers

map

 

Y

message property

type

short-string

message-properties

application-headers['x-jms-type']

str16

 

Y

message content

 

long

message-properties

content-length

uint64

 

Y

entry delivery count

 

int

delivery-properties

redelivered

bit

dynamically set on sending

 

basic.publish

routing-key

short-string

delivery-properties

routing-key

str8

 

Y

basic.publish

exchange

short-string

delivery-properties

exchange

str8

 

Y

basic.publish

immediate

bit

delivery-properties

immediate

bit

 

Y

basic.publish

mandatory

bit

delivery-properties

discard-unroutable

bit

 

Y

AMQP 0-10 message properties conversion into AMQP 1

...

.0 message properties

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

the 'ttl' delivery-property takes precedence over 'expiration'

Y

delivery-properties

expiration

datetime

header

ttl

milliseconds

the 'ttl' delivery-property takes precedence over 'expiration'; 'absolute-expiry-time' is not used. see QPID-7872

Y

delivery-properties

timestamp

datetime

properties

creation-time

timestamp

 

Y

delivery-properties

redelivered

bit

header

first-acquirer

boolean

 

N

delivery-properties

routing-key

str8

properties

to

string

 

Y

delivery-properties

exchange

str8

properties

to

string

 

Y

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

uuid

 

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

 

 

 

 

 

message-properties

application-headers

map

application-properties

* 

MessageConversionException is thrown when string or key is invalid

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

 

 Y

message properties headers

JMSXGroupSeq

int

properties

group-sequence

sequence number

 

Y
message-propertiescontent-typestr8message-annotationx-opt-jms-msg-typestring N
message-propertiesapplication-headers['x-jms-type']str16propertiessubjectstring Y

...

AMQP 0-10 message

AMQP 0-9 message

Implemented

 

Property origin

Property name

Type

Section name

Property name

Type

Comments

delivery-properties

delivery-mode

uint8

message property

delivery mode

octet

 

Y

delivery-properties

priority

uint8

message property

priority

octet

 

Y

delivery-properties

ttl

uint64

message property

expiration

short-string

the 'ttl' delivery-property takes precedence over 'expiration'

Y

delivery-propertiesexpiration

datetime

message property

expiration

short-stringthe 'ttl' delivery-property takes precedence over 'expiration'Y

delivery-properties

timestamp

datetime

message property

timestamp

long

 

Y

delivery-properties

redelivered

bit

     

delivery-properties

routing-key

str8

basic.publish

routing-key

short-string Y

delivery-properties

exchange

str8

basic.publishexchangeshort-string Y

delivery-properties

immediate

bit

basic.publish

immediate

bit

 

Y

delivery-properties

discard-unroutable

bit

basic.publish

mandatorybit Y

message-properties

content-type

str8

message property

content type

short-string

 

Y

message-properties

content-encoding

str8

message property

encoding

short-string

 

Y

message-properties

message-id

uuid

message property

message id

short-string

 

Y

message-properties

correlation-id

vbin16

message property

correlation id

short-string

 

Y

message-properties

user-id

vbin16

message property

user id

short-string

if conversion to AMQShortString fails the field is not set

Y

message-properties

reply-to

reply-to

message property

reply to

short-string

if conversion to AMQShortString fails the MessageConversionException is thrown

Y

message-properties

app-id

vbin16

message property

application-id

short-string

if conversion to AMQShortString fails the field is not set

Y

message-properties

application-headers

map

message property

headersfield-table

 

Y

message-properties

content-length

uint64

 

 

 

 

 

message-propertiesapplication-headers['x-jms-type']str16message propertytypeshort stringthrow MessageConversionException if it does not fit into short stringY

AMQP 1

...

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

AMQP 1-.0 message

AMQP 0-8...0-9-1 message

 

 

 

Implemented

 

Section name

Property name

Type

Properties

Property name

Type

Comments

header

durable

boolean

message property

delivery mode

unsigned byte

 

Y

header

priority

unsigned byte

message property

priority

unsigned byte

 

Y

header

ttl

milliseconds/uint

message property

expiration

short-string

'absolute-expiry-time' takes precedence over 'ttl'

Y

properties

absolute-expiry-time

timestamp /ulong

message property

expiration

short-string

'absolute-expiry-time' takes precedence over 'ttl'

Y

header

delivery-count

uint

 

 

 

 

 

header

first-acquirer

boolean

 

 

 

 

 

message-annotation

x-opt-jms-msg-type

byte

message property

content type

short-string

 

N

headercontent-typesymbol    TODO

properties

content-encoding

symbol

message property

encoding

short-string

MCE is thrown on content-encoding length > 255

Y

properties

message-id

binary, uuid, ulong, string

message property

message id

short-string

if conversion to AMQShortString fails the field is not set.

when converting from binary no restrictions are applied to the bytes. May contain invalid UTF-8 and/or zero-bytes.

Y

properties

correlation-id

binary, uuid, ulong, string

message property

correlation id

short-string

if conversion to AMQShortString fails the MCE is thrown.

when converting from binary no restrictions are applied to the bytes. May contain invalid UTF-8 and/or zero-bytes. 

Y

properties

user-id

binary

message property

user id

short-string

if conversion to AMQShortString fails the field is not set

Y

properties

reply-to

string

message property

reply to

short-string

if conversion to AMQShortString fails the MCE is thrown

if global address (starts with '/'), the MCE is thrown


Y

properties

creation-time

timestamp /ulong

message property

timestamp

long

if creation-time is not set arrival time will be used

Y

properties

subject

string

message property

headers['qpid.subject']

long-string

 

Y

properties

subject

string

message property

typeshort-stringMCE is thrown on subject length > 255Y
propertiessubjectstringpublish propertyrouting-keyshort-stringMCE is thrown on subject length > 255Y

properties

group-id

string

message property

headers['JMSXGroupID']

long-string

specified in JMS bindmap

Y

properties

group-sequence

sequence number

message property

headers['JMSXGroupSeq']

int

specified in JMS bindmap

Y

properties

to

string

basic.publish

exchange, routingKey

short string

if 'to' starts with "/" throw MCE
else if 'to' contains "/" split on first "/" and set exchange to first and routingKey to second part
else if 'to' refers to an existing queue set exchange to the empty string and routingKey to the queue name
else assume 'to' refers to an exchange and set it and set the routingKey to the empty string

Throw MCE if exchange or routingKey conversion to AMQShortString fails

Y

application-properties

*

*

message property

headers

field-table

If conversion fails a MCE is thrown

Y

AMQP 1

...

.0 message properties conversion into AMQP 0-10 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/properties

ttl /absolute-expiry-time

milliseconds/ulong

delivery-properties

ttl

uint64

 

Y

header/propertiesttl /absolute-expiry-timemilliseconds/ulongdelivery-propertiesexpirationdatetime Y

properties

content-type

symbol

message-properties

content-type

str8

 

TODO

properties

content-encoding

symbol

message-properties

content-encoding

str8

Throw MCE if conversion to str8 fails

Y

properties

message-id

binary, uuid, ulong, string

message-properties

message-id

uuid

When converting from string direct conversion to UUID is attempted. If that fails a type 3 UUID is created.

When converting from non-UUID a type 3 UUID is created from the source bytes.

Y

properties

correlation-id

binary, uuid, ulong, string

message-properties

correlation-id

vbin16

Throw MCE if conversion to vbin16 fails

Y

properties

user-id

binary

message-properties

user-id

vbin16

if conversion to vbin16 fails do not set this field

Y

properties

reply-to

string

message-properties

reply-to

reply-to

Throw MCE if conversion of exchange or routingKey to str8 fails

Partial

properties

creation-time

timestamp /ulong

delivery-properties

timestamp

datetime

when creation-time is not set, arrival-time is set as a timestamp

Y

properties

subject

string

message-properies

headers['qpid.subject']

str16

if 'qpid.subject' is already in the application-properties it will not be overridden

Y

propertiessubjectstringmessage-propertiesheaders['x-jms-type'] str16if 'x-jms-type' is already in the application-properties it will not be overriddenY
propertiessubjectstringdelivery-propertiesrouting-keystr8Throw MCE if conversion to str8 failsY

properties

group-id

string

message-properies

headers['JMSXGroupID']

str16

if 'JMSXGroupId' is already in the application-properties it will not be overridden

Y

properties

group-sequence

sequence number

message properies

headers['JMSXGroupSeq'] 

int

if 'JMSXGroupSeq' is already in the application-properties it will not be overridden

Y

properties

to

string

delivery-properties

exchange

str8

if 'to' starts with "/" throw MCE
else if 'to' contains "/" split on first "/" and set exchange to first and routingKey to second part
else if 'to' refers to an existing queue set exchange to the empty string and routingKey to the queue name
else assume 'to' refers to an exchange and set it and set the routingKey to the empty string

Throw MCE if exchange or routingKey conversion to str8 fails

Y

properties

to

string

delivery-properties

routing-key

str8

see above

Y

application-properties

 - map

message-properties

application-headers

map

 

Y

content

  

message-properties

content-length

uint64

 

Y

headerdelivery-count delivery-propertiesredelivered  N

AMQP 1

...

.0 message properties conversion to internal message

AMQP 1.0 messageinternal message  

Section name

Property name

Type

Property class

Property name

type

Comments

Implemented

header

durable

boolean

InternalMessage

InternalMessageMetaData

isPersistent()

isPersistent()

boolean

boolean

 

Y

Y

header

priority

unsigned byte

MessageHeader

getPriority()

byte

 

Y

header/properties

ttl /absolute-expiry-time

milliseconds/ulong

MessageHeader

getExpiration()

long

Currently 'absolute-expiry-time' is used but we should change this to 'ttl' (see QPID-7872)

Y

properties

content-type

symbol

 

 

 

 

TODO

properties

content-encoding

symbol

MessageHeader

getEncoding()

String


Y

properties

message-id

binary, uuid, ulong, string

MessageHeader

getMessageId()

String

toString() is used for the conversion

Y

properties

correlation-id

binary, uuid, ulong, string

MessageHeader

getCorrelationId()

String

toString() is used for the conversion

Y

properties

user-id

binary

MessageHeader

getUserId()

String

expects 'user-id' to contain UTF-8 bytes. results in mojibake otherwise.

Y

properties

reply-to

string

MessageHeader

getReplyTo()

String


Y

properties

creation-time

timestamp /ulong

MessageHeader

getTimestamp()

long

when creation-time is not set, arrival-time should be set as a timestamp

Partial

properties

subject

string

MessageHeader

HeaderMap['qpid.subject']

String

should this be done?

N

propertiessubjectstringInternalMessagegetInitialRoutingAddress()Stringrelated:  QPID-7868N

properties

group-id

string

 


 

 

N

properties

group-sequence

sequence number

 


 

 

N

properties

to

string

InternalMessage

getTo()

String

 

Y

application-properties

 - map

MessageHeader

HeaderMap

Map

 

Y

headerdelivery-count MessageHeaderredelivered  N

Internal message properties conversion into AMQP 1.0 message properties

Internal message

AMQP 1-.0 message

Implemented

 

Property origin

Property name

Type

Section name

Property name

Type

Comments

InternalMessage

InternalMessageMetaData

isPersistent()

isPersistent()

boolean

header

durable

unsigned byte

 

Y

MessageHeader

getPriority()

byte

header

priority

unsigned byte

 

Y

MessageHeader

getExpiration()

long

header

ttl

milliseconds

 

Y

MessageHeader

getExpiration()

long

properties

absolute-expiry-time

timestamp

 

N

MessageHeader

getMessageId()

String

properties

message-id

uuid/string/ulong

 

Y

MessageHeader

getCorrelationId()

String

properties

correlation-id

binary

 

Y

MessageHeader

getUserId()

String

properties

user-id

binary

 

Y

MessageHeader

getTimestamp()

datetime

properties

creation-time

timestamp

 

Y

MessageHeader

getReplyTo()

String

properties

reply-to

string

 

Y

InternalMessage

getTo()

String

properties

to

string

 

TODO

InternalMessage

getEncoding()

String

properties

content-encoding

symbol

 

Y

MessageHeader

getContentType()

str8

properties

content-type

symbol

 

TODO

   propertiessubjectstring N

MessageHeader

getHeader(String)/getHeaderNames()

String/Enumeration

application-properties

* 

MessageConversionException is thrown when string or key is invalid

Y

...

AMQP 0-8...0-9-1 message

Internal message

Implemented

Property origin

Property name

type

Property class

Property name

Type

Comments

message property

delivery mode

octet

InternalMessage

InternalMessageMetaData

isPeristent()

boolean

 

Y

message property

priority

octet

MessageHeader

priority

byte

 

Y

message property

expiration

short-string

MessageHeader

expiration

long

 Y

message property

timestamp

long

MessageHeader

timestamp

long

 

Y

message property

content type

short-string

MessageHeader

contentType

String

 

Y

message property

encoding

short-string

MessageHeader

encoding

String

 

Y

message property

message id

short-string

MessageHeader

messageId

String

 

Y

message property

correlation id

short-string

MessageHeader

correlationId

String

 

Y

message property

user id

short-string

MessageHeader

userId

String

 

Y

message property

reply to

short-string

MessageHeader

replyTo

String

If 'reply to' is a BURL parses it and converts it into <exchange>/<routingKey> format
otherwise copy verbatim

Y

message property

application id

short-string

MessageHeader

appId

String

 

Y

message property

headers

field-table

MessageHeader

application-headers

Map<String,Object>

 

Y

message property

type

short-string

MessageHeader

type

String

 

Y

entry delivery count

 

int

MessageHeader

redelivered

bit

dynamically set on sending

 

basic.publish

routing-key

short-string

InternalMessage

initialRoutingAddress

String

 

N

basic.publish

exchange

short-string

InternalMessage

to

String

 

Y

basic.publish

immediate

bit

MessageHeader 

immediate 

bit 

 

N

basic.publish

mandatory

bit

MessageHeader 

discard-unroutable 

bit 

 

N

Content conversion

...

Internal message properties conversion into AMQP 0-8

...

message properties

Internal message

AMQP 0-8...0-9-

...

1

...

message

Implemented

 

Property origin

Property name

Type

Section name

Property name

Type

Comments

InternalMessage

InternalMessageMetaData

isPersistent()

isPersistent()

boolean

message property

delivery mode

unsigned byte

 

Y

MessageHeader

getPriority()

byte

message property

priority

unsigned byte

 

Y

MessageHeader

getExpiration()

long

message property

expiration

short-string

 

Y

MessageHeader

getMessageId()

String

message property

message-id

short-string

if conversion to short-string fails 'message-id' is not set

Y

MessageHeader

getCorrelationId()

String

message property

correlation-id

short-string

MessageConversionException is thrown when conversion to short-string fails

Y

MessageHeader

getUserId()

String

message property

user-id

short-string

if conversion to short-string fails 'user-id' is not set

Y

MessageHeader

getTimestamp()

datetime

message property

timestamp

long

 

Y

MessageHeader

getReplyTo()

String

message property

reply-to

short-string

shoud potentially convert to BURL

MessageConversionException should be thrown when conversion to short-string fails

TODO

InternalMessage

getTo()

String

message property

to

string

 

TODO

InternalMessage

getEncoding()

String

message property

encoding

short-string

MessageConversionException is thrown when conversion to short-string fails

Y

MessageHeader

getMimeType()

str8

message property

content-type

short-string

 

TODO

MessageHeader

getContentType()

str8

message property

content-type

short-string

 

TODO

   message propertysubjectstring N

MessageHeader

getHeader(String)/getHeaderNames()

String/Enumeration

message property

headers

field-table

MessageConversionException is thrown when key or value is invalid

Y
   

basic.publish

routing-key

short-string

 TODO
   

basic.publish

exchange

short-string

 TODO
   

basic.publish

immediatebit N
   

basic.publish

mandatorybit N

Content 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 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

 

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
0-10 requires uuid type for message-id. As result, a conversion of non-0-10 message-id  which is not UUID can not be done. This should not prevent the conversion of entire message.non-0-10 --> 0-10

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 errors

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.

 

QPID-7872

Internal message properties conversion into AMQP 1.0 message properties

Internal message

AMQP 1-0 message

Implemented

 

Property origin

Property name

Type

Section name

Property name

Type

Comments

InternalMessage

InternalMessageMetaData

isPersistent()

isPersistent()

boolean

header

durable

unsigned byte

 

Y

MessageHeader

getPriority()

byte

header

priority

unsigned byte

 

Y

MessageHeader

getExpiration()

long

header

ttl

milliseconds

 

Y

MessageHeader

getExpiration()

long

properties

absolute-expiry-time

timestamp

 

N

MessageHeader

getMessageId()

String

properties

message-id

uuid/string/ulong

 

Y

MessageHeader

getCorrelationId()

String

properties

correlation-id

binary

 

Y

MessageHeader

getUserId()

String

properties

user-id

binary

 

Y

MessageHeader

getTimestamp()

datetime

properties

creation-time

timestamp

 

Y

MessageHeader

getReplyTo()

String

properties

reply-to

string

 

Y

InternalMessage

getTo()

String

properties

to

string

 

TODO

InternalMessage

getEncoding()

String

properties

content-encoding

symbol

 

Y

MessageHeader

getContentType()

str8

properties

content-type

symbol

 

TODO

   propertiessubjectstring N

MessageHeader

getHeader(String)/getHeaderNames()

String/Enumeration

application-properties

* 

MessageConversionException is thrown when string or key is invalid

Y

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 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

 

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
0-10 requires uuid type for message-id. As result, a conversion of non-0-10 message-id  which is not UUID can not be done. This should not prevent the conversion of entire message.non-0-10 --> 0-10

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 errors

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.

 

...