title: How do you publish a JMS topic with Spring JMS?
body: <p>I have a component that sends messages to a queue to be handled by another system. It should also publish a topic about job statuses every once in a while. Can I just use the same JmsTemplate used to send to a queue AND to publish to a topic?</p>
  
  <p>I created a new topic in ActiveMQ, except that when I send from JmsTemplate a message, a new queue with the topic name gets created with the sent message (instead of sending the data to the actual topic), what am I doing wrong here?</p>
  
  <p>here's my config:</p>
  
  <p>
      </p>
  
  <pre><code>&lt;bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory"&gt;
      &lt;constructor-arg ref="amqConnectionFactory" /&gt;
      &lt;property name="exceptionListener" ref="jmsExceptionListener" /&gt;
      &lt;property name="sessionCacheSize" value="100" /&gt;
  &lt;/bean&gt;
  
  &lt;!--  JmsTemplate Definition --&gt;
  &lt;bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"&gt;
      &lt;constructor-arg ref="connectionFactory" /&gt;
  &lt;/bean&gt;
  
  
  &lt;bean id="messageFacade" class="org.foo.MessageFacadeJms"&gt;
      &lt;property name="jmsTemplate" ref="jmsTemplate" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>MessageFacadeJms is the class I use to send a queue message (and it works), can I also just used that to publish a topic?</p>
  
  <p>Can I just use this to do both queue sending and topic publishing?:</p>
  
  <pre><code>jmsTemplate.convertAndSend("TOPIC_NAME" /* or queue name */, message);
  </code></pre>