title: How to set MDB programmatic and dynamically
body: <p>I am using Spring3.1 on standalone env.</p>
  
  <p>I set topic with jms templates this way:</p>
  
  <pre><code>&lt;bean id="mm1sessionsTopicSendingTemplate" class="org.springframework.jndi.JndiObjectFactoryBean"
      depends-on="jmsServerManagerImpl"&gt;
      &lt;property name="jndiName"&gt;
          &lt;value&gt;/topic/mm1sessionsTopic&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>For this topic I set MDB with DefaultMessageListenerContainer this way:</p>
  
  <pre><code>&lt;bean id="mm1sessionDispatcherListener"
          class="org.springframework.jms.listener.DefaultMessageListenerContainer"&gt;
          &lt;property name="connectionFactory" ref="connectionFactory" /&gt;
          &lt;property name="pubSubDomain" value="true" /&gt;
          &lt;property name="concurrentConsumers" value="1" /&gt;
          &lt;property name="destination" ref="mm1sessionsTopicSendingTemplate" /&gt;
          &lt;property name="messageListener" ref="mm1SessionMDB" /&gt;
          &lt;property name="sessionAcknowledgeModeName" value="AUTO_ACKNOWLEDGE" /&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>In this way I must set mm1SessionMDB in advanced via xml: </p>
  
  <pre><code>&lt;bean id="mm1SessionMDB" class="com.mdb.SessionMDB"&gt;
          &lt;property name="feedPropertiesDTO" ref="feedListenerMarketMaker1Properties" /&gt;
  
      &lt;/bean&gt;
  </code></pre>
  
  <p>But I need my application to create the MDB instances <strong>programmaticly</strong>. </p>
  
  <p>I mean i want to create the mdb's via the code since each MDB will have different validation values for the messages that it will retrieve from the topic(via the feedPropertiesDTO)  </p>
  
  <p>basically I will have pool of MDB's with the same logic but each one will have different properties. the creation time of the MDB'S must be on runtime.</p>
  
  <p>is that possible?</p>
  
  <p>thanks,
  ray. </p>