apache-camel

Get BeanCreationException when try to add Jackson Library

て烟熏妆下的殇ゞ 提交于 2020-01-24 20:34:25
问题 I have a simple Hello World example that passes a Map to Camel and displays the values to the console via Log4J. I want to expand this example to render this map in JSON by adding the Jackson library to my Camel applicationContext.xml First I tried adding the following XML tags to my applicationContext.xml (as specified at http://camel.apache.org/json.html under "Using JSON in Spring DSL") <camel:dataFormats> <camel:json id="jack" library="Jackson"/> </camel:dataFormats> But when I add this

micrometer:timer measure time cross two routes

霸气de小男生 提交于 2020-01-24 01:35:33
问题 micrometer:timer measure time cross two routes I am using micrometer to measure time for route A and route B it works, I also want to measure total time for routeA and routeB since data flow is from routeA -> routeB. but it does not work. Below is the snippet of my code Any hints or suggestions are more than welcome! from("amq:queue:testqueue") .routeId("routeA") .to("micrometer:timer:timer.routeA?action=start") .to("micrometer:timer:timer.total?action=start") //some steps in between .to(

ConnectionFactory get destroyed before camel

泪湿孤枕 提交于 2020-01-24 01:08:05
问题 I'm using spring-boot with camel and ActiveMQ. I'm using activemq autoconfiguration via @EnableJms annotation. But creating my own ActiveMQComponent to enable "transacted(true)" on all queues. @Bean(name = "activemq") @ConditionalOnClass(ActiveMQComponent.class) public ActiveMQComponent activeMQComponent(ConnectionFactory connectionFactory) { ActiveMQComponent activeMQComponent = new ActiveMQComponent(); activeMQComponent.setConnectionFactory(connectionFactory); activeMQComponent

Apache Camel: Polling consumer

♀尐吖头ヾ 提交于 2020-01-23 17:52:05
问题 I'm new to Apache Camel and I'm trying to understand and use the Polling Consumer EIP in a simple project but I feel a little bit lost.. Could someone please help me with a little explanation or even with a little working example. Any help would be appreciated Thanks in advance 回答1: for most use cases, you can create a consumer by just defining them in the from() clause in a route... from("activemq:inbox").to(new MyProcessor()); but, you can also write your own POJO polling consumer logic for

Using apache camel csv processor with pollEnrich pattern?

試著忘記壹切 提交于 2020-01-23 00:58:06
问题 Apache Camel 2.12.1 Is it possible to use the Camel CSV component with a pollEnrich? Every example I see is like: from("file:somefile.csv").marshal... Whereas I'm using the pollEnrich, like: pollEnrich("file:somefile.csv", new CSVAggregator()) So within CSVAggregator I have no csv...I just have a file, which I have to do csv processing myself. So is there a way of hooking up the marshalling to the enrich bit somehow...? EDIT To make this more general... eg: from("direct:start") .to("http:www

Does Akka obsolesce Camel?

强颜欢笑 提交于 2020-01-22 17:24:49
问题 My understanding of Akka is that it provides a model whereby multiple, isolated threads can communicate with each other in a highly concurrent fashion. It uses the "actor model", where each thread is an "actor" with a specific job to do. You can orchestrate which messages get passed to which actors under what conditions. I've used Camel before, and to me, I feel like it's sort of lost its luster/utility now that Akka is so mature and well documented. As I understand it, Camel is about

Split file into multiple files

╄→尐↘猪︶ㄣ 提交于 2020-01-22 02:41:09
问题 I want to cut a text file. I want to cut the file 50 lines by 50 lines. For example, If the file is 1010 lines, I would recover 21 files. I know how to count the number of files, the number of lines but as soon as I write, it's doesn't work. I use the Camel Simple (Talend) but it's Java code. private void ExtractOrderFromBAC02(ProducerTemplate producerTemplate, InputStream content, String endpoint, String fileName, HashMap<String, Object> headers){ ArrayList<String> list = new ArrayList

Get alert - Activemq camel

拥有回忆 提交于 2020-01-22 02:30:09
问题 My Application: Consumer of activemq is already running so it will consume if there is message in Activemq and process it. I want to get alert If there is any failure in my logic. First I try to re delivery my message 3 times if there is any failure in my logic and then send to DLQ , after 3 times re delivery I want to get alert by mail. I have done code to send mail by click a sendMail.bat file. I have consumer code in java, now I want to run sendMail.bat file before the message go to DLQ .

Connection pooling and Multithreading for TCP Socket?

孤街浪徒 提交于 2020-01-17 07:24:09
问题 I have a java application(say A) which communicate with an application(say B) via TCP Socket. My java application is multithreaded, can handle up to 100 threads. To communicate between A --> B we have 10 sockets. Challenges - Connection Pooling - need connection pooling mechanism to handle n(say 100) number of thread(of application A), communicating to application B via x(say 10) number of TCP Socket. Multithreading - How can two thread access same socket send the request one by one and get

Error starting bundle in karaf: “via two dependency chains”

跟風遠走 提交于 2020-01-17 06:32:39
问题 I am currenty developing a camel route which reads from a netty4/mllp endpoint and store the hl7 message to a amqp queue. This is my environment: apache-maven-3.3.9 apache-karaf-4.1.1 apache-camel-2.18.3 apache-artemis-2.0.0 this is my pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>****