How to chunk csv file content into smaller using MuleSoft?

How to chunk csv file content into smaller using MuleSoft?

Listener Configuration:

File Read  Configuration:

Transform Message  Configuration:

For Each  Configuration:

Transform Message inside For Each  Configuration:

Logger  Configuration:

Output:

INFO  2019-02-17 10:26:50,999 [[MuleRuntime].cpuLight.08: [test].testFlow.CPU_LITE @77f9697c] [event: 0-72a0a750-32c8-11e9-b865-025041000001] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: {  
  "message": {  
	"Size": 5,  
	"Payload is": [  
	  {  
		"A": "Example 1",  
		"B": "Sample 1"  
	  },  
	  {  
		"A": "Example 2",  
		"B": "Sample 2"  
	  },  
	  {  
		"A": "Example 3",  
		"B": "Sample 3"  
	  },  
	  {  
		"A": "Example 4",  
		"B": "Sample 4"  
	  },  
	  {  
		"A": "Example 5",  
		"B": "Sample 5"  
	  }  
	]  
  }  
}  
INFO  2019-02-17 10:26:51,014 [[MuleRuntime].cpuLight.06: [test].testFlow.CPU_LITE @77f9697c] [event: 0-72a0a750-32c8-11e9-b865-025041000001] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: {  
  "message": {  
	"Size": 5,  
	"Payload is": [  
	  {  
		"A": "Example 6",  
		"B": "Sample 6"  
	  },  
	  {  
		"A": "Example 7",  
		"B": "Sample 7"  
	  },  
	  {  
		"A": "Example 8",  
		"B": "Sample 8"  
	  },  
	  {  
		"A": "Example 9",  
		"B": "Sample 9"  
	  },  
	  {  
		"A": "Example 10",  
		"B": "Sample 10"  
	  }  
	]  
  }  
}  
INFO  2019-02-17 10:26:51,029 [[MuleRuntime].cpuLight.06: [test].testFlow.CPU_LITE @77f9697c] [event: 0-72a0a750-32c8-11e9-b865-025041000001] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: {  
  "message": {  
	"Size": 5,  
	"Payload is": [  
	  {  
		"A": "Example 11",  
		"B": "Sample 11"  
	  },  
	  {  
		"A": "Example 12",  
		"B": "Sample 12"  
	  },  
	  {  
		"A": "Example 13",  
		"B": "Sample 13"  
	  },  
	  {  
		"A": "Example 14",  
		"B": "Sample 14"  
	  },  
	  {  
		"A": "Example 15",  
		"B": "Sample 15"  
	  }  
	]  
  }  
}  
INFO  2019-02-17 10:26:51,039 [[MuleRuntime].cpuLight.06: [test].testFlow.CPU_LITE @77f9697c] [event: 0-72a0a750-32c8-11e9-b865-025041000001] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: {  
  "message": {  
	"Size": 3,  
	"Payload is": [  
	  {  
		"A": "Example 16",  
		"B": "Sample 16"  
	  },  
	  {  
		"A": "Example 17",  
		"B": "Sample 17"  
	  },  
	  {  
		"A": "Example 18",  
		"B": "Sample 18"  
	  }  
	]  
  }  
}  

Leave a Reply