apache-camel

Camel route to filter out the auto response emails

ε祈祈猫儿з 提交于 2019-12-07 15:13:32
I am using camel rout to consume the emails from my inbox folder. But I want to filter out the auto responded emails like out of offices etc. I see there is a option for to process only unread messages by using option unseen=true . The URI that I am using to consume the emails looks like: pop3://username@host?password=password;delete=true&unseen=true&consumer.delay=60000 I think what you're looking for is the searchTerm property to add to your endpoint URI. If you want to filter out e-mails with the term Out Of Office in them, your endpoint URI might look like this: pop3://username@host.com

Apache Camel maven dependency issue with BundleContextAware and BundleContext

会有一股神秘感。 提交于 2019-12-07 14:01:16
问题 I'm trying to configure Apache Camel in Spring in the Java config way as detailed in this example. However I'm stuck at the dependency step because BundleContextAware and (transitively) BundleContext cannot be resolved. It seems that the necessary transitive dependencies are not downloaded. Here is my pom.xml: <properties> <apache.camel.version>2.9.0</apache.camel.version> </properties> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>${apache

How to use apache camel to read data from mysql table and write into another table

爱⌒轻易说出口 提交于 2019-12-07 12:16:08
问题 Guys I am using Apache Camel to read data from mysql table. I am successfully printing it on console. But according to my requirement I need to read the data from one mysql database, then filter it by using some condition and then insert the filtered data in another mysql database table. I am posting my code below.. public class camelJdbc { public static void main(String[] args) throws Exception { final String url = "jdbc:mysql://localhost:3306/emp"; final String url1 = "jdbc:mysql:/

Alternative to deprecated XmlJsonDataFormat in Apache Camel

醉酒当歌 提交于 2019-12-07 11:58:34
问题 In Apache Camel, I was trying to use XmlJsonDataFormat to do a quick conversion from XML to JSON. However the XMLJSON (http://camel.apache.org/xmljson.html) has deprecated so I am not sure what is the best way to do that conversion aside from creating a processor. Does anyone know of an alternative to XmlJsonDataFormat? 回答1: After some tries, I have managed to get what I need by combining Jaxb and Jackson for unmarshal XML to POJO and then POJO to JSON. As noMad pointed out, I could have

Apache Camel/ActiveMQ priority route

醉酒当歌 提交于 2019-12-07 11:56:48
问题 I have two AMQ queues that have the same consumers. The first queue (Q1) handles 97% of the messages and the other (Q2) only 3%. Problem is that messages in Q2 need to process messages as soon as they are queued. So my problem is that when a message is available in Q2 I need somehow to suspend the first route to take it's consumers. The apache camel routing looks like this: <route id="q1"> <from uri="jms:recordAnalysisRequests" /> <to uri="bean:analysisService" /> </route> <route id="q2">

Camel JAX-RS and Cross Domain Request

╄→гoц情女王★ 提交于 2019-12-07 11:53:42
问题 I'd like to be able to do HTTP requests on my localhost Camel instance (just for development purpose, I know this is bad practice). For now, I'm stuck with : Origin http://localhost:8000 is not allowed by Access-Control-Allow-Origin. I've search how can I tell Camel to allow such requests, but didn't find an answer. I'm using camel-cxf and the rsServer to create my endpoint. I've got an endpoint looking like that : public class LoginEndpoint { @GET @Path(LOGIN) @Produces(MediaType.APPLICATION

Camel - Stop route when the consuming directory not exists

南笙酒味 提交于 2019-12-07 10:31:10
问题 I've an SFTP route (in Spring XML), and its from path ends in a daily changing directory (ie. /yyyyMMdd), and everything is working well when autoCreate=true or the directory exists when the route starts. But it is not permitted to me to create the directory if not exists! When the dir exists, the route get files and terminates itself. When the dir not exists, the route is polling permanently with a warning (ie. org.apache.camel.component.file.GenericFileOperationFailedException: Cannot

Component camel-jsonpath gives error after adding to pom file

喜你入骨 提交于 2019-12-07 10:12:25
问题 In a clean Camel project I add the following dependency: <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jsonpath</artifactId> <version>2.16.1</version> </dependency> When I run the project I get the below error. If I remove that dependency it works. I have tried this on two different projects and the same happens. Anything else that has to be added to the pom for jsonpath to work? It seems to complain for ASM? [INFO] Using org.apache.camel.test.blueprint.Main to initiate a

Unmarshal JSON to Map/List of Strings

与世无争的帅哥 提交于 2019-12-07 09:42:34
问题 I would like to unmarshal a Json to a Map/List of Strings (eg Map>...) Here is my input: {"pointsOfSale": {"pointOfSale":[ {"href":"\/pointsOfSale\/UUID.0abc2aca-7930-4c9e-9f38-8af3d0692e04", "model":{"href":"\/models\/modelePointOfSale", "modelType":{"href":"\/modelTypes\/pointOfSale"}}, "source":{"href":"\/sources\/TEST"}, "attribute":[ {"code":"pointOfSalePhysical","value":true}, {"code":"mail","value":"Mail1"}, {"code":"adresse","value":"address1"}]}, {"href":"\/pointsOfSale\/UUID

Camel SFTP - Cannot change directory to '/'

一曲冷凌霜 提交于 2019-12-07 09:40:04
问题 I need to connect via SFTP to a server and I receive this error: INFO [org.apache.camel.component.file.remote.SftpOperations.connect]: **Connected to sftp://myserver.com:22** INFO [org.apache.camel.component.file.remote.RemoteFileProducer.connectIfNecessary]: **Connected and logged in to: Endpoint[sftp://myserver.com:22//home/tomcat/directory?password=******] INFO [org.apache.camel.component.file.remote.SftpOperations$JSchLogger.log]: JSCH -> **Caught an exception, leaving main loop due to