Announcement Announcement Module
Collapse
No announcement yet.
Help Spring + JMS + ActiveMQ Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help Spring + JMS + ActiveMQ

    Can someone help me?? i create one project with JMS something like this:
    Code:
    <amq:broker useJmx="false" persistent="false">
    		<amq:transportConnectors>
    			<amq:transportConnector uri="tcp://localhost:0" />
    		</amq:transportConnectors>
    	</amq:broker>
    
    	<bean id="defaultQueue" class="org.apache.activemq.command.ActiveMQQueue">
    		<constructor-arg value="defaultQueue" />
    	</bean>
    	<bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
    		<property name="connectionFactory" ref="jmsConnectionFactory" />
    	</bean>
    	<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    		<property name="brokerURL" value="vm://localhost" />
    	</bean>
    	<jms:listener-container connection-factory="pooledConnectionFactory" concurrency="8" prefetch="5" acknowledge="auto">
    <!--  
    		<jms:listener destination="filaNtNotas" ref="processaNtNotas" />
    		<jms:listener destination="filaRiImovel" ref="processaRiImovel" />
    -->		
    		<jms:listener destination="filaNTEscritura" ref="processaNTEscritura" />
    		<jms:listener destination="filaNTFirmas" ref="processaNTFirmas" />
    		<jms:listener destination="filaNTProcuracao" ref="processaNTProcuracao" />
    		<jms:listener destination="filaNTSubstabelecimento" ref="processaNTSubstabelecimento" />
    		<jms:listener destination="filaNTTestamento" ref="processaNTTestamento" />
    		<jms:listener destination="filaPTProtesto" ref="processaPTProtesto" />
    		<jms:listener destination="filaRCAusencia" ref="processaRCAusencia" />
    		<jms:listener destination="filaRCCasamento" ref="processaRCCasamento" />
    		<jms:listener destination="filaRCEmancipacao" ref="processaRCEmancipacao" />
    		<jms:listener destination="filaRCInterdicao" ref="processaRCInterdicao" />
    		<jms:listener destination="filaRCNascimento" ref="processaRCNascimento" />
    		<jms:listener destination="filaRCObito" ref="processaRCObito" />
    		<jms:listener destination="filaRCOpcaoNacionalidade" ref="processaRCOpcaoNacionalidade" />
    		<jms:listener destination="filaRCSeparacao" ref="processaRCSeparacao" />
    		<jms:listener destination="filaRIImovel" ref="processaRIImovel" />
    		<jms:listener destination="filaRTDPJ" ref="processaRTDPJ" />
    		<jms:listener destination="filaArquivoIndice" ref="processaArquivoIndice" />
    	</jms:listener-container>
    <!-- 	scope="prototype" -->
    	<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"  >
    		<property name="connectionFactory" ref="pooledConnectionFactory" />
    	</bean>

    i have 2 methods
    method 1: receive one file name, and send to JMS
    method 2: receive the file name, open the file and save in DB

    when i call the method 1 2x, he save the content of first file 2 times..


    i need to close? dismiss? stop the message???

    tks
Working...
X