Can I split compressed files into json components in Camel via Spring DSL -


in nutshell, need take gzipped file containing json similar example, unzip (i know how that), each json object string , push amq popped webservice. i'm fine of 1 object, receiving file represents array. if array of strings or xml, see how camel processes it, don't see way split json. also, require streaming these files can large. edited try make request clearer, , provide sample json.

 [ {     "rickenbackerrepair": {         "estimateid": 22788411     },     "repairshop": {         "inspectionsite": {             "inspectiondate": ""         },         "repairfacility": {             "companyidcode": "",             "companyname": "",             "city": "",             "stateprovince": "",             "zippostalcode": "",             "country": ""         },         "repairinformation": {             "guitardateinshop": "",             "guitartimeinshop": "",             "authorizationmemo": "",             "guitartargetcompletiondate": "",             "guitartargetcompletiontime": "",             "guitarcompletiondate": "",             "guitarcompletiontime": ""         },         "locationofguitar": {             "city": "",             "stateprovince": "",             "zippostalcode": "",             "country": ""         }     },       "instrumentidentifier": {         "guitar": {             "claimrelated": {                 "primarypointofimpact": "",                 "secondarypointofimpact": ""             },             "identification": {                 "databaseguitarcode": "",                 "manufacturingstateprovince": "",                 "serialnumber": "",                 "guitarcondition": "",                 "productiondate": "",                 "year": "",                 "model": "",                 "guitartype": "",                 "bodystyle": "",                 "trimcode": "",                 "trimcolor": "",                 "optionslist": ""             }         }     },     "lin": [{         "internalcontrol": {             "lineindicator": ""         },         "part": {             "description": {                 "parttype": "",                 "descriptionjudgmentflag": "",                 "oempartnumber": "",                 "priceincludedindicator": "",                 "alternatepartindicator": "",                 "taxableflag": "",                 "databasepartprice": "",                 "actualpartprice": "",                 "pricejudgmentflag": "",                 "certifiedflag": "",                 "quantity": ""             },             "nonoemsupplier": {                 "companyidcode": "",                 "nonoempartnumber": "",                 "nonoemsupplieruseroverride": "",                 "nonoemsuppliermemo": ""             },             "adjustment": {                 "percent": "",                 "amount": ""             }         },         "labor": {             "description": {                 "type": "",                 "actualhours": "",                 "hoursjudgmentflag": "",                 "typejudgmentflag": ""             },             "miscsublet": {                 "amount": "",                 "subletflag": ""             }         }     }],      "stl": {         "subtotal": [{             "totaltype": "",             "totaltypecode": "",             "subtotaldetail": {                 "taxableamount": ""             }         }]     } }, {     "rickenbackerrepair": {         "estimateid": 22788412     },     "repairshop": {         "inspectionsite": {             "inspectiondate": ""         },         "repairfacility": {             "companyidcode": "",             "companyname": "",             "city": "",             "stateprovince": "",             "zippostalcode": "",             "country": ""         },         "repairinformation": {             "guitardateinshop": "",             "guitartimeinshop": "",             "authorizationmemo": "",             "guitartargetcompletiondate": "",             "guitartargetcompletiontime": "",             "guitarcompletiondate": "",             "guitarcompletiontime": ""         },         "locationofguitar": {             "city": "",             "stateprovince": "",             "zippostalcode": "",             "country": ""         }     },       "instrumentidentifier": {         "guitar": {             "claimrelated": {                 "primarypointofimpact": "",                 "secondarypointofimpact": ""             },             "identification": {                 "databaseguitarcode": "",                 "manufacturingstateprovince": "",                 "serialnumber": "",                 "guitarcondition": "",                 "productiondate": "",                 "year": "",                 "model": "",                 "guitartype": "",                 "bodystyle": "",                 "trimcode": "",                 "trimcolor": "",                 "optionslist": ""             }         }     },     "lin": [{         "internalcontrol": {             "lineindicator": ""         },         "part": {             "description": {                 "parttype": "",                 "descriptionjudgmentflag": "",                 "oempartnumber": "",                 "priceincludedindicator": "",                 "alternatepartindicator": "",                 "taxableflag": "",                 "databasepartprice": "",                 "actualpartprice": "",                 "pricejudgmentflag": "",                 "certifiedflag": "",                 "quantity": ""             },             "nonoemsupplier": {                 "companyidcode": "",                 "nonoempartnumber": "",                 "nonoemsupplieruseroverride": "",                 "nonoemsuppliermemo": ""             },             "adjustment": {                 "percent": "",                 "amount": ""             }         },         "labor": {             "description": {                 "type": "",                 "actualhours": "",                 "hoursjudgmentflag": "",                 "typejudgmentflag": ""             },             "miscsublet": {                 "amount": "",                 "subletflag": ""             }         }     }],      "stl": {         "subtotal": [{             "totaltype": "",             "totaltypecode": "",             "subtotaldetail": {                 "taxableamount": ""             }         }]     } } ] 

you should able use jsonpath expression split incoming message (file) , process each element individually.

<route>   <from uri="file://path" />   <split>     <jsonpath>$.</jsonpath>     <to uri="direct:dosomething">   </split> </route> 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -