Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 83500 invoked from network); 28 Dec 2006 21:10:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Dec 2006 21:10:26 -0000 Received: (qmail 26039 invoked by uid 500); 28 Dec 2006 21:10:33 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 26019 invoked by uid 500); 28 Dec 2006 21:10:32 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 26010 invoked by uid 99); 28 Dec 2006 21:10:32 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Dec 2006 13:10:32 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Dec 2006 13:10:24 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 5C0231A981A; Thu, 28 Dec 2006 13:09:31 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r490816 - in /incubator/activemq/site: openwire.html protocols.html Date: Thu, 28 Dec 2006 21:09:31 -0000 To: activemq-commits@geronimo.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061228210931.5C0231A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: chirino Date: Thu Dec 28 13:09:30 2006 New Revision: 490816 URL: http://svn.apache.org/viewvc?view=rev&rev=490816 Log: Latest export from confluence Modified: incubator/activemq/site/openwire.html incubator/activemq/site/protocols.html Modified: incubator/activemq/site/openwire.html URL: http://svn.apache.org/viewvc/incubator/activemq/site/openwire.html?view=diff&rev=490816&r1=490815&r2=490816 ============================================================================== --- incubator/activemq/site/openwire.html (original) +++ incubator/activemq/site/openwire.html Thu Dec 28 13:09:30 2006 @@ -286,7 +286,7 @@

Overview

-

OpenWire is used to marshal objects to byte arrays and back. We will refer to the marshaled objects as commands. All data types are encoded in big-endian/network byte order.

+

OpenWire is used to marshal objects to byte arrays and back. We will refer to the marshaled objects as commands.

A TCP network connection would see multiple commands back to back on the stream. Commands are not delimited in anyway and are variable sized.

@@ -296,6 +296,20 @@ +---------+ +---------+ +---------+ +

All data primitive types used in the encoded commands are encoded in big-endian/network byte order.

+ +
+
primitive types and encoding:
+             |               |               |               |               |               |               
++----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ 
+| byte     | | | char      | | | short     | | | int       | | | long      | | | float     | | | double    | 
++----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ 
+| 1 octect | | | 2 octects | | | 2 octects | | | 4 octects | | | 8 octects | | | 4 octects | | | 8 octects | 
++----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ 
+             |               |               |               |               |               |
+
+ +

Wire Format Negotiation

OpenWire is an extensible in that it supports adding new encoding options while still being backward compatible with previous versions of the protocol. Every OpenWire protocol session initially starts with all encoding options turned off and at version 1 of command marshalers. An initial WireFormatInfo command is exchanged between the two nodes so that additional encoding features can be enabled. If both sides request an encoding feature to be enabled then it will be enabled. The command marshalers used will be the highest version that they both support.

@@ -311,13 +325,14 @@

Every command is encoded as follows:

-
[=If SizePrefixDisabled =] 
+
command encoding:
+[=If SizePrefixDisabled =] 
 [ option is not enabled. ]
-[ +---------+            ] +--------+--------------------------+
-[ | size    |            ] | type   | command-specific-content |
-[ +---------+            ] +--------+--------------------------+
-[ | 4 bytes |            ] | 1 byte | (size-1) bytes           |
-[ +---------+            ] +--------+--------------------------+
+[ +------+               ] +------+-------------------------+
+[ | size |               ] | type | command-specific-fields |
+[ +------+               ] +------+-------------------------+
+[ | int  |               ] | byte | (size-1) bytes          |
+[ +------+               ] +------+-------------------------+
 [========================]
@@ -335,7 +350,7 @@ Command type identifier - command-specific-content + command-specific-fields The data for the command. It is encoding depends on the type used @@ -351,69 +366,33 @@
  • Java primitive types
  • String
  • +
  • byte arrays
  • Throwable
  • -
  • OpenWire commands
  • +
  • Nested OpenWire commands
  • +
  • Nested OpenWire command arrays
  • +
  • Cached Nested OpenWire commands
-

Notice that OpenWire commands can use other OpenWire commands in it's fields. Care must be taken that only acyclic graphs of commands are marshaled.

+

Notice that OpenWire commands can nest other OpenWire commands in it's fields. Care must be taken that only acyclic graphs of commands are marshaled.

Loose Encoding

The fields of a command use "loose encoding" by default which encode an object field to a marshaled field of the equivalent size. Loose encoding is simple to implement does not add much CPU overhead to the marshaling/unmarshaling process.

-
Primitive Type Encoding
- -

Table of primitive types and their encoded length:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Primitive Type Marshalled length
byte 1
char 2
short 2
int 4
long 8
float 4
double 8
-
String Type Encoding
-

Strings fields may be null. If it is null then it encodes to a single "0" byte.
-If it is not null, then it encodes to:

+

Strings fields may be null. If it is null then it encodes to a single "0" byte.

-
String Encoding:
-             [=If not-null is 1=============]
-+----------+ [ +---------+----------------+ ]
-| not-null | [ | size    | encoded-string | ]
-+----------+ [ +---------+----------------+ ]
-| 1 byte   | [ | 2 bytes | size bytes     | ]
-+----------+ [ +---------+----------------+ ]
-             [==============================]
+
string encoding:
+             [=If not-null is 1===========]
++----------+ [ +-------+----------------+ ]
+| not-null | [ | size  | encoded-string | ]
++----------+ [ +-------+----------------+ ]
+| byte     | [ | short | size bytes     | ]
++----------+ [ +-------+----------------+ ]
+             [============================]
@@ -441,18 +420,18 @@
-
Throwable Encoding:
-             [=If not-null is 1=============================================================================]
-             [                               [=If StackTraceEnabled option is enabled.====================] ]
-             [                               [             [=Repeated size times========================] ] ]
-+----------+ [ +----------------+---------+  [ +---------+ [ +--------+--------+--------+-------------+ ] ] ]
-| not-null | [ | exception-name | message |  [ | size    | [ | class  | method | file   | line-number | ] ] ]
-+----------+ [ +----------------+---------+  [ +---------+ [ +--------+--------+--------+-------------+ ] ] ]
-| 1 byte   | [ | string         | string  |  [ | 2 bytes | [ | string | string | string | 4 bytes     | ] ] ]
-+----------+ [ +----------------+---------+  [ +---------+ [ +--------+--------+--------+-------------+ ] ] ]
-             [                               [             [============================================] ] ]
-             [                               [============================================================] ]
-             [==============================================================================================]
+
throwable encoding:
+             [=If not-null is 1===========================================================================]
+             [                               [=If StackTraceEnabled option is enabled.==================] ]
+             [                               [             [=Repeated size times======================] ] ]
++----------+ [ +----------------+---------+  [ +-------+ [ +--------+--------+--------+-------------+ ] ] ]
+| not-null | [ | exception-name | message |  [ | size  | [ | class  | method | file   | line-number | ] ] ]
++----------+ [ +----------------+---------+  [ +-------+ [ +--------+--------+--------+-------------+ ] ] ]
+| byte     | [ | string         | string  |  [ | short | [ | string | string | string | int         | ] ] ]
++----------+ [ +----------------+---------+  [ +-------+ [ +--------+--------+--------+-------------+ ] ] ]
+             [                               [           [============================================] ] ]
+             [                               [==========================================================] ]
+             [============================================================================================]
@@ -496,12 +475,83 @@

If the StackTraceEnabled encoding option is enabled after the exchange of WireFormatInfo packets, then every Throwable filed will have stack trace data appended to it.

+
Nested Command Type Encoding
-
Tight Encoding
+

Nested command fields may be null. If it is null then it encodes to a single "0" byte.

+
+
nested-object encoding:
+             [=If not-null is 1===================]
++----------+ [ +------+-------------------------+ ]
+| not-null | [ | type | command-specific-fields | ]
++----------+ [ +------+-------------------------+ ]
+| byte     | [ | byte | variable sized          | ]
++----------+ [ +------+-------------------------+ ]
+             [====================================]
+
+
+ + + + + + + + + + + + + + + + +
Field Description
not-null 1 if the Throwable not null, 0 if the Throwable is null
type Command type identifier
command-specific-fields The data for the command. It is encoding depends on the type used
+ +
Cached Nested Command Type Encoding
+ +

Nested Command types can be cached so that subsequent marshaling operations of the same object result in a smaller on the wire size. By default the CacheEnabled option is not enabled and therefore standard nested-object encoding is used.

-

By default

+
+
cached-object-encoding:
+[=If CacheEnabled option is enabled=====================]
+[                       [=If new-value is 1===========] ]
+[ +-----------+-------+ [ +-------------------------+ ] ]
+[ | new-value | key   | [ | command-specific-fields | ] ]
+[ +-----------+-------+ [ +-------------------------+ ] ]
+[ | byte      | short | [ | nested-object           | ] ]
+[ +-----------+-------+ [ +-------------------------+ ] ]
+[                       [=============================] ]
+[=====================================================] ]
+
+[=If CacheEnabled option is disabled =]
+[ +-------------------------+         ]
+[ | command-specific-fields |         ]
+[ +-------------------------+         ]
+[ | nested-object           |         ]
+[ +-------------------------+         ]
+[=====================================]
+
+ + + + + + + + + + + + + + + + + + +
Field Description
new-value 1 if the value is not in the cache, 0 if it already is in the cache
key Key used to identify the value in the cache
command-specific-fields The data for the command. It is encoding depends on the type used
@@ -512,7 +562,7 @@ Modified: incubator/activemq/site/protocols.html URL: http://svn.apache.org/viewvc/incubator/activemq/site/protocols.html?view=diff&rev=490816&r1=490815&r2=490816 ============================================================================== --- incubator/activemq/site/protocols.html (original) +++ incubator/activemq/site/protocols.html Thu Dec 28 13:09:30 2006 @@ -279,13 +279,13 @@ REST (ActiveMQ)
- OpenWire - (ActiveMQ) -
AMQP (ActiveMQ)
XMPP + (ActiveMQ) +
+ OpenWire (ActiveMQ)