apache-camel

Camel ActiveMQ + Spring boot not reading spring activemq configurations

橙三吉。 提交于 2020-01-11 05:19:09
问题 I am trying a very simple route with Spring Boot 1.5.2.RELEASE + Camel (Spring Boot Starter) + ActiveMQ, which is to read from a particular queue and then log it. However, it looks like it is not picking up my spring.activemq configuration for URL as I see in the log it is trying to connect to a different url and it continues to connect it and the my spring boot app never starts. The questions are based on my configuration that I am providing below how can I do the below: Fix the

How can I invoke a RESTful service through Apache Camel?

喜欢而已 提交于 2020-01-10 14:11:31
问题 I am currently using a HTTP method for invoking some URL which will create a JIRA issue. Now I want to use Apache Camel, how can I use that? I need to invoke the following link through Camel: http://localhost:8080/rest/api/2/project/" + key + /components As I'm new to Camel, please suggest some solutions and examples too. Thanks 回答1: You could easily use the CXFRS Component; if you need to do it using the HTTP Component for some reason you could easily use that as well: <setHeader headerName=

elasticsearch and camel integration

白昼怎懂夜的黑 提交于 2020-01-07 06:35:10
问题 I am trying to integrate camel with elasticsearch. In applicationContext.xml added the following <route id="timer-to-console"> <from uri="timer://foo?fixedRate=true&period=10s"/> <transform> <simple>Hello Web Application, how are you?</simple> </transform> <to uri="stream:out"/> <to uri="elasticsearch://local"/> </route> Then when I run mvn jetty:run I am getting the following veryCounter=0, firedTime=Mon Apr 21 13:14:43 PDT 2014} BodyType String Body Hello Web Application, how are you? ]

How can I detect network disconnection in Apache Camel?

会有一股神秘感。 提交于 2020-01-07 05:14:10
问题 I need to log when a client is disconnected from Apache Camel connection. How can I detect a netty-tcp disconnection? from("{{uri.client.address}}") 回答1: Its a bit more complicated to log individual client disconnects but I will try to share what I had to do. You need to extend SimpleChannelInboundHandler with your own class and add the methods needed. For an example class see here: https://github.com/apache/camel/blob/master/components/camel-netty4/src/main/java/org/apache/camel/component

How to I exclusively send to started Camel routes?

落爺英雄遲暮 提交于 2020-01-06 18:13:50
问题 public class MyRoute extends RouteBuilder { @Override public void configure() { from("servlet://myservlet") .multicast() .parallelProcessing().recipientList(bean(this)) .end(); } @RecipientList public List<String> route(String body) { return getContext().getRouteDefinitions().stream() .filter(i -> i.getStatus(getContext()).isStarted() && i.getId().startsWith("FOO")) .map(OptionalIdentifiedDefinition::getId) .collect(toList()); } } When I debug, I see that getContext().getRouteDefinitions() is

How to retrieve a exchange property in the camel route XML?

点点圈 提交于 2020-01-06 16:22:47
问题 I have to run a loop in the route. my route looks as <camel:loop> <camel:constant>${property.x}</camel:constant> </camel:loop> My processor looks as Date date = new Date(); this.LOGGER .info("\n****WELCOME TO THE REQUEST OF CHECK PROCESSOR**"); int y=4; Integer a=new Integer(y); exchange.setProperty(x,a); int k=(Integer) exchange.getProperty(x); this.LOGGER .info("\n***WELCOME TO THE REQUEST OF CHECK PROCESSOR ENDINGGGGGGGG***"+"a= "+a+" Y= "+y+" x= "+exchange.getProperty(x)+" k= "+k); while

How do I set a component parameter of type object to a route using Java DSL?

夙愿已清 提交于 2020-01-06 07:07:22
问题 My objective is to use Camel along with its JMS component. The route config looks like below- from("jms:queue:test").to(mybean) I would like to add the option of kind 'parameter' and type 'object' to this route -for example the option 'jmsMessageType'. I saw some other posts that talks about using setProperty() on route definition but I could not find a definite answer. Options of type 'string' and numbers can be appended to the URI but not objects. JMS has an option of taskExecutor but how

Configure Camel Thread names with Spring DSL

﹥>﹥吖頭↗ 提交于 2020-01-06 06:56:27
问题 How do I configure the thread names created by Camel (version 2.8.1)? I need to have more concise thread names for logging purposes. The Camel documentation states that the default is: Camel (#camelId#) thread ##counter# - #name# Which results in names like: Camel (bundle_camel) thread #114 - JmsConsumer[SomeClassNameHere] But I want just: #camelId#-#counter# which would give me something like: bundle_camel-114 The documentation says how to change the thread name pattern by calling a manager

Multiple camel context not accepted in Spring Boot Came single configl xml model ?

…衆ロ難τιáo~ 提交于 2020-01-06 05:57:05
问题 Base Facts : Apache Camel 2.20.1 (Spring Boot) Multiple context reference in same spring boot config xml throws below highlighted error, despite providing explicit different ids When my own example failed - I tried with simple sample case.. but met with the same error Error creating bean with name 'typeConverter' defined in class path resource >[org/apache/camel/spring/boot/TypeConversionConfiguration.class]: Unsatisfied >dependency expressed through method 'typeConverter' parameter 0; nested

Avoid automatic binding with RabbitMQ and Camel

萝らか妹 提交于 2020-01-06 02:40:10
问题 I'm trying to use RabbitMQ with Camel. I am using Camel 2.14.1. I want to open an fanout exchange on RabbitMQ and then later bind queues to it. This seems to work fine. However, everytime I create an Exchange, it is automatically bound to queue with a system name (a number). Can't I avoid that? Here is a simple example which posts 100 messages to an Exchange. But they get delivered to an automatically created queue, I want to avoid this. @Override public void configure() throws Exception {