title: Why JMS listener works without implementing a MessageListener
body: <p>I have following Message consumer </p>
  
  <pre><code>@Service
  public class BlockServiceConsumer {
  
  public void blockService(PhoneServiceVO phoneServiceVO) throws Exception {
  
      // message processing
  
  }
  </code></pre>
  
  <p>and following spring configuration with <code>jms:listener-container</code> <code>connectionFactory</code> and <code>queue</code> definition</p>
  
  <pre><code>&lt;context:component-scan base-package="com.stealthgenie.scheduler" /&gt;
  &lt;context:annotation-config/&gt;
  
  &lt;bean id="blockServiceQueue" class="org.apache.activemq.command.ActiveMQQueue"&gt;
      &lt;constructor-arg value="BLOCK_SERVICE.QUEUE"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
      &lt;property name="brokerURL"&gt;
          &lt;value&gt;tcp://localhost:61616&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;jms:listener-container acknowledge="auto"  connection-factory="connectionFactory" destination-type="queue" concurrency="10-20"&gt;
      &lt;jms:listener destination="BLOCK_SERVICE.QUEUE" ref="blockServiceConsumer" method="blockService" /&gt;
  &lt;/jms:listener-container&gt;
  </code></pre>
  
  <p>My question: <strong>why does this setup works fine without implementing <code>MessageListener</code></strong> although documentation mentions that it is required. NOTE I have also not used <code>MessageListenerAdapter</code></p>
  
  <blockquote>
    <p>In a fashion similar to a Message-Driven Bean (MDB) in the EJB world, the Message-Driven POJO (MDP) acts as a receiver for JMS messages. The one restriction (but see also below for the discussion of the MessageListenerAdapter class) on an MDP is that it must implement the javax.jms.MessageListener interface. Please also be aware that in the case where your POJO will be receiving messages on multiple threads, it is important to ensure that your implementation is thread-safe.</p>
  </blockquote>