apache-camel

Camel: Bean Proxy to CXF Endpoint

匆匆过客 提交于 2019-12-10 21:05:23
问题 I'm currently trying to get familiar with Servicemix, Camel, CXF, etc. and have basically the same question as somebody had four years ago here: How do I convert my BeanInvocation object in camel to a message body and headers? Unfortunately, the answer there don't help me much. As one of the answers mentions: all examples on the Camel website concern themselves with sending something to a bean from CXF. I have a bean proxy endpoint that I'm using in a POJO, injected via @Produce(uri ="direct

Error Casting Spring's JndiObjectFactoryBean to ConnectionFactory for Solace-MQ JMS

房东的猫 提交于 2019-12-10 20:51:24
问题 I have a good working XML configuration for Camel Context that uses JNDI with Spring Later Solace.JndiObjectFactoryBean gets used as connectionFactory <bean id="Solace.JmsComponent" class=" on"> <property name="connectionFactory" ref="Solace.JndiObjectFactoryBean" /> <property name="destinationResolver" ref="Solace.JndiDestinationResolver" /> </bean> I am trying to convert this into a Java class that extends from org.apache.camel.spring.javaconfig.CamelConfiguration . But there is one problem

Maven-Camel-Spring-Oracle: Error creating bean - java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]

流过昼夜 提交于 2019-12-10 19:14:11
问题 I'm getting this error since yesterday, and even though I've tried everything that came to my mind or I found searching on the internet, I can't solve it. Context: java 6, Spring 3.1.4, camel 2.11.1, Oracle driver 10.2.0.2. I have this bean in camel context file: <bean id="myDataSource" class="**org.springframework.jdbc.datasource.DriverManagerDataSource**"> <property name="driverClassName" value="**oracle.jdbc.driver.OracleDriver"**/> <property name="url" value="jdbc:...."/> <property name=

Apache camel soap request type conversion error

China☆狼群 提交于 2019-12-10 18:11:25
问题 I'm trying to send a soap request in apache camel running on an osgi enviroment (karaf). Until now I got this code public void start(BundleContext context) throws Exception { LOGGER.log(Level.INFO, "START"); MyRouteBuilder routeBuilder = new MyRouteBuilder(); camelContext = new DefaultCamelContext(); StreamComponent stream = new StreamComponent(); camelContext.addComponent("stream", stream); camelContext.addRoutes(routeBuilder); CxfComponent cxf = new CxfComponent(); camelContext.addComponent

Accessing Azure Service Bus with Apache Camel?

柔情痞子 提交于 2019-12-10 18:06:26
问题 How can you access the Azure Service Bus using Apache Camel using Camel as a standalone Java application? 回答1: If you are trying to access Azure Service Bus using Apache Camel you can do so by using the Camel AMQ libraries. You can use the following Maven dependencies in case of you are using Maven: <dependencyManagement> <dependencies> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-parent</artifactId> <version>2.17.6</version> <scope>import</scope> <type>pom</type> <

JSONPath expression for checking string in Apache Camel XML

旧时模样 提交于 2019-12-10 17:24:18
问题 Let's say I have a simple json file such as the following { "log": { "host": "blah", "severity": "INFO", "system": "1" } } I'm using Apache Camel, and it's Spring XML to process and route the json file. My routing code looks something like this: <route> <from uri="file:/TESTFOLDER/input"/> <choice> <when> <jsonpath>$.log?(@.severity == 'WARNING')</jsonpath> <to uri="smtp://(smtpinfo...not important)"/> </when> <otherwise> <to uri="file:/TESTFOLDER/output"/> </otherwise> </choice> </route> The

Apache Camel: XMLJSON conversion for empty tags to strings instead of arrays

给你一囗甜甜゛ 提交于 2019-12-10 17:15:33
问题 When using the Camel XMLJSON library and when converting an XML message to JSON using the unmarshal option. The application is converting the empty tags to empty JSON arrays. Is there a way to override this behavior to instead convert it into empty strings. For example <person> <first_name>john</first_name> <last_name/> </person> converts to { "first_name": "john", "last_name": [] } instead of the below { "first_name": "john", "last_name": "" } How can this default behavior be overridden to

How to call setter method on ${body} in a Camel route?

狂风中的少年 提交于 2019-12-10 16:19:13
问题 I have tried to set a property on the body of a Java bean constituting the message in transit through a Camel route. I have tried various approaches e.g. <route> ... .. <transform> <simple>${body.label} = ${property.label}</simple> </transform> ... .. </route> in this particular case the ${body} is a Java bean with a setLabel(String label) method and the ${property.label} is set by other means in another route. In this example the result is not the desired (and I understand why), i.e. after

Sending message from HTTP endpoint to JMS

折月煮酒 提交于 2019-12-10 16:00:02
问题 I am trying to have a camel route, which would accept a payload on a http endpoint and then write that payload to a JMS queue. The route that I have so far is below. But an empty message gets delivered to the jms queue. A message gets there, but it has no body. Heres the route: <route > <from uri="jetty:http://0.0.0.0:8050/add/Customer"/> <inOnly uri="jms:queue:Q.Customer" /> </route> Heres the payload that I'm sending into to ' http://0.0.0.0:8050/add/Customer ' endpoint: <Customer xmlns=

Use Exchange Property in Camel DSL “to”

旧城冷巷雨未停 提交于 2019-12-10 15:32:36
问题 I want to set a property on a Camel Exchange and then use this property when saving the file. In my camel dsl I have the following: .process(processorToSetExhangeProperty) // sets the property <uid> on the exchange .to("file:/tmp?fileName=file-" + property("uid") + ".xml") The file is being saved as: "file-property{uid}.xml" though My processor is as follows: @Override public void process(Exchange exchange) throws Exception { UUID uuid = UUID.randomUUID(); exchange.setProperty("uid", uuid