apache-camel

How to define exception to be thrown through ref in Apache Camel

耗尽温柔 提交于 2021-01-21 12:13:29
问题 Have to throw an exception in my camel route defined in XML. Found throwException statement available from Camel 2.3 which looks like: <throwException ref="forced"></throwException> However, I don't know how to define forced exception class to be thrown. Since same exception could be thrown couple of times with different exception messages - would be good to know if throwException has some other form of definition so exception class and exception message are defined in-place. 回答1: The ref is

How to define exception to be thrown through ref in Apache Camel

瘦欲@ 提交于 2021-01-21 12:10:29
问题 Have to throw an exception in my camel route defined in XML. Found throwException statement available from Camel 2.3 which looks like: <throwException ref="forced"></throwException> However, I don't know how to define forced exception class to be thrown. Since same exception could be thrown couple of times with different exception messages - would be good to know if throwException has some other form of definition so exception class and exception message are defined in-place. 回答1: The ref is

Send Apache Camel Actuator Metrics to Prometheus

旧时模样 提交于 2021-01-21 10:38:04
问题 I am trying to forward/add the Actuator Camel metrics from /actuator/camelroutes (route metrics like number of exchanges/transactions) to the Prometheus Actuator endpoint. Is there a way for me to configure Camel to add those metrics to the PrometheusMeterRegistry? I have tried adding: camel.component.metrics.metric-registry=io.micrometer.prometheus.PrometheusMeterRegistry in my application.properties according to the documentation here: https://camel.apache.org/components/latest/metrics

Camel Context Not Listed in Hawtio JMX At All

谁都会走 提交于 2021-01-16 01:07:06
问题 I have deployed three example apache camel examples into tomcat: /camel-example-activemq-tomcat-3.5.0-SNAPSHOT /camel-example-cxf-tomcat-3.5.0-SNAPSHOT /camel-example-servlet-tomcat-3.5.0-SNAPSHOT They're all up and running OK. One of them uses ActiveMQ and I can see the queues from Hawtio. However, under JMX, the Camel Context is not listed/discovered. Refreshing the page changes nothing. Executing mBeanServersInfo() (full path Code>http://localhost:8080/hawtio-default-2.10.0/jolokia/exec

Camel Context Not Listed in Hawtio JMX At All

安稳与你 提交于 2021-01-16 01:05:27
问题 I have deployed three example apache camel examples into tomcat: /camel-example-activemq-tomcat-3.5.0-SNAPSHOT /camel-example-cxf-tomcat-3.5.0-SNAPSHOT /camel-example-servlet-tomcat-3.5.0-SNAPSHOT They're all up and running OK. One of them uses ActiveMQ and I can see the queues from Hawtio. However, under JMX, the Camel Context is not listed/discovered. Refreshing the page changes nothing. Executing mBeanServersInfo() (full path Code>http://localhost:8080/hawtio-default-2.10.0/jolokia/exec

Sending multiple http requests with Apache Camel

送分小仙女□ 提交于 2021-01-07 01:37:12
问题 I am trying to send GET HTTP requests to a paginated endpoint. The challenge is I do not know the page size beforehand therefore I have to send a request to get page number and interate till the end. I have tried Camel HTTP but I was not able to make it send dynamic requests based on first (or previous) response. I am currently testing recipientList to generate HTTP URLs by sending the first request and use the simple method as processor. Since Camel is really new for me, I am not sure if

Sending multiple http requests with Apache Camel

╄→гoц情女王★ 提交于 2021-01-07 01:30:52
问题 I am trying to send GET HTTP requests to a paginated endpoint. The challenge is I do not know the page size beforehand therefore I have to send a request to get page number and interate till the end. I have tried Camel HTTP but I was not able to make it send dynamic requests based on first (or previous) response. I am currently testing recipientList to generate HTTP URLs by sending the first request and use the simple method as processor. Since Camel is really new for me, I am not sure if

Apache Camel: How to pass values from configure method to from() & to() components? — [RESOLVED]

谁都会走 提交于 2020-12-15 00:50:58
问题 I have a scenario where I have to read a file from the location on certain interval, extract the file name & file path, hit 2 rest services which is a Get & Post call using those inputs & place the file in appropriate location. I have managed a pseudo code as follows. Wanted to know if there's a better way of achieving this using Camel. Appreciate your help! The flow is - Extract the fileName Hit a Get endpoint ('getAPIDetails') using that fileName as an input to check if that fileName exists

Apache Camel: How to pass values from configure method to from() & to() components? — [RESOLVED]

自古美人都是妖i 提交于 2020-12-15 00:50:34
问题 I have a scenario where I have to read a file from the location on certain interval, extract the file name & file path, hit 2 rest services which is a Get & Post call using those inputs & place the file in appropriate location. I have managed a pseudo code as follows. Wanted to know if there's a better way of achieving this using Camel. Appreciate your help! The flow is - Extract the fileName Hit a Get endpoint ('getAPIDetails') using that fileName as an input to check if that fileName exists

Apache Camel: How to pass values from configure method to from() & to() components? — [RESOLVED]

本秂侑毒 提交于 2020-12-15 00:47:12
问题 I have a scenario where I have to read a file from the location on certain interval, extract the file name & file path, hit 2 rest services which is a Get & Post call using those inputs & place the file in appropriate location. I have managed a pseudo code as follows. Wanted to know if there's a better way of achieving this using Camel. Appreciate your help! The flow is - Extract the fileName Hit a Get endpoint ('getAPIDetails') using that fileName as an input to check if that fileName exists