{"id":19005181,"url":"https://github.com/dhis2/camel-dhis2","last_synced_at":"2025-04-22T18:52:35.104Z","repository":{"id":37958754,"uuid":"488490826","full_name":"dhis2/camel-dhis2","owner":"dhis2","description":"Camel DHIS2 Component","archived":false,"fork":false,"pushed_at":"2024-10-04T00:23:24.000Z","size":361,"stargazers_count":7,"open_issues_count":6,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-17T10:26:11.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://developers.dhis2.org/docs/integration/camel-dhis2-component","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhis2.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-04T07:24:02.000Z","updated_at":"2024-12-25T09:33:19.000Z","dependencies_parsed_at":"2023-11-14T12:27:55.633Z","dependency_job_id":"7a3b07ab-67d3-41cb-a4a9-9359bb9c4f97","html_url":"https://github.com/dhis2/camel-dhis2","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhis2%2Fcamel-dhis2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhis2%2Fcamel-dhis2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhis2%2Fcamel-dhis2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhis2%2Fcamel-dhis2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhis2","download_url":"https://codeload.github.com/dhis2/camel-dhis2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250304384,"owners_count":21408795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T18:26:32.087Z","updated_at":"2025-04-22T18:52:35.080Z","avatar_url":"https://github.com/dhis2.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= DHIS2 Component\n:doctitle: DHIS2\n:shortname: dhis2\n:artifactid: camel-dhis2\n:description: Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 Web API.\n:since: 4.0.0\n:supportlevel: Preview\n:component-header: Both producer and consumer are supported\n\n*Since Camel {since}*\n\n*{component-header}*\n\nThe Camel DHIS2 component leverages the https://github.com/dhis2/dhis2-java-sdk[DHIS2 Java SDK] to integrate Apache Camel with https://dhis2.org/[DHIS2]. DHIS2 is a free, open-source, fully customizable platform for collecting, analyzing, visualizing, and sharing aggregate and individual-data for district-level, national, regional, and international system and program management in health, education, and other domains.\n\nMaven users will need to add the following dependency to their `+pom.xml+`.\n\n[source,xml]\n----\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.hisp.dhis.integration.camel\u003c/groupId\u003e\n    \u003cartifactId\u003ecamel-dhis2\u003c/artifactId\u003e\n    \u003cversion\u003ex.x.x\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\n== URI Format\n\n....\ndhis2://operation/method[?options]\n....\n\n== Configuring Options\n\nCamel components are configured on two separate levels:\n\n* component level\n* endpoint level\n\n=== Configuring Component Options\n\nThe component level is the highest level which holds general and common configurations that are inherited by the endpoints. For example a component may have security settings, credentials for authentication, urls for network connection and so forth.\n\nSome components only have a few options, and others may have many. Because components typically have pre-configured defaults that are commonly used, then you may often only need to configure a few options on a component; or none at all.\n\nConfiguring components can be done with the https://camel.apache.org/manual/component-dsl.html[Component DSL], in a configuration file (application.properties|yaml), or directly with Java\ncode.\n\n=== Configuring Endpoint Options\n\nWhere you find yourself configuring the most is on endpoints, as endpoints often have many options, which allows you to configure what you need the endpoint to do. The options are also categorized into whether the endpoint is used as consumer (from) or as a producer (to), or used for both.\n\nConfiguring endpoints is most often done directly in the endpoint URI as path and query parameters. You can also use the https://camel.apache.org/manual/Endpoint-dsl.html[Endpoint DSL] as a type safe way of configuring endpoints.\n\nA good practice when configuring options is to use https://camel.apache.org/manual/using-propertyplaceholder.html[Property Placeholders], which allows to not hardcode urls, port numbers, sensitive information, and other settings. In other words placeholders allows to externalize the configuration from your code, and gives more flexibility and reuse.\n\nThe following two sections lists all the options, firstly for the component followed by the endpoint.\n\n== Component Options\n\nThe DHIS2 component supports the options listed below.\n\n[width=\"100%\",cols=\"13%,58%,4%,25%\",options=\"header\",]\n|===\n| Naming | Description | Default | Type\n| baseApiUrl (common) | DHIS2 server base API URL | | String\n| username (common) | Username of the DHIS2 user to operate as | | String\n| password (common) | Password of the DHIS2 username | | String\n| personalAccessToken (common) | Personal access token to authenticate with DHIS2. This option is mutually exclusive to username and password | | String\n| client (advanced) | Dhis2Client is an expensive object to create. To avoid creating multiple instances, it can be set directly. | | org.hisp.dhis.integration.sdk.api.Dhis2Client\n|===\n\n== Endpoint Options\n\nThe DHIS2 endpoint is configured using URI syntax:\n\n....\ndhis2:apiName/methodName\n....\n\nwith the following path and query parameters:\n\n=== Path Parameters\n\n[width=\"100%\",cols=\"13%,74%,5%,8%\",options=\"header\",]\n|===\n| Naming | Description |Default | Type\n| apiName (common) | *Required* What kind of operation to perform. Enum values: | | Dhis2ApiName\n| methodName (common) | *Required* What sub operation to use for the selected operation | | String\n|===\n\n=== Query Parameters\n\n[width=\"100%\",cols=\"16%,46%,6%,32%\",options=\"header\",]\n|===\n| Naming | Description | Default | Type\n| baseApiUrl (common) | DHIS2 server base API URL | | String\n| inBody (common) | Sets the name of a parameter to be passed in the exchange In Body | resource | String\n| client (advanced) | To use the custom client | | org.hisp.dhis.integration.sdk.api.Dhis2Client\n| password (security) | Password to use for basic authentication | | String\n| username (security) | Username to use for basic authentication | | String\n|===\n\n== API Parameters\n\nThe DHIS2 endpoint is an API-based component and has additional parameters based on which API name and API method is used. The API name and API method is located in the endpoint URI as the apiName/methodName path parameters:\n\n....\ndhis2:apiName/methodName\n....\n\nThe API names as listed in the table below:\n\n[width=\"100%\",cols=\"15%,5%,80%\",options=\"header\",]\n|===\n| API Name | Type | Description\n| get | Both | API for the get operation, which fetches a resource or a list resources from the server\n| post | Both | API for the create operation, which creates a new resource on the server\n| resourceTables | Both | API for resource and analytic operations\n|===\n\nEach API is documented in the following sections to come.\n\n=== API: get\n\n*Both producer and consumer are supported*\n\nThe get API is defined in the syntax as follows:\n\n....\ndhis2:get/methodName?[parameters]\n....\n\nThe method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)\n\n[cols=\",,\",options=\"header\",]\n|===\n| Method | Alias | Description\n| resource | | Retrieve a resource\n| collection | | Retrieve a list of resources\n|===\n\n==== METHOD resource\n\nSignatures:\n\n* java.io.InputStream resource(java.lang.String path, java.lang.String fields, java.lang.String filter, org.apache.camel.component.dhis2.api.RootJunctionEnum rootJunction, java.util.Map\u003cString, Object\u003e queryParams)\n\nThe get/resource API method has the parameters listed in the table below:\n\n[cols=\",,\",options=\"header\",]\n|===\n| Parameter | Description | Type\n| path | Resource URL path | String\n| fields | Comma-delimited list of fields to fetch | String\n| filter | Search criteria | String\n| rootJunction | Logic junction used between filters | RootJunctionEnum\n| queryParams | Custom query parameters | Map\n|===\n\nIn addition to the parameters above, the get/resource API can also use any of the link:#query-parameters[Query Parameters].\n\nAny of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelDhis2.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelDhis2.myParameterNameHere header.\n\n==== METHOD collection\n\nSignatures:\n\n* java.util.Iterator collection(java.lang.String path, java.lang.Boolean paging, java.lang.String fields, java.lang.String filter, java.util.Map\u003cString, Object\u003e queryParams)\n\nThe get/collection API method has the parameters listed in the table below:\n\n[width=\"100%\",cols=\"17%,72%,11%\",options=\"header\",]\n|===\n| Parameter | Description | Type\n| path | Resource URL path | String\n| arrayName | JSON property name holding the array to read | String\n| paging | Turn paging on/off | Boolean\n| fields | Comma-delimited list of fields to fetch | String\n| filter | Search criteria | String\n| rootJunction | Logic junction used between filters | RootJunctionEnum\n| queryParams |Custom query parameters | Map\n|===\n\nIn addition to the parameters above, the get/collection API can also use any of the link:#query-parameters[Query Parameters].\n\nAny of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelDhis2.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelDhis2.myParameterNameHere header.\n\n=== API: post\n\n*Both producer and consumer are supported*\n\nThe post API is defined in the syntax as follows:\n\n....\ndhis2:post/methodName?[parameters]\n....\n\n==== METHOD resource\n\nSignatures:\n\n* java.io.InputStream resource(java.lang.String path, java.lang.Object resource, java.util.Map\u003cString, Object queryParams)\n\nThe post/resource API method has the parameters listed in the table\nbelow:\n\n[cols=\",,\",options=\"header\",]\n|===\n| Parameter | Description | Type\n| path | Resource URL path | String\n| resource | New resource | Object\n| queryParams | Custom query parameters | Map\n|===\n\nIn addition to the parameters above, the post/resource API can also use any of the link:#query-parameters[Query Parameters].\n\nAny of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelDhis2.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelDhis2.myParameterNameHere header.\n\n=== API: put\n\n*Both producer and consumer are supported*\n\nThe post API is defined in the syntax as follows:\n\n....\ndhis2:put/methodName?[parameters]\n....\n\n==== METHOD resource\n\nSignatures:\n\n* java.io.InputStream resource(java.lang.String path, java.lang.Object resource, java.util.Map\u003cString, Object queryParams)\n\nThe put/resource API method has the parameters listed in the table\nbelow:\n\n[cols=\",,\",options=\"header\",]\n|===\n| Parameter | Description | Type\n| path | Resource URL path | String\n| resource | Updated resource | Object\n| queryParams | Custom query parameters | Map\n|===\n\nIn addition to the parameters above, the put/resource API can also use any of the link:#query-parameters[Query Parameters].\n\nAny of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelDhis2.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelDhis2.myParameterNameHere header.\n\n=== API: delete\n\n*Both producer and consumer are supported*\n\nThe delete API is defined in the syntax as follows:\n\n....\ndhis2:delete/methodName?[parameters]\n....\n\n==== METHOD resource\n\nSignatures:\n\n* java.io.InputStream resource(java.lang.String path, java.lang.Object resource, java.util.Map\u003cString, Object queryParams)\n\nThe delete/resource API method has the parameters listed in the table\nbelow:\n\n[cols=\",,\",options=\"header\",]\n|===\n| Parameter | Description | Type\n| path | Resource URL path | String\n| resource | Deleted resource | Object\n| queryParams | Custom query parameters | Map\n|===\n\nIn addition to the parameters above, the delete/resource API can also use any of the link:#query-parameters[Query Parameters].\n\nAny of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelDhis2.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelDhis2.myParameterNameHere header.\n\n=== API: resourceTables\n\n*Both producer and consumer are supported*\n\nThe resourceTables API is defined in the syntax as follows:\n\n....\ndhis2:resourceTables/methodName?[parameters]\n....\n\n==== METHOD analytics\n\nSignatures:\n\n* void analytics(java.lang.Boolean skipAggregate, java.lang.Boolean skipEvents, java.lang.Integer lastYears, java.lang.Integer, interval)\n\nThe post/resource API method has the parameters listed in the table below:\n\nThe resourceTables/analytics API method has the parameters listed in the table below:\n\n[width=\"100%\",cols=\"19%,70%,11%\",options=\"header\",]\n|===\n| Parameter | Description | Type\n| skipAggregate | Skip generation of aggregate data and completeness data | Boolean\n| skipEvents | Skip generation of event data | Boolean\n| lastYears | Number of last years of data to include | Integer\n| interval | Duration in milliseconds between completeness checks. Default is `30000`. | Integer\n| async | Whether to block until analytics is complete. Default is `false`. | Integer\n|===\n\nIn addition to the parameters above, the resourceTables/analytics API can also use any of the link:#query-parameters[Query Parameters].\n\nAny of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelDhis2.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelDhis2.myParameterNameHere header.\n\n== Examples\n\n* Fetch an organisation unit by ID:\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.builder.RouteBuilder;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        from(\"direct:getResource\")\n            .to(\"dhis2://get/resource?path=organisationUnits/O6uvpzGd5pu\u0026username=admin\u0026password=district\u0026baseApiUrl=https://play.dhis2.org/40.2.2/api\")\n            .unmarshal()\n            .json(org.hisp.dhis.api.model.v40_2_2.OrganisationUnit.class);\n    }\n}\n\n----\n\n* Fetch an organisation unit code by ID:\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.builder.RouteBuilder;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        from(\"direct:getResource\")\n            .to(\"dhis2://get/resource?path=organisationUnits/O6uvpzGd5pu\u0026fields=code\u0026username=admin\u0026password=district\u0026baseApiUrl=https://play.dhis2.org/40.2.2/api\")\n            .unmarshal()\n            .json(org.hisp.dhis.api.model.v40_2_2.OrganisationUnit.class);\n    }\n}\n\n----\n\n* Fetch all organisation units:\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.builder.RouteBuilder;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        from(\"direct:getCollection\")\n            .to(\"dhis2://get/collection?path=organisationUnits\u0026arrayName=organisationUnits\u0026username=admin\u0026password=district\u0026baseApiUrl=https://play.dhis2.org/40.2.2/api\")\n            .split().body()\n            .convertBodyTo(org.hisp.dhis.api.model.v40_2_2.OrganisationUnit.class).log(\"${body}\");\n    }\n}\n----\n\n* Fetch all organisation unit codes:\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.builder.RouteBuilder;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        from(\"direct:getCollection\")\n            .to(\"dhis2://get/collection?path=organisationUnits\u0026fields=code\u0026arrayName=organisationUnits\u0026username=admin\u0026password=district\u0026baseApiUrl=https://play.dhis2.org/40.2.2/api\")\n            .split().body()\n            .convertBodyTo(org.hisp.dhis.api.model.v40_2_2.OrganisationUnit.class)\n            .log(\"${body}\");\n    }\n}\n----\n\n* Fetch users with a phone number:\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.builder.RouteBuilder;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        from(\"direct:getCollection\")\n            .to(\"dhis2://get/collection?path=users\u0026filter=phoneNumber:!null:\u0026arrayName=users\u0026username=admin\u0026password=district\u0026baseApiUrl=https://play.dhis2.org/40.2.2/api\")\n            .split().body()\n            .convertBodyTo(org.hisp.dhis.api.model.v40_2_2.User.class)\n            .log(\"${body}\");\n    }\n}\n----\n\n* Save a data value set\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.LoggingLevel;\nimport org.apache.camel.builder.RouteBuilder;\nimport org.hisp.dhis.api.model.v40_2_2.DataValueSet;\nimport org.hisp.dhis.api.model.v40_2_2.DataValue;\nimport org.hisp.dhis.api.model.v40_2_2.WebMessage;\nimport org.hisp.dhis.integration.sdk.support.period.PeriodBuilder;\n\nimport java.time.ZoneOffset;\nimport java.time.ZonedDateTime;\nimport java.time.format.DateTimeFormatter;\nimport java.util.Date;\nimport java.util.List;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        from(\"direct:postResource\")\n            .setBody(exchange -\u003e new DataValueSet().withCompleteDate(\n                    ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT))\n                                                                   .withOrgUnit(\"O6uvpzGd5pu\")\n                                                                   .withDataSet(\"lyLU2wR22tC\").withPeriod(PeriodBuilder.monthOf(new Date(), -1))\n                                                                   .withDataValues(\n                                                                       List.of(new DataValue().withDataElement(\"aIJZ2d2QgVV\").withValue(\"20\"))))\n            .to(\"dhis2://post/resource?path=dataValueSets\u0026username=admin\u0026password=district\u0026baseApiUrl=https://play.dhis2.org/40.2.2/api\")\n            .unmarshal().json(WebMessage.class)\n            .choice()\n            .when(exchange -\u003e !exchange.getMessage().getBody(WebMessage.class).getStatus().equals(WebMessage.StatusRef.OK))\n                .log(LoggingLevel.ERROR, \"Import error from DHIS2 while saving data value set =\u003e ${body}\")\n            .end();\n    }\n}\n----\n\n* Update an organisation unit\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.LoggingLevel;\nimport org.apache.camel.builder.RouteBuilder;\nimport org.hisp.dhis.api.model.v40_2_2.OrganisationUnit;\nimport org.hisp.dhis.api.model.v40_2_2.WebMessage;\nimport org.hisp.dhis.integration.sdk.support.period.PeriodBuilder;\n\nimport java.time.ZoneOffset;\nimport java.time.ZonedDateTime;\nimport java.time.format.DateTimeFormatter;\nimport java.util.Date;\nimport java.util.List;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        from(\"direct:putResource\")\n            .setBody(exchange -\u003e new OrganisationUnit().withName(\"Acme\").withShortName(\"Acme\").withOpeningDate(new Date()))\n            .to(\"dhis2://put/resource?path=organisationUnits/jUb8gELQApl\u0026username=admin\u0026password=district\u0026baseApiUrl=https://play.dhis2.org/40.2.2/api\")\n            .unmarshal().json(WebMessage.class)\n            .choice()\n            .when(exchange -\u003e !exchange.getMessage().getBody(WebMessage.class).getStatus().equals(WebMessage.StatusRef.OK))\n                .log(LoggingLevel.ERROR, \"Import error from DHIS2 while updating org unit =\u003e ${body}\")\n            .end();\n    }\n}\n----\n\n* Delete an organisation unit\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.LoggingLevel;\nimport org.apache.camel.builder.RouteBuilder;\nimport org.hisp.dhis.api.model.v40_2_2.WebMessage;\nimport org.hisp.dhis.integration.sdk.support.period.PeriodBuilder;\n\nimport java.time.ZoneOffset;\nimport java.time.ZonedDateTime;\nimport java.time.format.DateTimeFormatter;\nimport java.util.Date;\nimport java.util.List;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        from(\"direct:deleteResource\")\n            .to(\"dhis2://delete/resource?path=organisationUnits/jUb8gELQApl\u0026username=admin\u0026password=district\u0026baseApiUrl=https://play.dhis2.org/40.2.2/api\")\n            .unmarshal().json(WebMessage.class)\n            .choice()\n            .when(exchange -\u003e !exchange.getMessage().getBody(WebMessage.class).getStatus().equals(WebMessage.StatusRef.OK))\n                .log(LoggingLevel.ERROR, \"Import error from DHIS2 while deleting org unit =\u003e ${body}\")\n            .end();\n    }\n}\n----\n\n* Run analytics\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.builder.RouteBuilder;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        from(\"direct:resourceTablesAnalytics\")\n            .to(\"dhis2://resourceTables/analytics?skipAggregate=false\u0026skipEvents=true\u0026lastYears=1\u0026username=admin\u0026password=district\u0026baseApiUrl=https://play.dhis2.org/40.2.2/api\");\n    }\n}\n----\n\n* Reference DHIS2 client\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.builder.RouteBuilder;\nimport org.hisp.dhis.integration.sdk.Dhis2ClientBuilder;\nimport org.hisp.dhis.integration.sdk.api.Dhis2Client;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        Dhis2Client dhis2Client = Dhis2ClientBuilder.newClient(\"https://play.dhis2.org/40.2.2/api\", \"admin\", \"district\").build();\n        getCamelContext().getRegistry().bind(\"dhis2Client\", dhis2Client);\n\n        from(\"direct:resourceTablesAnalytics\")\n            .to(\"dhis2://resourceTables/analytics?skipAggregate=true\u0026skipEvents=true\u0026lastYears=1\u0026client=#dhis2Client\");\n    }\n}\n----\n\n* Set custom query parameters\n+\n[source,java]\n----\npackage org.camel.dhis2.example;\n\nimport org.apache.camel.builder.RouteBuilder;\n\nimport java.util.List;\nimport java.util.Map;\n\npublic class MyRouteBuilder extends RouteBuilder {\n\n    public void configure() {\n        from(\"direct:postResource\")\n            .setHeader(\"CamelDhis2.queryParams\", constant(Map.of(\"cacheClear\", List.of(\"true\"))))\n            .to(\"dhis2://post/resource?path=maintenance\u0026client=#dhis2Client\");\n    }\n}\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhis2%2Fcamel-dhis2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhis2%2Fcamel-dhis2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhis2%2Fcamel-dhis2/lists"}