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:

  1. 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: {  
  2.   “message”: {  
  3.     “Size”: 5,  
  4.     “Payload is”: [  
  5.       {  
  6.         “A”“Example 1”,  
  7.         “B”“Sample 1”  
  8.       },  
  9.       {  
  10.         “A”“Example 2”,  
  11.         “B”“Sample 2”  
  12.       },  
  13.       {  
  14.         “A”“Example 3”,  
  15.         “B”“Sample 3”  
  16.       },  
  17.       {  
  18.         “A”“Example 4”,  
  19.         “B”“Sample 4”  
  20.       },  
  21.       {  
  22.         “A”“Example 5”,  
  23.         “B”“Sample 5”  
  24.       }  
  25.     ]  
  26.   }  
  27. }  
  28. 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: {  
  29.   “message”: {  
  30.     “Size”: 5,  
  31.     “Payload is”: [  
  32.       {  
  33.         “A”“Example 6”,  
  34.         “B”“Sample 6”  
  35.       },  
  36.       {  
  37.         “A”“Example 7”,  
  38.         “B”“Sample 7”  
  39.       },  
  40.       {  
  41.         “A”“Example 8”,  
  42.         “B”“Sample 8”  
  43.       },  
  44.       {  
  45.         “A”“Example 9”,  
  46.         “B”“Sample 9”  
  47.       },  
  48.       {  
  49.         “A”“Example 10”,  
  50.         “B”“Sample 10”  
  51.       }  
  52.     ]  
  53.   }  
  54. }  
  55. 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: {  
  56.   “message”: {  
  57.     “Size”: 5,  
  58.     “Payload is”: [  
  59.       {  
  60.         “A”“Example 11”,  
  61.         “B”“Sample 11”  
  62.       },  
  63.       {  
  64.         “A”“Example 12”,  
  65.         “B”“Sample 12”  
  66.       },  
  67.       {  
  68.         “A”“Example 13”,  
  69.         “B”“Sample 13”  
  70.       },  
  71.       {  
  72.         “A”“Example 14”,  
  73.         “B”“Sample 14”  
  74.       },  
  75.       {  
  76.         “A”“Example 15”,  
  77.         “B”“Sample 15”  
  78.       }  
  79.     ]  
  80.   }  
  81. }  
  82. 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: {  
  83.   “message”: {  
  84.     “Size”: 3,  
  85.     “Payload is”: [  
  86.       {  
  87.         “A”“Example 16”,  
  88.         “B”“Sample 16”  
  89.       },  
  90.       {  
  91.         “A”“Example 17”,  
  92.         “B”“Sample 17”  
  93.       },  
  94.       {  
  95.         “A”“Example 18”,  
  96.         “B”“Sample 18”  
  97.       }  
  98.     ]  
  99.   }  
  100. }  

Leave a Reply