apache-camel

How to properly stop camelContext from being killed in a standalone application

泄露秘密 提交于 2019-12-08 12:23:05
问题 To create a Camel application which consumes from ActiveMQ's queue, I wrote a standalone Camel application following this tutorial: http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html The difference was The Main class from camel-spring used instead of camel-core: My Main class: try { Main main = new Main(); main.setApplicationContextUri("conf/spring-context.xml"); main.run(); } catch (Exception ex) { LOGGER.error(String.format(DifClientConstants.ERROR_START_CLIENT,

How to start camel even if the MQTT server is not reachable

风格不统一 提交于 2019-12-08 11:40:35
问题 I would like to make my Apache Camel application to be more resilient and start even when the MQTT broker is not reachable. We are using Camel on IoT devices with a possibly unstable internet connection and I want our application to start even without internet access. An exemplary route looks like the following: from("timer:heartbeat?period=5000") .routeId("send heartbeat") .setBody(simple("Hello World!")) .to("paho:myhostnome/heartbeat?brokerUrl={{broker.url}}") This works fine as long as

Servicemix Camel Activiti Integration and H2 Database configuration

北战南征 提交于 2019-12-08 11:39:36
问题 I have configured Activiti on Servicemix 5.1.1 and got it working with Camel. I need to configure Activiti to use SQL Server instead of the default inbuilt H2 which comes with servicemix for Activiti during feature installation. I am not finding any config files related to activiti to change the DB credentials either. Any help on how to configure the Activiti DB with Servicemix is highly appreciated. 回答1: There's no easy way to configuring another database at the moment. The solution would be

HawtIO + Camel plugin - Multiple context not showing up - Limits to max3

半腔热情 提交于 2019-12-08 10:34:27
问题 Our application is enterprise application which contains multiple web application. Each web application contains one or more camel context. Recently we are exploring the option of using HawtIO for monitoring and administrative purposes. We are using camel (fuse) version - 2.12.0.redhat-610379 with Wildfly 8.1 (Dev env -prod being WAS8.5). I have tried with HawtIO web app version ranging from 1.4.10 to 14 and with no-slf4j version as well. But HawtIO is showing maximum 3 camelcontext only. I

Camel Restlet -How to expose service using SSL

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 10:19:40
问题 I'm exposing few REST services using the latest Apache Camel (2.14), more precisely using the Restlet Component (http://camel.apache.org/restlet.html). Is there a way to expose the services under HTTPS ? I cannot find any documentation explaining how to set the SSL keystore, keystore password, etc... 回答1: Current camel-restlet doesn't support set the SSLContext information, I just fill a JIRA for it. 来源: https://stackoverflow.com/questions/26503762/camel-restlet-how-to-expose-service-using

Right way to test my object in Camel

空扰寡人 提交于 2019-12-08 09:50:15
问题 I'm trying to set up a test for a Camel route. My test route reads a binary file and sends it to a translator bean, returning a POJO. Now, I'd like to do some assertions on the POJO to ensure the values that are there match the known values. Standard stuff I think. In the examples I've seen, the body seems to always be a String or primitive type, and a simple assertion can be done on it. However, in my case, it is an object, so I want to get the object somehow. Here's what I've tried so far:

File component(Apache camel) delete=true parameter not working in windows

不羁岁月 提交于 2019-12-08 09:12:27
问题 The Apache Camel File component not working properly in Windows7, where as its working in Linux without any Problem. My Requirement: After the file processing, the files must be deleted from the Directory. In Windows, because of .camelLock the files are not deleting properly. After Multiple attempts, then only Apache camel can delete the file from the Directory. If the attemt failed to delete the file from the Directory then its throwing an exception. If I have only a File in the Directory,

Is there a while loop in Camel?

空扰寡人 提交于 2019-12-08 09:08:54
问题 Is there an idea of a while loop in Camel? We are using Camel for doing batch processing (not really the remit of an ESB I know). I want to keep checking on the status of something else whilst I am processing messages in the ESB. I can only find a loop that loops for a defined number of times, i.e. for testing or a quartz timer that will check every x seconds. Neither of these are really suitable. Any suggestions, or am I asking for something simply outside of the remit of an ESB? 回答1: What

Read contents of a file containing key value pairs without normal parsing

时光怂恿深爱的人放手 提交于 2019-12-08 08:08:18
问题 My scenario is to read a file from a file endpoint which contains only key value paris like a property file and take a few data from it based on the key . Any idea how to do them other that using a custom bean or java component. I would like to know if this is possible any way in Mule or Camel. Thanks in advance. 回答1: If you want to use a Camel route, to pickup files, then something like this from("file:inbox") .convertBodyTo(Properties.class) .log("The foo value is {${body[foo]}") .log("The

Camel replace all CRLF with LF using Simple DSL

自闭症网瘾萝莉.ら 提交于 2019-12-08 07:51:25
I am trying to replace the CRLF of the input data with LF but this is breaking the route. My code is as shown below from(fromEndpoint) .convertBodyTo(byte[].class, "iso-8859-1") .setBody(simple("body.replaceAll(\r\n, \n)")).... if I take the setbody out it works perfect. I just want platform dependent line feeds Any ideas what I am doing wrong? Thanks solved with this from(fromEndpoint) .convertBodyTo(byte[].class, "iso-8859-1") .setBody(body().regexReplaceAll("\\r\\n", "\\\n")) 来源: https://stackoverflow.com/questions/18508716/camel-replace-all-crlf-with-lf-using-simple-dsl