Results 1 to 10 of 12

Thread: Outbound Channel Adaptor is not responding

Hybrid View

  1. #1

    Default Outbound Channel Adaptor is not responding

    Hi,

    I am trying to print all lines of input file & then copy the input file to ouput directory. For that I am using the below configuration:

    Code:
     <channel id="message.inbound" />
    	<channel id="message.outbound" />
    	<context:property-placeholder location="classpath:/Budetest.properties" />
       
       <file:inbound-channel-adapter id="mfInputFileProcessor"
    		directory="file:${input.directory}" filename-pattern="message*">
    		<poller id="mfInputPoller" fixed-delay="10" time-unit="SECONDS"/>
    	</file:inbound-channel-adapter>	
    
    	<file:file-to-string-transformer
    		input-channel="mfInputFileProcessor"
    		output-channel="mfInputFileParser" charset="UTF-8"
    		delete-files="false" />
    
    	<splitter input-channel="mfInputFileParser" ref="mFileHandler"
    		method="extractLines" output-channel="message.inbound" />
    
    	<beans:bean id="mFileHandler"
    		class="com.test.project.brokerage.fileAdaptor.Utilities.FileHandler" />
    		
    	 <beans:bean id="printBudeMessage"
    		class="com.test.project.brokerage.fileAdaptor.FileTransformerTest" />
    				
    	<splitter input-channel="message.inbound" ref="printBudeMessage"
    		method="printLine" output-channel="message.outbound" />
    	
    	<file:outbound-channel-adapter id="filesOut"
    			 channel="message.outbound"
                 directory="${output.directory}"
                 auto-create-directory="true"
                 delete-source-files="false"/>
    Its printing all the lines but not copying the input file to output directory.

    Please advise.

    Regards,
    Mahendra Singh

  2. #2
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    Its printing all the lines but not copying the input file to output directory.
    I am assuming your printLine method does that.

    Can you post here the implementation of your class com.test.project.brokerage.fileAdaptor.FileTransfo rmerTest ?

    Also explain us in brief if possible your use case, what you are expecting to happen if the above thing works successfully.

  3. #3

    Default

    Code:
    public class BUDeTransformerTest {
    
    	private static Logger log = Logger.getLogger(BUDeTransformerTest.class);
    	public void printLine(String payload) {
    		log.info(payload.toString());
    		System.out.println(payload.toString());
    	}
    }
    I am expecting the above code should print each line of all the input files and copy them to the output directory.

  4. #4
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    Ok, let your printLine return a String and have
    Code:
    return payload;
    at the end.

    This is however, not what a splitter is intended for.

    Also, how are you expecting the files to be written?

    First try changing the signature of the method and return the string. Then see if the files are being written, what is the content of the files and what are the names of the files.
    Let us know whats the result and what was your expectation.

  5. #5

    Default

    Thanks Amol for this suggestion.

    Its printing all the lines, however unfortunately its not copying all the lines to the output directory.

    also I can see some strange behavior, in the output directory, as explained below:

    I have provided input file message.csv, which has 4 lines. But in the output directory I get 2 files:

    message.csv and message.csvnull

    and both having 1 line, i.e. line no.1 and line no.4 respectively.

    Please have a look at the attached files.(Please remove .txt extension from both the files. I have added it to upload these files)

    Please advise.
    Attached Files Attached Files

  6. #6

    Default

    The above files are the output files. The input file is attached below.(Please remove .txt extension):
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •