Versions Compared

Key

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

...

AMQP 1.0 to AMQP 0-8..0-9-1

Conversion follows this algorithm:

...

 

AMQP 1.0 MessageAMQP 0-8 Message
body sectionbody data typeannotation

...

  1. data

...

x-opt-jms-msg-type

...

...

content-type

...

  1. typeHint is "application/java-object-stream" or "application/x-java-serialized-object" in which case it is set to "application/java-object-stream"
  2. typeHint is a known text mime type (see JMS bindmap) in which case it is set to "text/plain"
content typecomments
amqp-valuenullanyanytext/plain 
 stringanyanytext/plain 
 mapanyanyjms/map-message or amqp/map (0-10)if keys' length<255 and values of simple types (string, boolean, double, float, binary(byte[]), null, byte, short, integer, long ), the  "jms/map-message " format is used. If keys' length<255 but non simple type value is used, than "amqp/map" format is used. Otherwise, MessageConversionException is thrown
 listanyany
AMQP 1.0AMQP 0-8
content-typex-opt-jms-msg-typebody typecontent-typebodyCommentsImplemented
---text/plain-  
--dataapplication/octet-streamcontent of data value  
*BYTE_MESSAGEdataapplication/octet-stream-  
*BYTE_MESSAGE-application/octet-stream-  
application/x-java-serialized-object-dataapplication/java-object-streamcontent of data value  
application/x-java-serialized-object--application/java-object-stream-  
*OBJECT_MESSAGEdataapplication/java-object-streamcontent of data value  
*OBJECT_MESSAGE-application/java-object-stream-  
--/STREAM_MESSAGEamqp-sequence (if simple type is used )jms/stream-messagelist with amqp-sequence values  
-STREAM_MESSAGE-jms/stream-messageempty list  
-

-/STREAM_MESSAGE

amqp-sequence (if non simple type is use)  throw MessageConversionException 
if list items of simple types(string, boolean, double, float, byte[] (Binary), null, byte, short, integer, long ), otherwise MessageConversionException is thrown
 otheranyany MessageConversionException is thrown
amqp-sequencesee commentsanyanyjms/stream-messageif amqp-sequence section values of simple types(string, boolean, double, float, byte[] (Binary), null, byte, short, integer, long ), otherwise MessageConversionException is thrown
databinary (bytes[])0 (Message)anytext/plainwithout a body
  1 (ObjectMessage)anyapplication/java-object-stream--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/map0-10 encoded map 
  2 (MapMessage)-anyamqp-value with value of map with either non string keys or non simple values, or string key with length > 255application/octet-stream 
 throw MessageConversionException -MAP_MESSAGE-amqp/map3 (BytesMessage)anyapplication/octet-streamempty 0-10 encoded map 
  MAP_MESSAGE4 (StreamMessage)anyapplication/octet-streamamqp-value with value of map with either non string keys or non simple values, or string key with length > 255 
 throw MessageConversionException -TEXT_MESSAGE5 (TextMessage)any-text/plain- 
  text/plainother-any-text/plain MessageConversionException-
  --amqp value with string or null

content types listed in section 3.3.7 (Body Sections) of AMQP JMS Mapping specification (WD9)

text/plainstring value 
  *-TEXT_MESSAGEamqp value with string or nulltext/plainstring value  otherapplication/octet-stream 
no bodyN/A0 (Message)anytext/plain text/*-datatext/*data bytes as string
  application/xml-1 (ObjectMessage)anydataapplication/xmljava-object-stream data bytes as string
  application/*+xml-dataapplication/*+xml2 (MapMessage)anyjms/map-messagedata bytes as string 
 application/xml-dtd- 3 (BytesMessage)anydataapplication/xmloctet-dtdstream data bytes as string
  application/json-dataapplication/json4 (StreamMessage)anyjms/stream-message data bytes as string
  application/*+json-dataapplication/*+json5 (TextMessage)anytext/plain data bytes as string
  application/javascriptother-anydata application/javascriptdata bytes as stringMessageConversionException
  application/ecmascript-dataapplication/ecmascript-content types listed in section 3.3.7 (Body Sections) of AMQP JMS Mapping specification (WD9)text/plain data bytes as string
  *-**  -application/octet-streamthrow MessageConversionException 

 

 

 

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

...