apache-camel

Apache Camel - How to set a private key in a dinamic sftp endpoint

◇◆丶佛笑我妖孽 提交于 2019-12-13 03:34:56
问题 Using Java DSL, I have a route in which I poll a file in an SFTP server using the file name set in the message headers from("direct:download") .pollEnrich() .simple("sftp://my.host:22/folder/?username=foo&fileName=${header.CamelFileName}") .to("file://state/downloaded"); The sftp endpoint needs to have set a private key. Usually something like this suffices: endpoint("sftp://my.host:22/folder/?username=foo&fileName=my_file_explicitly_written_here", SftpEndpoint.class).getConfiguration()

Activemq concurrency fail in Apache camel route

醉酒当歌 提交于 2019-12-13 03:34:21
问题 Trying to send multiple requests at same instant to camel activemq route, one request is serviced and the other request is not serviced and sent back as it is. The Jms messages are set with JMScorrelationId too before sending like below textMessage.setJMSCorrelationID(UUID.randomUUID().toString()); below is my activemq route from("activemq:queue:TEST_QUEUE?disableReplyTo=true") .setExchangePattern(ExchangePattern.InOut) .process(new Processor() { public void process(Exchange e) throws

How to set two RabbitMQ connections for the same Camel RouteBuilder configure method

为君一笑 提交于 2019-12-13 03:16:01
问题 I want listen FROM rabbit queue, process, and post message TO another rabbit queue. I'm not working with spring. The messages are duplicated in this configuration. This is a short code: context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("rabbitmq://localhost/B?autoDelete=false&queue=worker&threadPoolSize=1&autoAck=false"). log(LoggingLevel.INFO, "Message ${id}"). to("rabbitmq://localhost/B?autoDelete=false&queue=processed"); } }); I have tried

How to call a bean after all files has been processed?

本小妞迷上赌 提交于 2019-12-13 02:56:51
问题 I wrote the following route and expected that the bean 'teaserService' should be called only one time, at the end of processing of all files, but ... it's called after processing of each file: <route id="teaserInterface"> <from uri="file://{{teaser.dropInDir}}?readLock=changed&delete=true&delay=60000" /> <choice> <when> <simple>${file:ext} == 'properties'</simple> <to uri="file://{{teaser.config.directory}}" /> </when> <when> <simple>${file:ext} == 'jpg' || ${file:ext} == 'JPG'</simple> <to

Camel custom PropertiesComponent

南笙酒味 提交于 2019-12-13 02:49:43
问题 I'm trying to configure a custom PropertiesComponent for my CamelContexts via Spring. According to this page, I simply need to add a bean definition of type org.apache.camel.component.properties.PropertiesComponent . However, my CamelContext isn't picking it and I can't seem to find a way to reference the bean from within the CamelContext. I just keep getting the following error: PropertiesComponent with name properties must be defined in CamelContext to support property placeholders. How can

Apache camel multicast FreeMarker

為{幸葍}努か 提交于 2019-12-13 02:25:30
问题 I need to send two different XMLs (by FreeMarker) to two different endpoints. i.e. .to("freemarker:templates/xml1.ftl").to("file://C:\\testXmls1") and .to("freemarker:templates/xml2.ftl").to("file://C:\\testXmls2") I had a look at the multicast() function but I don't know how to apply it when there are two .to Could anyone please help me? 回答1: Yes you can specify multiple endpoints in the same .to(uri1, uri2, ...) then it becomes as a single "eip". multicast() .to(uri1a, uri1b) .to(uri2a,

Apache Camel AMQP - ActiveMQ AMQP header mismatch value 1, expecting 0

核能气质少年 提交于 2019-12-13 02:24:05
问题 I am attempting to make an Apache Camel application that integrates with ActiveMQ over AMQP. I have been working from the provided ' camel-example-spring-jms ' project, which is over the standard TCP connection, but I have modified to use my standalone ActiveMQ 5.8 installation (rather than embedded), which I have working fine using TCP. Active MQ Configuration ( amqp on 5672 ) <transportConnectors> <transportConnector name="openwire" uri="tcp://0.0.0.0:61610?maximumConnections=1000

Setting REST response body in camel

风流意气都作罢 提交于 2019-12-13 02:04:35
问题 Here is the flow I'm trying to setup in Camel: GET /product/foo --> MULTICAST [HTTP URI 1, HTTP URI 2, HTTP URI 3] --> AGGREGATE --> return aggregated value to HTTP response body I've setup the route this way, BUT I get no data back in the response to the original GET. How can I get the value returned by the aggregator ? @Override public void configure() throws Exception { restConfiguration() .host("localhost") .port("8081") .component("jetty"); from("rest:get:product/foo") .multicast()

Import module into xquery with apache camel transformer EIP

坚强是说给别人听的谎言 提交于 2019-12-13 01:29:33
问题 I have a camel route which is pretty simple, except for the used xquery which is why I extracted it into a separate file. In my camel route I call the xquery with the Transformer EIP: .transform().xquery("resource:classpath:xquery/myCoolXQuery.xquery",String.class) The XQuery itself works fine, but because of some functional changes I now want to import another XQuery module which I want to use as a "library" with some helping functions, because I have lots of XQuery-Files which could use

Camel runtime timer change

会有一股神秘感。 提交于 2019-12-13 00:35:20
问题 I have a question about camel and timers. I have several timers and one of them I want update in runtime. I'm using osgi blueprint to configure proper periods. So how can I change timer(with name which I know) for example from route? 回答1: You can add a bean to your route that implements org.apache.camel.CamelContextAware. Camel will inject a reference to the context on start-up. Using the context you can get a reference of the timer/quartz endpoint and update its configuration. What I don't