使用JmsTemplate发送到ActiveMQ时出现文本消息编码问题

问题描述 投票:1回答:1

当我向ActiveMQ发送包含俄语字符的短信时,我得到了abracadabra。我使用org.springframework.jms.core.JmsTemplate,jmsTemplate.convertAndSend。如何指定UTF-8编码。是JmsTemplate bean的rpoperties中的问题,还是在ActiveMq中?

java spring encoding activemq jmstemplate
1个回答
0
投票

转换为TextMessage并使用jmsTemplate.send解决问题(destination,s - > s.createTextMessage(textMsg));

© www.soinside.com 2019 - 2024. All rights reserved.