Spring Integration - WebService - Acessar webservice apatir de consultar no DB

0 respostas
jbrasileiro

Bom Dia pessoal,

Estou precisando de uma ajuda.
Estou utilizando Spring Integration.
Preciso fazer o seguinte:

  • Realizar um query no banco para pegar os processos especificos: []
  • Apartir dessa query passar para um channel e então disparar um serviço que ira buscar as informações relacionadas desse objetos.

Alguem pode me dar uma luz?
Estou tentando usar o seguinte mas não esta funcionando:
Erro: The prefix “jdbc” for element “jdbc:inbound-channel-adapter” is not bound.

<jdbc:inbound-channel-adapter query="select * from envios where :idTipoStatus = 0"
  		channel="NChannel" data-source="dataSource"  sql-parameter-source-factory="spelSource">
	  	<poller fixed-rate="1000">
	   		<transactional />
	  	</poller>
	</jdbc:inbound-channel-adapter>
	
	<bean id="spelSource" 
      class="o.s.integration.jdbc.ExpressionEvaluatingSqlParameterSourceFactory">
    <property name="parameterExpressions">
        <map>
            <entry key="idTipoStatus" value="0"/>
        </map>
    </property>
	</bean>

application-context.xml:

<!-- INTEGRATION CHANNELS -->

	<poller id="defaultPoller" default="true" max-messages-per-poll="5"
		fixed-rate="${fixed.rate}" />

	<file:inbound-channel-adapter directory="${input.folder}"
		scanner="directoryScanner" channel="fileInput" auto-create-directory="true"
		prevent-duplicates="false" />

	<file:outbound-gateway id="gateway" directory="${backup.folder}"
		delete-source-files="true" request-channel="fileInput" reply-channel="fileQueue"
		filename-generator="fileNameGenerator" auto-create-directory="true" />

	<channel id="fileInput">
		<interceptors>
			<ref bean="fileInputInterceptor" />
		</interceptors>
	</channel>

	<channel id="fileQueue">
		<queue capacity="300" />
	</channel>

	<chain input-channel="fileQueue" output-channel="replyChannel">
		<file:file-to-string-transformer
			charset="UTF-8" />
		<service-activator ref="MessageSaver" method="saveInputMessageSend" />
		<service-activator ref="Validator" method="validate" />
		<transformer ref="transformer" method="transformXML" />
		<service-activator ref="webServiceCaller" method="callWebService" />
	</chain>
	
	<!-- ############################## -->
	<!-- Handling ReplyChannel -->
	<!-- ############################## -->
	
	
	<channel id="replyChannel">
		<queue capacity="300" />
	</channel>
	
	<chain input-channel="replyChannel" output-channel="outputChannel">
		<transformer ref="genericResponseTransformer" method="transformGenericFile" />
		<service-activator ref="MessageSaver" method="saveInfo" />
	</chain>
	
	<file:outbound-channel-adapter id="outputChannel"
		directory="${output.folder}" filename-generator="fileNameGenerator" />

	<publish-subscribe-channel id="successfulFileWriter" />
	<publish-subscribe-channel id="failedFileWritter" />

	<chain input-channel="failedFileTransforming" output-channel="failedFileWritter">
		<transformer ref="exceptionMessageTransformer" method="transformFromExceptionMessage" />
	</chain>
	
	<!-- ############################## -->
	<!-- Verify and Calling  WebService To Get InputFile -->
	<!-- ############################## -->


	<!-- ############################## -->
	<!-- Receiving XML to send to webService -->
	<!-- ############################## -->
	<channel id="newChannel">
		<queue capacity="300" />
	</channel>
	
	<chain input-channel="newChannel" output-channel="outputChannel">
		<service-activator ref="MessageSaver" method="saveReplySend" />	
	</chain>
	<file:outbound-channel-adapter id="outputChannel" filename-generator="fileNameGenerator"
		 directory="${output.folder}"/>
Criado 21 de setembro de 2012
Respostas 0
Participantes 1