Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Incomplete
-
5.4.0, 5.4.2, 5.5.0
-
None
-
None
-
Regression
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 :
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.
Attachments
Attachments
Issue Links
- is related to
-
AMQ-3388 Http/https protocol uses Xstream for serializing commands in xml. Field additions to the commands bresks xtream serializacion between amq versions
- Resolved