apache-camel

Apache Camel: Is it possible to configure WMQ without using Spring?

风格不统一 提交于 2019-12-03 22:02:40
问题 currently I am working with apache camel and wmq. For the camel configuration and routing, I am using Java DSL. But I could not find any example about how to configure WMQ by using Java DSL. Here is what I get when I tried to configure WMQ: config.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www

Use existing http server in spring boot as camel endpoint

为君一笑 提交于 2019-12-03 21:36:51
I have a spring boot application that uses the spring boot starter web. This creates a running Tomcat instance and sets up the http server running on a port. Within my camel route, I want to use this http server as the component for http requests, but I can't figure out how to utilize it. I see many many examples of configuring a jetty instance and consuming from it, but then wouldn't I in effect have two http servers running? I only want to have one. I assume the http server is already autowired up since I can consume from it with other spring code (such as a RestController) and I can see it

Apache Camel 2.14 Rest DSL Security

社会主义新天地 提交于 2019-12-03 20:52:02
I would like to use the new Rest DSL in Apache Camel 2.14 to create a rest interface. I would like to use the Jetty component and I have a basic example setup like this: Spring Security Configuration <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring-security="http://www.springframework.org/schema/security" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel

How to send file as mail attachment via camel spring DSL

走远了吗. 提交于 2019-12-03 20:50:30
I'm using Camel 2.9.x for integration purposes in our current project. One of the routes consists of two endpoints - file polling endpoint and smtp mail endpoint. Files produced by the first endpoint must be sent through smtp endpoint as attachments. For Camel configuration we're using Spring DSL (this actually is a requirement). Spring version is 3.1.1. Unfortunately, I've found only java dsl examples and documentation of attaching a file to a e-mail message in camel routes. <endpoint uri="file:///path/to" id="file-source"/> <endpoint uri="smtp://mail.example.com:25/?username=someuser@example

Passing values between processors in apache camel

匆匆过客 提交于 2019-12-03 18:38:17
问题 In apache camel, which of those is the best way to pass values from an exchange processor to another (and why) : storing it in the exchange headers using the setProperty method while building the route. another way.. 回答1: Properties and headers are pretty much the same. Headers are, however, converted to/from protocol specific headers on certain components, such as Jms. So, Meta data inside a route: properties Meta data to/from outside: headers 回答2: One distinction not mentioned by Ben and

Java Messaging : Difference between ActiveMQ, Mule, ServiceMix and Camel

99封情书 提交于 2019-12-03 18:20:44
问题 I am new to Messaging and want to know the difference between ActiveMQ , Mule , ServiceMix and Camel Anyone knows how each of these product is different? Thanks in advance ! EDIT: Also would like to know any good place/resource to learn these things. 回答1: ActiveMQ is a message broker which implements the JMS API and supports a number of cross language clients and network protocols. It lets you implement queues or topics and write listeners or subscribers to respond to queue events. Mule and

How should an ESB be packaged/deployed?

一笑奈何 提交于 2019-12-03 17:39:40
问题 I am trying to wrap my head around Apache Camel, which appears to be a lightweight ESB. If I understand Camel/ESBs correctly, then you can think of a Camel Route as a graph of nodes and edges. Each node is an endpoint on the route (can consume/produce messages). Each edge is a route between two different endpoints (1 producer and 1 consumer). Assuming that's correct, I have a practical question: what do best practices dictate about deploying your application's ESB/Camel Route? Should I

Apache Camel: RouteBuilder with CxfEndpoint

我怕爱的太早我们不能终老 提交于 2019-12-03 17:21:24
Hello! I'm trying to implement a Camel route with Java DSL and RouteBuilder. I want to send from a timer endpoint to a cxf endpoint. Code: public class MyRoute extends RouteBuilder { @Override public void configure() { CamelContext camelContext = getContext(); CxfEndpoint cxfEndpoint = new CxfEndpoint(); cxfEndpoint.setAddress("http://localhost:8088/interface"); cxfEndpoint.setWsdlURL("wsdl/contract.wsdl"); cxfEndpoint.setCamelContext(camelContext); cxfEndpoint.setDataFormat(DataFormat.PAYLOAD); try { camelContext.addEndpoint("myEndpoint", cxfEndpoint); } catch (Exception e) { e

Processing multiple message in parallel with ActiveMQ

戏子无情 提交于 2019-12-03 17:19:32
I'd like to process messages in a queue in parallel using a simple Processor/AsyncProcessor as a destination. The processor takes a little time per message, but each message can be handled seperately, and thus at the same time (within healthy boundaries). I'm having a hard time finding examples, especially about the xml configuration of camel routes. So far, I've defined a threadpool, route and processor: <threadPool id="smallPool" threadName="MyProcessorThread" poolSize="5" maxPoolSize="50" maxQueueSize="100"/> <route> <from uri="broker:queue:inbox" /> <threads executorServiceRef="smallPool">

Camel route-testing using adviceWith with OnException definitions

扶醉桌前 提交于 2019-12-03 13:35:31
I have a very simple Camel route definition which just includes some OnException predicates to handle respective exceptions and some log-statements. from("hazelcast:seda:someQueue") .id("someQueueID") .onException(CustomException.class) .handled(true) .log(LoggingLevel.WARN, "custom exception noticed") .end() .onException(IOException.class, FileNotFoundException.class) .asyncDelayedRedelivery() .redeliveryDelay(3*1000*60) // 3 Minutes .maximumRedeliveries(3) .log(LoggingLevel.WARN, "io exception noticed") .end() .onException(Exception.class) .log(LoggingLevel.WARN, "general exception noticed")