1

JMS 대상에서 메시지를 읽고 Chuck Tasklet을 사용하여 XML 파일에 쓰도록 일괄 처리 작업을 구성했습니다. JMS 리더는 JMSTemplate의 receive 메소드를 호출하는 사용자 정의 구현입니다. JMS 브로커로 webMethods Broker를 사용하고 있습니다. Batch 실행 중에 Broker Destination에서 메시지를 읽는 동안 생성 된 Consumer 세션은 일괄 처리 완료시 소멸되지 않는 것으로 나타났습니다. 그들은 JVM을 종료 한 후에 만 ​​파기됩니다. 나는Spring : JMS 메시지 저장소에서 제거되지 않은 소비자 세션/연결 일괄 작업 완료

JMS 봄 XML 구성,보다 자세한 내용을 제공하고 있습니다 :

<bean id="JMS.SourceQueue.JndiTemplate" class="org.springframework.jndi.JndiTemplate"> 
    <property name="environment"> 
     <map> 
      <entry key="java.naming.provider.url" value="wmjmsnaming://Broker #[email protected]:6849" /> 
      <entry key="java.naming.factory.initial" value="com.webmethods.jms.naming.WmJmsNamingCtxFactory" /> 
      <entry key="com.webmethods.jms.naming.clientgroup" value="IS-JMS" /> 
     </map> 
    </property> 
</bean> 
<bean id="JMS.SourceQueue.JmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> 
    <property name="jndiTemplate" ref="JMS.SourceQueue.JndiTemplate" /> 
    <property name="jndiName" value="SmartBatchConnectionFactory" /> 
    <property name="lookupOnStartup" value="true" /> 
    <property name="cache" value="false" /> 
    <property name="proxyInterface" value="javax.jms.ConnectionFactory" /> 
</bean> 
<bean id="JMS.SourceQueue.ConnectionFactory" 
    class="org.springframework.jms.connection.CachingConnectionFactory"> 
    <constructor-arg ref="JMS.SourceQueue.JmsConnectionFactory" /> 
</bean> 
<bean id="JMS.SourceQueue.DefaultDestination" class="org.springframework.jndi.JndiObjectFactoryBean"> 
    <property name="jndiTemplate" ref="JMS.SourceQueue.JndiTemplate" /> 
    <property name="jndiName" value="SourceQueue" /> 
</bean> 
<bean id="JMS.SourceQueue.MessageTemplate" class="org.springframework.jms.core.JmsTemplate"> 
    <property name="connectionFactory" ref="JMS.SourceQueue.ConnectionFactory" /> 
    <property name="receiveTimeout" value="10000" /> 
    <property name="sessionTransacted" value="true" /> 
    <property name="defaultDestination" ref="JMS.SourceQueue.DefaultDestination" /> 
</bean> 

어떤 도움을 좋은 것 실제 문제를 지적에.

답변

0

step 끝 부분에 JMS.SourceQueue.ConnectionFactorydestroy() (또는 기타 작업 완료시)으로 전화하십시오.

캐싱 연결 팩토리를 사용하면 각 메시지에 대해 연결/사용자를 만들지 않으므로 실제로 리소스를 해제해야하는시기를 알려야합니다.