Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 71970 invoked from network); 8 Apr 2006 00:05:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Apr 2006 00:05:13 -0000 Received: (qmail 48689 invoked by uid 500); 8 Apr 2006 00:05:12 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 48662 invoked by uid 500); 8 Apr 2006 00:05:12 -0000 Mailing-List: contact activemq-dev-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-dev@geronimo.apache.org Received: (qmail 48650 invoked by uid 99); 8 Apr 2006 00:05:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Apr 2006 17:05:12 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Apr 2006 17:05:11 -0700 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 9C5C6D4A00 for ; Sat, 8 Apr 2006 01:04:50 +0100 (BST) Message-ID: <21530856.1144454690637.JavaMail.jira@ajax> Date: Sat, 8 Apr 2006 01:04:50 +0100 (BST) From: "Andrew Lusk (JIRA)" To: activemq-dev@geronimo.apache.org Subject: [jira] Commented: (AMQ-681) Tight encoding not the default; wire format negotiation needs work In-Reply-To: <2033205371.1144370091796.JavaMail.jira@ajax> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ https://issues.apache.org/activemq/browse/AMQ-681?page=comments#action_36013 ] Andrew Lusk commented on AMQ-681: --------------------------------- Also, it would be nice to be able to configure separate encoding defaults for each channel, for example, to allow clients to send messages loosely encoded but receive messages tightly encoded. > Tight encoding not the default; wire format negotiation needs work > ------------------------------------------------------------------ > > Key: AMQ-681 > URL: https://issues.apache.org/activemq/browse/AMQ-681 > Project: ActiveMQ > Type: Bug > Components: Broker > Reporter: Andrew Lusk > > > In OpenWireFormat.java, 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:///127.0.0.1:54316" 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: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira