Re: SupervisingRouterController not working as expectation (ApacheCamel:3.7.0)

2021-01-15 Thread Imran Raza Khan
@Claus Ibsen Thanks for clarification, For timer I agree as it already started so SupervisingRouterController will not take care, but for kubernetes route is failing at connection level but still SupervisingRouterController is not retrying, But SupervisingRouterController retry work for my

SupervisingRouterController not working as expectation (ApacheCamel:3.7.0)

2021-01-14 Thread Imran Raza Khan
I have quarkus application with camel route like below, its not working as expected or i may have different understanding from("timer://ipc?repeatCount=1=6") .routeId("timer-ipc") .to("kubernetes-secrets:///?kubernetesClient=#kubernetesClient=getSecret")

Re: Base64 Decoding secerets of kubernetes (Apach Camel 3.2.0)

2020-12-24 Thread Imran Raza Khan
rnetes-secrets:///?kubernetesClient=#kubernetesClient=getSecret") *.setHeader("AMQ_PASSWORD").groovy("new String( request.getBody().getData().get('amq-password').decodeBase64() )")* .to("log:my?showAll=true=true"); On Wed, May 6, 2020 at 7:17 PM Imran Raza Khan wrote: &g

Re: Simplify processor code with simple throws error - Apache Camel 3.7

2020-12-23 Thread Imran Raza Khan
Following dependency was missing org.apache.camel.quarkus camel-quarkus-bean On Wed, Dec 23, 2020 at 11:53 PM Imran Raza Khan wrote: > I am working on a code in which one processor is like > > public void process(Exchange exchange) throws Exception > { >

Simplify processor code with simple throws error - Apache Camel 3.7

2020-12-23 Thread Imran Raza Khan
I am working on a code in which one processor is like public void process(Exchange exchange) throws Exception { exchange.getIn().setHeader("AMQ_PASSWORD", exchange.getMessage().getBody(io.fabric8.kubernetes.api.model.Secret.class).getData().get("amq-password")); } I thought

setHeader not working as expected with split

2020-05-11 Thread Imran Raza Khan
I have following code, in which header is not available in main route after coming back from direct route and which is set after split from("timer://ipc?repeatCount=1=5000") .routeId("timer-ipc") .to("direct:Route1") .choice() .when( simple("${in.header.bookno} != null ") ) .to("direct:Route2")

Base64 Decoding secerets of kubernetes (Apach Camel 3.2.0)

2020-05-06 Thread Imran Raza Khan
I want to get secret from kubernetes and then want to decode it within route, Following is my example from("timer://foo?repeatCount=1=1000") .setHeader(KubernetesConstants.KUBERNETES_NAMESPACE_NAME, simple("myns")) .setHeader(KubernetesConstants.KUBERNETES_SECRET_NAME, simple("broker"))

Hoe to get camel-quarkus-syslog

2020-01-05 Thread Imran Raza Khan
I want to use camel-quarkus-syslog but its not available or i am using wrong artifcatid? org.apache.camel.quarkus camel-quarkus-syslog

Re: Camel Quarkus Example not working

2020-01-02 Thread Imran Raza Khan
Hi, Thanks, Its working now, i missed updating groupid and artifactid lines.

Camel Quarkus Example not working

2020-01-01 Thread Imran Raza Khan
I followed the instruction mentioned on https://camel.apache.org/camel-quarkus/latest/first-steps.html to run simple example, but its throwing error while running $ mvn clean compile quarkus:dev Error: [INFO] Scanning for projects... [INFO] [INFO] -<

Documentation for SupervisingRouteController

2019-11-19 Thread Imran Raza Khan
I have MQTT route like below from("paho:mytopic?brokerUrl=tcp://0.0.0.0:1883=ipc) .routeId("myroute") .to("log:my?showAll=true=true"); it starts only if broker is available and after that if it lost connectivity with broker it handle it very well and resume. But my concern is how i

Re: Environment variable not accessible if camel run in Cron Job of CentOS

2019-11-15 Thread Imran Raza Khan
Hi Zoran, Thanks for detailed answer and it was really helpful, For others i tried following options - source $HOME/.bash_profile - 0 5 * * * . $HOME/. bash_profile ; /path/to/command/to/run - set following in cron SHELL=/bin/bash But nothing works for me in centos, it look like

Environment variable not accessible if camel run in Cron Job of CentOS

2019-11-13 Thread Imran Raza Khan
I have one jar file which contain camel route to run it from cron job i created shell script public void process(Exchange exchange) throws Exception { String host = exchange.getContext().resolvePropertyPlaceholders("{{env:HOSTNAME}}"); } test.sh #!/bin/sh java -jar my.jar Now when i

Design Suggestions: Add camel consumer routes dynamically once the application context has already initialized

2019-11-05 Thread Imran Raza Khan
Consider a situation where our requirement is to listen ActiveMQ Topics and details of those Topics suppose to be evaluate on base of configuration and database keeps changing. Use Case: 1. A initial route start and call External config files and Database to evaluate topics names. 2. Add the

pollEnrich with header property from previous exchange

2019-11-04 Thread Imran Raza Khan
I want to listen on ActiveMQ topic based on the hostname of system and some other logic, So i planned to use pollEnrich for it so i evaluate my logic and provide topic name in pollEnrich but as per document *pollEnrich or enrich does not access any data from the current Exchange which means when

KubernetesClientException: java.net.ProtocolException: Unexpected status line:

2019-10-31 Thread Imran Raza Khan
I have small program with kubernetes client and its not working as expected public static void main(String[] args) throws Exception { KubernetesConfiguration kubernetesConfiguration = new KubernetesConfiguration();

Re: Micronaut and Apache Camel

2019-10-31 Thread Imran Raza Khan
@omarsmak Thanks for update but we are looking for Micronaut example as application is already developed in Micronaut. Virenfrei. www.avast.com

oauth token expire for kubernetes components

2019-10-31 Thread Imran Raza Khan
We use "oc whoami --token" to get token and use in kubernetes like below, this get expire in 24 hours how to automate this? from("direct:list") .to("kubernetes://https://localhost:8443?oauthToken==pods=listPods;) .to("mock:result")

Micronaut and Apache Camel

2019-10-31 Thread Imran Raza Khan
I am looking for working example of Apache Camel with Micronaut. Virenfrei. www.avast.com

How to set dynamic value to routeid

2019-10-08 Thread Imran Raza Khan
i tried following and its not working from("direct:test") .routeId("${body.topicName}") from("direct:test") .routeId(simple("${body.topicName}").toString()) Above both didnt work

protobuf not accepting dynamic input

2019-10-07 Thread Imran Raza Khan
I have route like below from("direct:marshal").unmarshal() .protobuf("my.dataformat.protobuf.generated.AddressBookProtos$Person") .to("mock:reverse"); Now i want to give classpath dynamically but its not accepting from("direct:marshal").unmarshal() .protobuf( simple("

Re: How to make sure JPA Consumer just call once

2019-10-07 Thread Imran Raza Khan
Hi, Thanks for suggestions its working as per expectation, but as you suggested its good to have repeatCount=1 in consumers

How to make sure JPA Consumer just call once

2019-10-07 Thread Imran Raza Khan
I am refactoring legacy project and in which i have to read table which has some meta data on the base of it i have to start activemq listeners. Now i want to read this tables only once at the start of application how i can make sure that jpa consumer just get called once

Working Example of SpringBoot+liquibase+Camel

2019-10-06 Thread Imran Raza Khan
Can anyone point me to working example of spring.liquibase.enabled=false

Re: JSONPath array length validation

2019-09-17 Thread Imran Raza Khan
i tried already, this is also throwing error, i tried with '1' also Caused by: org.apache.camel.ExpressionIllegalSyntaxException: Illegal syntax: $..books.length() > '1' at org.apache.camel.jsonpath.JsonPathExpression.init(JsonPathExpression.java:185)

JSONPath array length validation

2019-09-17 Thread Imran Raza Khan
I am parsing an json and verify array length like below from("direct:parseJson") .setHeader("numberOfBooks").jsonpath("$..books.length()", int.class) .choice() .when( simple("${header.numberOfBooks} == '1'")) .log("One book")

Re: http4 not sending exchange data further in route for kubernetes API

2019-09-15 Thread Imran Raza Khan
@Andrea please find code on below link to test that http4 dont support processing chunk data https://github.com/imranrazakhan/KubernetesConfigMapWatcher it look like http4 dont support reading of chunked data until it receive all data, but in my case i want to receive/process data chunk by

Re: http4 not sending exchange data further in route for kubernetes API

2019-09-14 Thread Imran Raza Khan
@ Jan Bednář i have no issue with chunk data or close connection, As you can see from debug logs that i am receiving all chunks of data, but http4 endpoint is not forwarding further in route due to which i cant

Re: http4 not sending exchange data further in route for kubernetes API

2019-09-14 Thread Imran Raza Khan
Please find below issue for improvement https://issues.apache.org/jira/browse/CAMEL-13978 Although i provided source code and debug trace of my route, i will still try to provide you github project

Re: http4 not sending exchange data further in route for kubernetes API

2019-09-14 Thread Imran Raza Khan
Till the time you are working on enhancement can i use http4 component to listen for configmap events? i require to read chunk data in route, its working fine with curl command where i save output in file and monitor changes on file, but i am looking for pure camel solution.

Re: http4 not sending exchange data further in route for kubernetes API

2019-09-14 Thread Imran Raza Khan
Please point me to kubernetes event example i tried to search but couldn't find it. On separate note can we read chunk data in route?

http4 not sending exchange data further in route for kubernetes API

2019-09-14 Thread Imran Raza Khan
I am using [kubernetes rest api][1] API to watch configmap and calling it with http4 component, but http4 is not forwarding exchange further in route, from logs i observed that http4 keep getting updates from openshift on first open connection as its not closing connection so dont forward exchange

unable to find valid certification path to requested target error in kubernetes component

2019-09-13 Thread Imran Raza Khan
i am getting security error although i am providing oauthtoken in kubernetes component from("timer://foo?fixedRate=true=5000") .setHeader(KubernetesConstants.KUBERNETES_NAMESPACE_NAME, simple("default")) .setHeader(KubernetesConstants.KUBERNETES_CONFIGMAP_NAME,

Restart POD on ConfigMap Change with kubernetes Component

2019-09-12 Thread Imran Raza Khan
I am looking for option to restart pods if configmap get change, but i was not able to find trigger for it, please point me in the right direction, example would be look like from(to("kubernetes-config-maps:///?kubernetesClient=#kubernetesClient=getConfigMapEvents") .toF("kubernetes-pods://

MQTT and Protobuf Route Test issue in Apache Camel 2.24.1

2019-07-16 Thread Imran Raza Khan
i have develop a route like below with test public class ShutdownPC extends RouteBuilder { @Override public void configure() throws Exception { from("mqtt:UpsStatus?host=tcp://1.1.1.1:1883 =x=x=ups_status") .unmarshal()

Re: Design: State Machine implementation in Apache Camel

2018-01-11 Thread Imran Raza Khan
I have change a design like below I already have multiple camel sub routes which perform different actions, now my requirement was to align those sub routes in one flow for order fulfillment. 1- For every new product i knew which sub routes suppose to be execute and in which sequence, so i will

Re: Design: State Machine implementation in Apache Camel

2018-01-10 Thread Imran Raza Khan
Hi Steve, Thanks for detail reply. - I will evaluate StatefulJ if it fits into my requirements. >> With Camel, I prefer to route a message, and then hand off the work as fast as possible, and then free up the routing to handle more messages. To separate concerns, if the action being performed

Design: State Machine implementation in Apache Camel

2018-01-09 Thread Imran Raza Khan
I design pseudo implementation of state machine in Apache camel like below, Please comment/suggest to improve design Table Contains State: (Would be populate in HashMap at start of Application) "STATE", "NEXT_STATE", "STATE_RESULT", "CamelRoute" 1 , 2 ,

Health not working with CXF and SpringBoot

2018-01-05 Thread Imran Raza Khan
Hi, I want to extend below Camel-CXF and SpringBoot example to provide health status on /health, i tried adding org.springframework.boot spring-boot-starter-actuator But no success, any suggestion?

Unknown parameters=[{myConfig=myconfig}] error while creating custom component - CiA-2 - Chapter 8

2017-11-27 Thread Imran Raza Khan
Hi, While creating custom component i want to pass one object as parameter, but i am getting following error org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[mycomponent://foo?param1=value1=myconfig] <<< due to:

Why UriEndpointComponent is deprecated

2017-11-21 Thread Imran Raza Khan
HI, I was developing custom component and i found that UriEndpointComponent is deprecated, please confirm its deprecated and whats alternative to it? public class MyComponent extends UriEndpointComponent

AWS-S3 - Not all bytes were read from the S3ObjectInputStream, aborting HTTP connection(Apache Camel 2.20.0)

2017-11-15 Thread Imran Raza Khan
Hi, After reading all files from bucket i observed following repeated error, Any way to avoid it from("aws-s3://mybucket?amazonS3Client=#awss3Client=false=folder").to("stream:out") 2017-11-16 00:58:21 [Camel - aws-s3://mybucket] WARN c.a.s.s.i.S3AbortableInputStream - Not all bytes were read

API Management Products Support in Apache Camel

2017-10-11 Thread Imran Raza Khan
Do Apache Camel support products like Red Hat 3Scale, Apigee or WSO2 Api Management?

Design: Caching JPA Entities in Apache Camel

2017-10-07 Thread Imran Raza Khan
I have currently project to which i planning to migrate to Apache camel. It exposes API to inquire for different Inventory stored in DB. These Inventory model doesn't change frequently and new Inventory got update once in two months. Currently at start of Application i load all