Announcement Announcement Module
Collapse
No announcement yet.
file inbound channel adapter/sftp channel adapter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • file inbound channel adapter/sftp channel adapter

    Hi,

    I have an inbound channel adapter which has a poller configured at 5 am daily with cron expression.

    The files on the inbound channel are read from a directory and sent to a channel which is then sftp'ed to a remote directory.

    The question I have here is, can I have another xml configuration file with an inbound channel that has the same id as the first one
    which also has a poller configured with a fixed delay at every 15 minute interval.the files will be read from a different directory and sftp'ed to a remote directory.Can I have multiple configuration on the same channel id.

    [HTML]
    <int:inbound-channel-adapter id="inboundAdapter"
    expression="new java.io.File('${xxx.localDir}').listFiles()">
    <intoller fixed-delay="900000">
    </intoller>
    </int:inbound-channel-adapter>

    <int:inbound-channel-adapter id="inboundAdapter"
    expression="new java.io.File('${yyy.localDir}').listFiles()">
    <intoller cron="0 0 5 0 0 0">
    </intoller>
    </int:inbound-channel-adapter>
    {/HTML]


    Not sure if this is clear.Please help with this one.

    Thanks

  • #2
    If you want to have multiple adapters feed into the same flow, give each adapter a different ID, but set their "channel" attribute to the same channel.

    Don't use implicit channel naming for this case.

    Comment


    • #3
      Please correct me if wrong.From what I understand..In both the cases we will be referring to the same method in the same bean which constructs the message and sends it in the sftpchannel.


      HTML Code:
              <int:inbound-channel-adapter id="[B][I][U]inboundAdapter1"[/U][/I][/B]
      		expression="new java.io.File('${xxx.localDir}').listFiles()">
      		<int:poller fixed-delay="900000">
      		</int:poller>
      	</int:inbound-channel-adapter>
      
             <int:channel id="[B][U]sendChannel[/U][/B]" />
      	<int:service-activator input-channel=[B][I][U]"inboundAdapter1[/U][/I][/B]"
      		ref="XXX" method="sendFile" />
      
      	<bean id="XXX" class="<classpath.">
      	</bean>
      
          	<sftp:outbound-channel-adapter channel="[B][I][U]sendChannel[/U][/I][/B]"
      		session-factory="sftpSessionFactory" id="[I][U][B]sftpInboundAdapter1[/B][/U][/I]"
      		auto-create-directory="true" temporary-file-suffix="temp"
      		remote-directory-expression="headers['remote-directory']" />
      In the second case, its going to be..

      HTML Code:
       <int:inbound-channel-adapter id=[B][I][U]"inboundAdapter2"[/U][/I][/B]
      		expression="new java.io.File('${yyy.localDir}').listFiles()">
      		<int:poller cron="0 0 5 0 0 0">
      		</int:poller>
      	</int:inbound-channel-adapter>
      
             <int:channel id="[B][U]sendChannel[/U][/B]" />
      	<int:service-activator input-channel=[B][I][U]"inboundAdapter2[/U][/I][/B]"
      		ref="XXX" method="sendFile" />
      
      	<bean id="XXX" class="<classpath.">
      	</bean>
      
      <sftp:outbound-channel-adapter channel="[B][I][U]sendChannel[/U][/I][/B]"
      		session-factory="sftpSessionFactory" id="[I][U][B]sftpInboundAdapter2[/B][/U][/I]"
      		auto-create-directory="true" temporary-file-suffix="temp"
      		remote-directory-expression="headers['remote-directory']" />

      Thanks

      Comment


      • #4
        In the above thread the bold ,italic and the underline tags doesn't seem to work.Sorry for the confusion.Wherever it is [B],[I],[u] ,I wanted to highlight it.
        looks like it did not work.

        Comment


        • #5
          You should use <int:inbound-channel-adapter id="inboundAdapter1" channel="sendChannel" ... />

          You should NOT give the outbound channel adapters the same names as their inbound adapters.

          Comment

          Working...
          X