【问题标题】:Problem with text message encoding when sending to ActiveMQ with JmsTemplate使用 JmsTemplate 发送到 ActiveMQ 时出现文本消息编码问题
【发布时间】:2019-04-02 05:16:04
【问题描述】:

当我向 ActiveMQ 发送包含俄语字符的文本消息时,我得到了 abracadabra。我使用 org.springframework.jms.core.JmsTemplate、jmsTemplate.convertAndSend。如何指定 UTF-8 编码。是 JmsTemplate bean 的 roperties 有问题,还是 ActiveMq 有问题?

【问题讨论】:

  • “我会胡言乱语”。大声笑

标签: java spring encoding activemq jmstemplate


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2015-02-19
    • 2012-09-03
    • 2017-10-18
    • 2018-09-09
    • 1970-01-01
    • 1970-01-01
    • 2021-10-21
    • 2015-12-08
    • 2021-10-20
    相关资源
    最近更新 更多