apache-camel

How to call a third party webservice using Apache camel using cxf componnet

安稳与你 提交于 2020-01-14 13:14:32
问题 I went through the example on Apache camel website and camel in action and both focus heavily on exposing a webservice. The only example I found online does not work. I am trying to access a third party webservice wsdl - http://www.webservicex.net/CurrencyConvertor.asmx?WSDL This service has a operation/method that calculates the currency rate. The operation name is "ConversionRate". I defined the route like this - <?xml version="1.0" encoding="UTF-8"?> <!-- Configures the Camel Context-->

stored procedure invokation through camel sql-stored component

跟風遠走 提交于 2020-01-14 04:04:07
问题 I am new to camel sql-stored component. Currently I am using Camel 2.17.5. And I am trying to invoke oracle stored procedure from camel route. This is my route: <setHeader headerName="test"> <simple>John</simple> </setHeader> <log loggingLevel="INFO" message="value: ${headers.test}" /> <to uri="sql-stored:HELLO(VARCHAR ${headers.test},OUT VARCHAR outparam1)?dataSource=oracleDataSource"/> <log loggingLevel="INFO" message="SP result: ${body}" /> This is my stored procedure: CREATE OR REPLACE

how to set id of camel processor or other route ingredients

不问归期 提交于 2020-01-14 00:17:07
问题 Camel automatically generates id for processors and other stuff (processor1..processor25). Is there a way to set this name? We need to identify certain processors via jmx to get telemetry data. The names I want to set are given via properties - they are known on start time. So I need to set them when route is defined or within the processor (name is given via processors constructor, the string is also used for processing). Update Example: for a route from("some:where").process(myProcessor).to

read all mails from gmail inbox using apache camel

穿精又带淫゛_ 提交于 2020-01-13 18:08:24
问题 I am trying to read all mails from google mail (Gmail - imaps) account and download its attachments but I am only able to get one unread mail and its attachments. Posting my code snippet. // Download function public void download() throws Exception { PollingConsumer pollingConsumer = null; CamelContext context = new DefaultCamelContext(); Endpoint endpoint = context.getEndpoint("imaps://imap.gmail.com?username=" + mailId + "&password=" + password + "&delete=false&peek=false&unseen=true

read all mails from gmail inbox using apache camel

删除回忆录丶 提交于 2020-01-13 18:08:21
问题 I am trying to read all mails from google mail (Gmail - imaps) account and download its attachments but I am only able to get one unread mail and its attachments. Posting my code snippet. // Download function public void download() throws Exception { PollingConsumer pollingConsumer = null; CamelContext context = new DefaultCamelContext(); Endpoint endpoint = context.getEndpoint("imaps://imap.gmail.com?username=" + mailId + "&password=" + password + "&delete=false&peek=false&unseen=true

Logging camel exceptions and sending to the dead letter channel

不羁岁月 提交于 2020-01-13 09:43:30
问题 I have a Camel route, running within Karaf, for which I've added a Dead Letter Channel. This is to handle cases where the route fails and I want to keep the problem message and log the cause. I can't throw the exception back to the calling application as I'm handling some processing asynchronously. From reading the documentation and trying a number of cases, it's not clear to me how to both log the exception into Karaf's log and deposit the original message onto the dead letter queue. Here's

Java Camel framework: Losing message body in processor

假如想象 提交于 2020-01-13 05:44:10
问题 All, Here's a simple route: <route> <from uri="jetty://http://0.0.0.0:9090/myproject" /> <setExchangePattern pattern="InOnly" /> <process ref="JsonValidator"/> <unmarshal> <json library="Jackson" unmarshalTypeName="com.myproject.JsonPojo"/> </unmarshal> ... </route> JsonValidator is a simple Java bean where I extend processor. Here, I want to make sure all the required fields are being passed in before I continue to the unmarshal call using Jackson to unmarshal the JSON to my POJO. All I'm

Apache Camel enrich message with file content on request

我只是一个虾纸丫 提交于 2020-01-12 05:36:08
问题 I'm implementing RESTful service (using CXFRS component) which should return files for some requests. Each file is fetched by its id and extension, i.e. restfulservice.com/path/file/1/pdf . Each file once added never changes. Files should not be moved or deleted after fetching and generally they should be accessible concurrently. Here is part of my Camel context: from("direct:fetchFile") .process(fetchFileProcessor) // set file.id & file.extension .bean(fileService, "fetchFile(${header.file

Redhat Fuse updated features repo list?

冷暖自知 提交于 2020-01-11 14:17:28
问题 I have Red Hat Fuse and AMQ running in a docker. The Fuse and AMQ are baked into the docker from a directory, with shared volumes. They're not being downloaded. The version is v7.0 or v7.1. I have been away for about 3 weeks and the JVM crashed for some reason. I rebuilt the docker for good measure and started it up, and our services are failing now. From what I can tell, the issue is that the feature:repo-list has updated itself. ( It has broken production, and people are freaking out. ) Is

How do dynamic “from” endpoints and exchanges work in camel?

坚强是说给别人听的谎言 提交于 2020-01-11 07:24:08
问题 I'm sort of struggling with the dynamic routing concept and consumer rules. So let's say I have a route with exchange data, and then I want to use a header from the exchange in a different route in the "from" endpoint. I think it would look something like this: Route 1: from("file:/dir1") ... .to ("direct:start"); Route 2: from("direct: start")//get the old exchange data .from("file:/dir1/?fileName=${header.myHeader}")//start consuming from a different endpoint using old exchange data ... .to