Hi guys!
Iīm new to Spring Integration and I have the following concern as I couldnīt find a solution to it. I need to leave a file (after itīs processed) into a specific folder that is located in a file server. The matter is that this folder asks for permissions (username & password) in order to be written. Could you please tell me where and how to set this configuration? I provide you with a copy of my spring-integration.xml below:
<?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:int="http://www.springframework.org/schema/integration"
xmlns:jdbc="http://www.springframework.org/schema/integration/jdbc"
xmlns:stream="http://www.springframework.org/schema/integration/stream"
xmlns:int-xml="http://www.springframework.org/schema/integration/xml"
xmlns:file="http://www.springframework.org/schema/integration/file"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schem...ntegration.xsd
http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schem...ation-jdbc.xsd
http://www.springframework.org/schem...gration/stream http://www.springframework.org/schem...ion-stream.xsd
http://www.springframework.org/schema/integration/xml http://www.springframework.org/schem...ration-xml.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd">
<!-- Log interceptors -->
<int:logging-channel-adapter id="loggerEntrada" log-full-message="true"/>
<!-- Gets rows from a table -->
<int:channel id="jdbcChannel">
<int:interceptors>
<int:wire-tap channel="loggerEntrada"/>
</int:interceptors>
</int:channel>
<jdbc:inbound-channel-adapter
query="SELECT
(select OrigenCodigoCOTA from OrganismosPublicos.Origen where OrigenId = 1 ) as origenId,
(select ProcedenciaCodigoCOTA from OrganismosPublicos.Procedencia where ProcedenciaId = 1 )as procedenciaId,
TipoDeInstancia.TipoDeInstanciaCodigo as codigoTipoInstancia,
Cliente.ClienteCodigoCOTA as numeroClienteCOTA,
SUBSTRING ( cast (Denunciante.DenuncianteAni as varchar(10)),1,2) as aniCodigoArea,
SUBSTRING ( cast (Denunciante.DenuncianteAni as varchar(10)),3,4) as aniPrefijo,
SUBSTRING ( cast (Denunciante.DenuncianteAni as varchar(10)),7,4)as aniSufijo,
HEN.HistorialDeEstadoDeNotaFechaDeCambioDeEstado as fechaIngresoNota,
'OP105131-00-001 - bpm para cnc.- servicio de Pioneer ' as codigoContactoPioneer,
null as Id
FROM OrganismosPublicos.HistorialDeEstadoDeNota HEN
left join OrganismosPublicos.Nota Nota ON HEN.NotaId = Nota.NotaID
left join OrganismosPublicos.Denunciante Denunciante ON Nota.DenunciaID = Denunciante.DenunciaID
left join OrganismosPublicos.TipoDeInstancia TipoDeInstancia ON TipoDeInstancia.TipoDeInstanciaId = Nota.TipoDeInstanciaID
left join OrganismosPublicos.Cliente Cliente ON Denunciante.ClienteId = Cliente.ClienteID
WHERE (HEN.EstadoId = 1 or HEN.EstadoId = 14)
and HEN.HistorialDeEstadoDeNotaFechaDeCambioDeEstado < dateadd(hh, ${com.tm.denuncias.periodoHorasReporteContactos} ,getDate())"
channel="jdbcChannel" data-source="defaultDataSource"
row-mapper="registroReporteContactoRowMapper">
<int: poller cron="0 0 0/${com.tm.denuncias.periodoHorasReporteContactos} * * ?" >
<int:transactional />
</int: poller>
</jdbc:inbound-channel-adapter>
<!-- Transformer which converts data into a file -->
<int:transformer id="dataToFileTransformer" ref="registroReporteContactoToFileTransformerImpl" input-channel="jdbcChannel"
method="transform" output-channel="toFolder"/>
<!-- Sends file to folder -->
<int:channel id="toFolder">
<int:interceptors>
<int:wire-tap channel="loggerEntrada"/>
</int:interceptors>
</int:channel>
<file:outbound-channel-adapter channel="toFolder" directory="${com.tm.denuncias.directorioReporteCon tactos}" auto-create-directory="true" />
</beans>
Thanks a lot in advance! Much appreciated it! If you need further info please let me know.
Best regards,
TJ


Reply With Quote