activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiram Chirino (JIRA)" <>
Subject [jira] Resolved: (AMQ-681) Tight encoding not the default; wire format negotiation needs work
Date Mon, 22 May 2006 14:55:51 GMT
     [ ]
Hiram Chirino resolved AMQ-681:

    Resolution: Won't Fix

There is no historical tight encoding since 4.0 is the first release where openwire gets used.
 The wire negocation rule is, always start with loose encoding and version 1 of the protocol
with all extra options off.

Loose encoding is much simpler to implement than the tight encoding.  That is way it was choosen
to be the default.  With all the options off + loose encoding, it makes it much simpler to
implement a simple openwire client.  The initial WireFormatInfo then allows the client to
switch on any number of options incuding the tightEncoding.

> Tight encoding not the default; wire format negotiation needs work
> ------------------------------------------------------------------
>          Key: AMQ-681
>          URL:
>      Project: ActiveMQ
>         Type: Bug

>   Components: Broker
>     Reporter: Andrew Lusk
>     Assignee: Hiram Chirino

> In, tightEncoding defaults to false, when, since it's the historical
format, it should be true.
> Wire format negotiation isn't really negotiation.  Since the broker defaults to loose
encoding, it sends a loosely-encoded WireFormatInfo message to connecting clients, and expects
loosely-encoded WireFormatInfo messages from them.  This not only enforces that clients implement
loose marshalling and unmarshalling, but fails when the client sends a well-formatted but
tightly-encoded WireFormatInfo message.
> The broker fails in this case because it assumes that the client and broker both have
the same concept of what encoding is the default, when in actuality the encoding of a message
should be part of the actual message, allowing the broker to handle clients who prefer either
format (and may not have the other format even implemented).
> The broker should also only ever send messages in the format asked for by the client
- it should wait to send a WireFormatInfo until it has received one from the client indicating
its preferred format.
> I suggest two changes:
>   * adding a leading byte to all messages indicating their encoding
>   * the broker should wait to send a WireFormatInfo until it has received one from the
connecting client, whose preferences override all broker defaults for that connection
> The requirement that the server and client have shared, non-obvious information from
the beginning (like which encoding is default) causes ugly problem in the broker like this,
when it gets a message of a type it didn't expect:
> Exception in thread "tcp:///" java.lang.IllegalArgumentException: Invalid
version: 1297154048, could not load org.apache.activemq.openwire.v1297154048.MarshallerFactory

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message