You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Marcel Casado (JIRA)" <ji...@apache.org> on 2011/07/03 08:42:21 UTC

[jira] [Created] (AMQ-3387) Backards imcompatibilitiy with version 5.3 and previous with the http protocol due chage on charset encoding

Backards imcompatibilitiy with version 5.3 and previous with the http protocol due chage on charset encoding
------------------------------------------------------------------------------------------------------------

                 Key: AMQ-3387
                 URL: https://issues.apache.org/jira/browse/AMQ-3387
             Project: ActiveMQ
          Issue Type: Bug
          Components: Transport
    Affects Versions: 5.5.0, 5.4.2, 5.4.0
            Reporter: Marcel Casado


Changes in charset encoding from java modified UTF-8 to standard UTF-8 in class org.apache.activemq.transport.util.TextWireFormat makes clients and broker using different versions not compatible when using http transport protocol. Like a client 5.3 and broker 5.5 can not interchange messages in http transport protocol or the other way around. Backards compatibility support could be easily provided with :

   public Object unmarshal(DataInput in) throws IOException {

    	String value;
    	try {
    		int length = in.readInt();
    		byte[] utf8 = new byte[length];
    		in.readFully(utf8);
    		value = new String(utf8, "UTF-8");
    		return unmarshalText(value);
    	} catch(Exception ex) {
    		DataByteArrayInputStream dbais = (DataByteArrayInputStream) in;
    		dbais.restart(0);
    		value = dbais.readUTF();
    		return unmarshalText(value); 
    	}    
    }


    and in HttpClientTransport calling unmarshal with a DataByteArrayInputStream:

    DataByteArrayInputStream stream = new DataByteArrayInputStream(httpMethod.getResponseBody());
    Object command = (Object)getTextWireFormat().unmarshal(stream);


    With this changes was able to connect legacy clients 5.3 to new 5.5 brokers.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AMQ-3387) Backards imcompatibilitiy with version 5.3 and previous with the http protocol due chage on charset encoding

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish updated AMQ-3387:
------------------------------

    Description: 
Changes in charset encoding from java modified UTF-8 to standard UTF-8 in class org.apache.activemq.transport.util.TextWireFormat makes clients and broker using different versions not compatible when using http transport protocol. Like a client 5.3 and broker 5.5 can not interchange messages in http transport protocol or the other way around. Backards compatibility support could be easily provided with :

{code}

   public Object unmarshal(DataInput in) throws IOException {

    	String value;
    	try {
    		int length = in.readInt();
    		byte[] utf8 = new byte[length];
    		in.readFully(utf8);
    		value = new String(utf8, "UTF-8");
    		return unmarshalText(value);
    	} catch(Exception ex) {
    		DataByteArrayInputStream dbais = (DataByteArrayInputStream) in;
    		dbais.restart(0);
    		value = dbais.readUTF();
    		return unmarshalText(value); 
    	}    
    }


    and in HttpClientTransport calling unmarshal with a DataByteArrayInputStream:

    DataByteArrayInputStream stream = new DataByteArrayInputStream(httpMethod.getResponseBody());
    Object command = (Object)getTextWireFormat().unmarshal(stream);

{code}

    With this changes was able to connect legacy clients 5.3 to new 5.5 brokers.


  was:
Changes in charset encoding from java modified UTF-8 to standard UTF-8 in class org.apache.activemq.transport.util.TextWireFormat makes clients and broker using different versions not compatible when using http transport protocol. Like a client 5.3 and broker 5.5 can not interchange messages in http transport protocol or the other way around. Backards compatibility support could be easily provided with :

   public Object unmarshal(DataInput in) throws IOException {

    	String value;
    	try {
    		int length = in.readInt();
    		byte[] utf8 = new byte[length];
    		in.readFully(utf8);
    		value = new String(utf8, "UTF-8");
    		return unmarshalText(value);
    	} catch(Exception ex) {
    		DataByteArrayInputStream dbais = (DataByteArrayInputStream) in;
    		dbais.restart(0);
    		value = dbais.readUTF();
    		return unmarshalText(value); 
    	}    
    }


    and in HttpClientTransport calling unmarshal with a DataByteArrayInputStream:

    DataByteArrayInputStream stream = new DataByteArrayInputStream(httpMethod.getResponseBody());
    Object command = (Object)getTextWireFormat().unmarshal(stream);


    With this changes was able to connect legacy clients 5.3 to new 5.5 brokers.



> Backards imcompatibilitiy with version 5.3 and previous with the http protocol due chage on charset encoding
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3387
>                 URL: https://issues.apache.org/jira/browse/AMQ-3387
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Transport
>    Affects Versions: 5.4.0, 5.4.2, 5.5.0
>            Reporter: Marcel Casado
>         Attachments: HttpClientTransport.java, TextWireFormat.java
>
>
> Changes in charset encoding from java modified UTF-8 to standard UTF-8 in class org.apache.activemq.transport.util.TextWireFormat makes clients and broker using different versions not compatible when using http transport protocol. Like a client 5.3 and broker 5.5 can not interchange messages in http transport protocol or the other way around. Backards compatibility support could be easily provided with :
> {code}
>    public Object unmarshal(DataInput in) throws IOException {
>     	String value;
>     	try {
>     		int length = in.readInt();
>     		byte[] utf8 = new byte[length];
>     		in.readFully(utf8);
>     		value = new String(utf8, "UTF-8");
>     		return unmarshalText(value);
>     	} catch(Exception ex) {
>     		DataByteArrayInputStream dbais = (DataByteArrayInputStream) in;
>     		dbais.restart(0);
>     		value = dbais.readUTF();
>     		return unmarshalText(value); 
>     	}    
>     }
>     and in HttpClientTransport calling unmarshal with a DataByteArrayInputStream:
>     DataByteArrayInputStream stream = new DataByteArrayInputStream(httpMethod.getResponseBody());
>     Object command = (Object)getTextWireFormat().unmarshal(stream);
> {code}
>     With this changes was able to connect legacy clients 5.3 to new 5.5 brokers.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AMQ-3387) Backards imcompatibilitiy with version 5.3 and previous with the http protocol due chage on charset encoding

Posted by "Marcel Casado (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Casado updated AMQ-3387:
-------------------------------

    Attachment: HttpClientTransport.java
                TextWireFormat.java

Modified classes

> Backards imcompatibilitiy with version 5.3 and previous with the http protocol due chage on charset encoding
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3387
>                 URL: https://issues.apache.org/jira/browse/AMQ-3387
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Transport
>    Affects Versions: 5.4.0, 5.4.2, 5.5.0
>            Reporter: Marcel Casado
>         Attachments: HttpClientTransport.java, TextWireFormat.java
>
>
> Changes in charset encoding from java modified UTF-8 to standard UTF-8 in class org.apache.activemq.transport.util.TextWireFormat makes clients and broker using different versions not compatible when using http transport protocol. Like a client 5.3 and broker 5.5 can not interchange messages in http transport protocol or the other way around. Backards compatibility support could be easily provided with :
>    public Object unmarshal(DataInput in) throws IOException {
>     	String value;
>     	try {
>     		int length = in.readInt();
>     		byte[] utf8 = new byte[length];
>     		in.readFully(utf8);
>     		value = new String(utf8, "UTF-8");
>     		return unmarshalText(value);
>     	} catch(Exception ex) {
>     		DataByteArrayInputStream dbais = (DataByteArrayInputStream) in;
>     		dbais.restart(0);
>     		value = dbais.readUTF();
>     		return unmarshalText(value); 
>     	}    
>     }
>     and in HttpClientTransport calling unmarshal with a DataByteArrayInputStream:
>     DataByteArrayInputStream stream = new DataByteArrayInputStream(httpMethod.getResponseBody());
>     Object command = (Object)getTextWireFormat().unmarshal(stream);
>     With this changes was able to connect legacy clients 5.3 to new 5.5 brokers.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (AMQ-3387) Backards imcompatibilitiy with version 5.3 and previous with the http protocol due chage on charset encoding

Posted by "Timothy Bish (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish closed AMQ-3387.
-----------------------------

    Resolution: Incomplete

Provided patches lack Apache License grants.
                
> Backards imcompatibilitiy with version 5.3 and previous with the http protocol due chage on charset encoding
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3387
>                 URL: https://issues.apache.org/jira/browse/AMQ-3387
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Transport
>    Affects Versions: 5.4.0, 5.4.2, 5.5.0
>            Reporter: Marcel Casado
>         Attachments: HttpClientTransport.java, TextWireFormat.java
>
>
> Changes in charset encoding from java modified UTF-8 to standard UTF-8 in class org.apache.activemq.transport.util.TextWireFormat makes clients and broker using different versions not compatible when using http transport protocol. Like a client 5.3 and broker 5.5 can not interchange messages in http transport protocol or the other way around. Backards compatibility support could be easily provided with :
> {code}
>    public Object unmarshal(DataInput in) throws IOException {
>     	String value;
>     	try {
>     		int length = in.readInt();
>     		byte[] utf8 = new byte[length];
>     		in.readFully(utf8);
>     		value = new String(utf8, "UTF-8");
>     		return unmarshalText(value);
>     	} catch(Exception ex) {
>     		DataByteArrayInputStream dbais = (DataByteArrayInputStream) in;
>     		dbais.restart(0);
>     		value = dbais.readUTF();
>     		return unmarshalText(value); 
>     	}    
>     }
>     and in HttpClientTransport calling unmarshal with a DataByteArrayInputStream:
>     DataByteArrayInputStream stream = new DataByteArrayInputStream(httpMethod.getResponseBody());
>     Object command = (Object)getTextWireFormat().unmarshal(stream);
> {code}
>     With this changes was able to connect legacy clients 5.3 to new 5.5 brokers.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3387) Backards imcompatibilitiy with version 5.3 and previous with the http protocol due chage on charset encoding

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059211#comment-13059211 ] 

Timothy Bish commented on AMQ-3387:
-----------------------------------

How about working up a patch file and attaching it with grants to apache?

> Backards imcompatibilitiy with version 5.3 and previous with the http protocol due chage on charset encoding
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3387
>                 URL: https://issues.apache.org/jira/browse/AMQ-3387
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Transport
>    Affects Versions: 5.4.0, 5.4.2, 5.5.0
>            Reporter: Marcel Casado
>         Attachments: HttpClientTransport.java, TextWireFormat.java
>
>
> Changes in charset encoding from java modified UTF-8 to standard UTF-8 in class org.apache.activemq.transport.util.TextWireFormat makes clients and broker using different versions not compatible when using http transport protocol. Like a client 5.3 and broker 5.5 can not interchange messages in http transport protocol or the other way around. Backards compatibility support could be easily provided with :
>    public Object unmarshal(DataInput in) throws IOException {
>     	String value;
>     	try {
>     		int length = in.readInt();
>     		byte[] utf8 = new byte[length];
>     		in.readFully(utf8);
>     		value = new String(utf8, "UTF-8");
>     		return unmarshalText(value);
>     	} catch(Exception ex) {
>     		DataByteArrayInputStream dbais = (DataByteArrayInputStream) in;
>     		dbais.restart(0);
>     		value = dbais.readUTF();
>     		return unmarshalText(value); 
>     	}    
>     }
>     and in HttpClientTransport calling unmarshal with a DataByteArrayInputStream:
>     DataByteArrayInputStream stream = new DataByteArrayInputStream(httpMethod.getResponseBody());
>     Object command = (Object)getTextWireFormat().unmarshal(stream);
>     With this changes was able to connect legacy clients 5.3 to new 5.5 brokers.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira