<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ActiveMQ on 菜鸟程序员</title><link>https://www.azhw.com.cn/%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BB%B6%E6%9C%8D%E5%8A%A1/activemq/</link><description>Recent content in ActiveMQ on 菜鸟程序员</description><generator>Hugo</generator><language>zh-cn</language><atom:link href="https://www.azhw.com.cn/%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BB%B6%E6%9C%8D%E5%8A%A1/activemq/index.xml" rel="self" type="application/rss+xml"/><item><title>服务端配置</title><link>https://www.azhw.com.cn/%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BB%B6%E6%9C%8D%E5%8A%A1/activemq/%E6%9C%8D%E5%8A%A1%E7%AB%AF%E9%85%8D%E7%BD%AE/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.azhw.com.cn/%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BB%B6%E6%9C%8D%E5%8A%A1/activemq/%E6%9C%8D%E5%8A%A1%E7%AB%AF%E9%85%8D%E7%BD%AE/</guid><description>&lt;h3 id="mapping-to-jms">Mapping to JMS&lt;a class="td-heading-self-link" href="#mapping-to-jms" aria-label="Heading self-link">&lt;/a>&lt;/h3>
&lt;p>场景：
java客户端消费使用openwire协议连接
go客户端使用amqp协议，生产消息，采用默认配置将在java消费端获取到ascii码，
是由于消息头不一致造成的
使用transport.transformer=jms，将amqp消息头和消息体的编码方式转换成jms的消息头和消息体
java的客户端就可以正确接收到消息了
&lt;a href="http://activemq.apache.org/amqp.html">http://activemq.apache.org/amqp.html&lt;/a>&lt;/p>
&lt;p>There are three basic conversion strategies that can be used with AMQP and inter-operating with the JMS API.&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Strategy&lt;/th>
 &lt;th>Description&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>&lt;code>native&lt;/code>&lt;/td>
 &lt;td>(&lt;strong>Default&lt;/strong>) Wraps the bytes of the AMQP message into a JMS &lt;code>BytesMessage&lt;/code> and maps the headers of the AMQP message to headers on the JMS message.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;code>raw&lt;/code>&lt;/td>
 &lt;td>Wraps the bytes of the AMQP message into a JMS &lt;code>BytesMessage&lt;/code>.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;code>jms&lt;/code>&lt;/td>
 &lt;td>Maps headers of the AMQP message to JMS message headers and the body of the AMQP message to the JMS body.&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>Set the &lt;strong>transformer&lt;/strong> transport option on the &lt;code>transportConnector&lt;/code> to the desired mapping strategy. For example, to inter-operate with JMS at the payload level, set the &lt;code>transformer&lt;/code> option to &lt;code>jms&lt;/code>:&lt;/p></description></item></channel></rss>