<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
                           http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/context 
                           http://www.springframework.org/schema/context/spring-context.xsd">


                        
    <context:property-placeholder location="classpath:main.properties" />
	<bean id="mqConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
		<property name="transportType">
			<value>1</value>
		</property>
		<property name="hostName">
			<value>${queue_hostname}</value>
		</property>
		<property name="port">
			<value>${queue_port}</value>
		</property>
		<property name="queueManager">
			<value>${queue_manager}</value>
		</property>
		<property name="channel">
			<value>myChannel</value>
		</property>
	</bean>
	<bean id="jmsQueueConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory102">
		<property name="targetConnectionFactory" ref="mqConnectionFactory"/>
		<property name="pubSubDomain" value="false"></property>
	</bean>	
	<bean id="jmsDestinationResolver" class="org.springframework.jms.support.destination.DynamicDestinationResolver"/>	
	<bean id="jmsQueueTemplate" class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory" ref="jmsQueueConnectionFactory" />
        <property name="destinationResolver" ref="jmsDestinationResolver" />
        <property name="pubSubDomain" value="false" />
        <property name="receiveTimeout" value="10000" />
    </bean>
	<bean id="mqQueue_Reader" class="com.ibm.mq.jms.MQQueue">
        <property name="baseQueueName" value="${queue}" />
		<!--<property name="CCSID" value="${mqSeriesQueueManagerCCSID}" /> -->
<!--         <property name="targetClient"> -->
<!--             <util:constant static-field="com.ibm.mq.jms.JMSC.MQJMS_CLIENT_NONJMS_MQ" /> -->
<!--         </property> -->
    </bean>
	<bean id="messageListener"	class="it.mice.voila.runtime.jms.test.JMSMessageServiceExampleListener" />
    <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
        <property name="connectionFactory" ref="jmsQueueConnectionFactory" />
        <property name="destination" ref="mqQueue_Reader" />
        <property name="messageListener" ref="messageListener" />
        <property name="receiveTimeout" value="3000" />
        <property name="maxMessagesPerTask" value="8" />
        <property name="autoStartup" value="true" />
        <property name="acceptMessagesWhileStopping" value="false" />
        <property name="maxConcurrentConsumers" value="3"/>
    </bean> 
</beans>