This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit dd4fa327fddb1ea8a7e5b8af6d21a889d2026733 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Fri Sep 20 15:05:58 2019 +0200 Camel-Kubernetes: Adding some docs for Kubernetes configmap consumer --- .../main/docs/kubernetes-config-maps-component.adoc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-config-maps-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-config-maps-component.adoc index e4069a3..89f8c4f 100644 --- a/components/camel-kubernetes/src/main/docs/kubernetes-config-maps-component.adoc +++ b/components/camel-kubernetes/src/main/docs/kubernetes-config-maps-component.adoc @@ -142,3 +142,21 @@ from("direct:listByLabels").process(new Processor() { This operation return a List of ConfigMaps from your cluster, using a label selector (with key1 and key2, with value value1 and value2) +== Kubernetes ConfigMaps Consumer Example + +[source,java] +-------------------------------------------------------------------------------- +fromF("kubernetes-config-maps://%s?oauthToken=%s&namespace=default&resourceName=test", host, authToken).process(new KubernertesProcessor()).to("mock:result"); + + public class KubernertesProcessor implements Processor { + @Override + public void process(Exchange exchange) throws Exception { + Message in = exchange.getIn(); + ConfigMap cm = exchange.getIn().getBody(ConfigMap.class); + log.info("Got event with configmap name: " + cm.getMetadata().getName() + " and action " + in.getHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION)); + } + } +-------------------------------------------------------------------------------- + +This consumer will return a list of events on the namespace default for the config map test. +