Text is encoded in utf-8, your call to getText() below is the unmarshaled state as the original message is copied on send. see the source here: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java?revision=1074725&view=markup
If you need utf-16, you will need to use a bytes message. On 7 March 2011 16:46, RuralHunter <ruralhun...@gmail.com> wrote: > Hi, I'm using Activemq 5.4.2 on Ubuntu server. > I put text message with java by these codes: > TextMessage message = session.createTextMessage(myText); > producer.send(message); > myLogger.finest("Sent message:"); > myLogger.finest(message.getText()); > > "myText" contains some Chinese characters. and I can see characters are > correct in the log output above. But when I get the message from either > another java program or by the web admin console, I can see the Chinese > characters become "????". I guess some character encoding transformation > happened when the messages put into the queue. What should I do to make the > Chinese characters correct in the queue? Is there a charset/encoding > parameter I can set for the broker or queue or maybe the JVM? > > btw, I used to use 5.4.x(some old version) before on windows and didn't see > this problem. > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Character-encoding-problem-of-the-messages-in-queue-tp3339428p3339428.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > -- http://blog.garytully.com http://fusesource.com