[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Content based router with JSONPATH (Solution found)

I found JSON path statement to query the JSON object:


On 05/22/2018 08:12 AM, Michael Joyner wrote:

Hi everyone.

This might be a easy question, I have been fighting with it for a couple hours. I have a JSON array that is sent to a splitter to process each JSON object.


    "id": "2b144adc-1af4-1446-e22a-58b367d22272",
    "module_name": "Accounts",
    "name_value_list": {
        "name": {
            "name": "name",
            "value": "Tri-State Medical Corp"
        "account_type": {
            "name": "account_type",
            "value": "Customer"
        "industry": {
            "name": "industry",
            "value": "Environmental"
        "annual_revenue": {
            "name": "annual_revenue",
            "value": ""
        "rating": {
            "name": "rating",
            "value": ""


Here's my route, I can't seem to find the right syntax to get jsonpath() to evaluate like XPATH. It wont run because the JSON path string isn't happy.



                   .when().jsonpath( *"**$.name_value_list.account_type.value = 'Customer'*"   )
                      .log("CUSTOMER \n ${body}")

                   .when().jsonpath(  "*$.name_value_list.account_type.value = 'Vendor'*"  )
                      .log("VENDOR\n ${body}")

( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-camel-users/msg03324.html on line 138
Call Stack
10.0007368696{main}( ).../msg03324.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-camel-users/msg03324.html on line 138
Call Stack
10.0007368696{main}( ).../msg03324.html:0