title: Spring jms listener configuration - Websphere MQ resource adapter 7.5 - JBoss EAP 6.2
body: <p>I'm looking for some help.</p>
  
  <p><strong>Context:</strong> </p>
  
  <ul>
  <li>Application configuration, </li>
  <li>JBoss EAP 6.2, </li>
  <li>WebSphere MQ 7.5 Resource Adapter, </li>
  <li>Spring</li>
  </ul>
  
  <p><strong>Current Status:</strong></p>
  
  <p>Application manages to send messages just fine, but unless we "boost" the number of connections related to message consumption, we have a warning message popping up in the logs:</p>
  
  <p><em><code>WARN  [org.springframework.jms.listener.DefaultMessageListenerContainer] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-28) Setup of JMS message listener invoker failed for destination 'jms/workflowInputQueue' - trying to recover. Cause: MQJCA1018: Only one session per connection is allowed.</code></em></p>
  
  <p>Research result:</p>
  
  <p>After some research, I identified the root cause from the following 2 links,
  and is referenced here <a href="http://www-01.ibm.com/support/docview.wss?uid=swg21665128" rel="nofollow">Removal of internal Connection Pooling for WebSphere MQ Classes</a>
  and here <a href="http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q031670_.htm?lang=en" rel="nofollow">IBM MQ - Configuring the resource adapter for inbound communication</a></p>
  
  <p>The root cause of the issue can be summarized by this <a href="http://www-01.ibm.com/support/docview.wss?uid=swg21665128" rel="nofollow">quote</a>:</p>
  
  <blockquote>
    <p>For Inbound Communications, the JMS Connection Pools and JMS Session Pools are implemented by the WebSphere MQ JCA resource adapter.</p>
  </blockquote>
  
  <p><strong>What I'm looking for:</strong>
  <em>I don't have prior Spring knowledge, my tasks usually were focused on Linux/Unix Administration, Application Server setup and configuration.</em></p>
  
  <p>I'd like:</p>
  
  <ul>
  <li>A sample configuration for a jms listener (MDP), with some indication of what can be configured in JBoss, and what cannot and should be configured in spring or other xml configuration (Activation Spec being an example</li>
  <li>Additional sources I can read to better understand the spring configuration</li>
  <li>Some explanation on how to reference the resource adapter in the Spring configuration, while the wmq.jmsra.rar resource adapter has been uploaded in the JBoss Content Repository, and assigned to the same server group as the application.</li>
  </ul>
  
  <p>The ideal form of the solution:</p>
  
  <ul>
  <li>A sample Spring configuration (xml based), with Resource adapter, ActivationSpec, MessageEndpointListener or (jca-?)listener-container, that would provide a good overview of the configuration necessary</li>
  <li>Possibly explanations on how to define all this configuration in JBos, and make reference  to it in spring through jndi lookup.</li>
  </ul>
  
  <p>I already asked this question through the JBoss Community forum but haven't received much feedback</p>
  
  <p><strong>Current problematic configuration:</strong></p>
  
  <pre><code>/profile=myapp/subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/connection-definitions=myappListenerQCF:read-resource(include-defaults=true,recursive=true)
  {
      "outcome" =&gt; "success",
      "result" =&gt; {
          "allocation-retry" =&gt; undefined,
          "allocation-retry-wait-millis" =&gt; undefined,
          "background-validation" =&gt; false,
          "background-validation-millis" =&gt; undefined,
          "blocking-timeout-wait-millis" =&gt; undefined,
          "class-name" =&gt; "com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl",
          "enabled" =&gt; true,
          "flush-strategy" =&gt; "FailingConnectionOnly",
          "idle-timeout-minutes" =&gt; undefined,
          "interleaving" =&gt; false,
          "jndi-name" =&gt; "java:/jms/myappListenerQCF",
          "max-pool-size" =&gt; "100",
          "min-pool-size" =&gt; "100",
          "no-recovery" =&gt; false,
          "no-tx-separate-pool" =&gt; false,
          "pad-xid" =&gt; false,
          "pool-prefill" =&gt; "true",
          "pool-use-strict-min" =&gt; "true",
          "recovery-password" =&gt; undefined,
          "recovery-plugin-class-name" =&gt; undefined,
          "recovery-plugin-properties" =&gt; undefined,
          "recovery-security-domain" =&gt; "wsmq_security",
          "recovery-username" =&gt; undefined,
          "same-rm-override" =&gt; undefined,
          "security-application" =&gt; false,
          "security-domain" =&gt; "wsmq_security",
          "security-domain-and-application" =&gt; undefined,
          "use-ccm" =&gt; true,
          "use-fast-fail" =&gt; false,
          "use-java-context" =&gt; true,
          "use-try-lock" =&gt; undefined,
          "wrap-xa-resource" =&gt; true,
          "xa-resource-timeout" =&gt; undefined,
          "config-properties" =&gt; {
              "hostName" =&gt; {"value" =&gt; "mqserverhostname"},
              "port" =&gt; {"value" =&gt; "1520"},
              "channel" =&gt; {"value" =&gt; "channelname"},
              "transportType" =&gt; {"value" =&gt; "CLIENT"},
              "queueManager" =&gt; {"value" =&gt; "qmname"}
          }
      }
  }
  /profile=myapp/subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=workflowInputQueue:read-resource(include-defaults=true,recursive=true)
  {
      "outcome" =&gt; "success",
      "result" =&gt; {
          "class-name" =&gt; "com.ibm.mq.connector.outbound.MQQueueProxy",
          "enabled" =&gt; true,
          "jndi-name" =&gt; "java:/jms/workflowInputQueue",
          "use-java-context" =&gt; true,
          "config-properties" =&gt; {"baseQueueName" =&gt; {"value" =&gt; "QUEUE.IN"}}
      }
  }
  </code></pre>
  
  <p>Also worth noting that there is another post on Stack Overflow entitled "Spring JMS and WebSphere MQ", which covers at least partly the subject, but not at all the jboss aspect.
  I'd favor being able to push most of the configuration at jboss level and just look it up in Spring if possible.</p>
  
  <p>Thanks in advance for all the input the community could provide</p>