I'm trying to get a camel route integrated with aws cloud watch. My current route looks like this:
from("direct:cloudwatch")
.setHeader("CamelAwsCwMetricDimensionName", constant(cloudwatchDimensionName))
.setHeader("CamelAwsCwMetricDimensions", constant(cloudwatchDimensionValue))
.to("aws-cw://rcg/aws-cw?accessKey=XXX&secretKey=XXX" +
"&name={{cloudwatch.metric.name}}" +
"&value={{cloudwatch.metric.value}}" +
"&unit={{cloudwatch.metric.unit}}");
However, I'm getting an "java.lang.IllegalArgumentException: AmazonCwClient must be specified" exception.
The official page (http://camel.apache.org/aws-cw.html) doesn't have a lot of current examples (new AmazonCloudWatchClient(awsCredentials, clientConfiguration) is deprecated.
Does anyone have any examples on how to get this working? Do I need to load/add the cloud watch client into the camel context?
Thank you.
Related
Apache camel has added camel developer console in their latest release(3.15.0)
I was trying it but after adding dependencies and 'camel.main.dev-console-enabled = true' , I am not able to find the developer console I had tried with endpoint http://localhost:8080/dev
Also I am not able to enable dev console when I am using Camel Context wrote in XML DSL.
How can i add statement to enable developer console when i have camel context written in XML DSL
It is actually a very new feature, for now, the developer console is only available from http://localhost:8080/dev when you use Camel JBang as mentioned in the documentation.
For other modes, you can enable it programmatically by calling context.setDevConsole(true) or in case of Camel Main by setting camel.main.dev-console-enabled to true (as you mentioned) but it is not yet exposed, it can only be accessed programmatically from the DevConsoleRegistry (accessible with context.getExtension(DevConsoleRegistry.class)).
I have a Camel K application which contains multiple routes(each route is a Java file). my goal is to manage the routes status, for instance start certain routes and stop other running routes.
Currently I start and close the routes manually using kamel run XXX.java --pod-template pod_template.yaml --property=file:logging.properties ..., I am wondering what is the best way to achieve managing routes status via API?
My goal is achieving below using API:
start a route
stop a route
list available routes
I have asked the question under apache/camel-k but still confused about the Integration CRD mentioned in the answer.
I have found that Camel K has API Camel K API unfortunately I haven't figure out how to call the APIs if it is possible?
Can someone share knowledge and help me on this? Thanks!
You an use the kamel CLI to start and list the Integrations available, ie:
$ kamel run Sample.java
Integration "sample" created
$ kamel get
NAME PHASE KIT
sample Running default/kit-c82emh1c11s7ki7ijq0g
The above will use Kubernetes Custom Resource to create an Integration and list the Integration accordingly
There is no direct way to pause/stop/resume a route. The best thing I can suggest is to have a route per Integration and stop it via kamel delete CLI or equivalent Kubernetes API
I use Apache Camel 2.20x.
A camel component can be developed with a uri scheme for example "sample-component". Now the Endpoint of this component can actually extend an existing Endpoint say SQL which has uri syntax as "sql:<select query">.
Now I am listening to camel Exchange event (ExchangeSentEvent) When I retrive the uri from the event I get "sql:<select query">. But what I want is to get "sample-component". How can we achieve that. In simple terms following is the ask
How can we get all Endpoint uri schemes for a camel component.
Thanks in advance
Gk
ComponentName+Endpoint . You can see all the uri that the component will take. All camel components are named this way.There may be exceptions. also if u use intellij idea apache camel plugin it show .
examples
HttpEndpoint
TimerEndpoint
SedaEndpoint
DirectEndpoint
You can also find the consumer and producer classes of these components as follows.
HtppProducer if support HttpConsumer ..
I was trying to intercept from/to specific rabbitmq route something like the following,
interceptFrom(rabbitmq:localhost/someExchangeName?queue="somerRabbitMqQueueName").to("log:hello");
and i'm not getting anything there.
I've tested
intercept().to("log:hello") and i can confirm it's working, can anyone let me know if there's something else that i need to configure to make the intercept from/to works?
We're using Java DSL and Google Guice for dependency injection.
Some of the project setup as follows,
camel version: 2.18.3 (tried also 2.19.1)
camel-guice: 2.18.3
guice-multibindings: 4.1.0
camel-rabbitmq: 2.18.3
maven-compiler-plugin: 1.7
This was also asked on the Camel mailing list.
Make sure it can match the actual url, so make sure they are exact the
same if you are not using wildcard (*), you can just do
interceptFrom("rabbitmq:localhost/xxx*")
Or try with
interceptFrom("rabbitmq:localhost/xxx?queue=foo*")
See also the Camel documentation, and about the wildcard pattern (in the bottom of the page): http://camel.apache.org/intercept
When I got an error inside an Endpoint URI the camel context wont start.
It seems like Camel validates in a first step every Endpoint URI before starting the context.
Can someone pleas tell me, how this works?
Am I right?
I cant figure it out.
Yes Camel validates that it has been configured correctly when it startup. This happens as part of starting the Camel routes.
Its like misconfiguring any other software which will report an error for you to fix.
There is some tooling which you can use to validate your source code to find endpoints that has been misconfigured. I wrote a blog entry about this: http://www.davsclaus.com/2016/01/cheers-fabric8-camel-maven-plugin-to.html