apache-camel

camel - get jndi registry

和自甴很熟 提交于 2019-12-08 07:41:10
问题 I'm using apache camel, and I will be needing the jndi registry so that I can bind an object to it. How do I retrieve a JNDI registry from a RouteBuilder class? Can I also bind using xml? Thanks! 回答1: I was able to do it not within the RouteBuilder but before adding context to the camelMain . JndiRegistry registry = new JndiRegistry(); ... registry.bind("myAntFilter", filter); DefaultCamelContext context = new DefaultCamelContext(registry); camelMain.getCamelContexts().add(context); It is

How to share an object between methods on different camel routes

两盒软妹~` 提交于 2019-12-08 05:44:41
问题 I am search the web without luck about something I thought would be simple but apparently it is not. All I want to do is to do, is create a HashSet in a method that is called in a camel route and then pass this HashSet to a method in another camel route. What my search returned is that I should use a cache but I can't find any example (a simple one) that will show me how implement this. Method "findProperties" in first route creates a HashSet which I want to use in the second route in

RxJava -2 Observables that accepts more Observables at any time?

牧云@^-^@ 提交于 2019-12-08 05:23:07
问题 I'm currently using rx-java 2 and have a use case where multiple Observables need to be consumed by single Camel Route subscriber. Using this solution as a reference, I have a partly working solution. RxJava - Merged Observable that accepts more Observables at any time? I'm planning to use a PublishProcessor<T> that will be subscribed to one camel reactive stream subscriber and then maintain a ConcurrentHashSet<Flowable<T>> where I can dynamically add new Observable. I'm currently stuck on

Infinite loop in Camel - Rabbit MQ

北战南征 提交于 2019-12-08 05:00:48
问题 I have a small server-route, which takes a message from queue.in and puts in queue.out. When I put ONE message in queue.in , the server runns in an infinite loop. I wonder what I'm missing in terms of configuration. This seems like a very simple route. The small server-route: <camelContext id="camel-server" xmlns="http://camel.apache.org/schema/spring"> <jmxAgent disabled="false" onlyRegisterProcessorWithCustomId="false" createConnector="true" usePlatformMBeanServer="true" registerNewRoutes=

Design question on dynamic Apache camel routes/context

时光怂恿深爱的人放手 提交于 2019-12-08 04:58:53
问题 We have ActiveMQ onto which the events that happen in the system are published. The project involves users adding entities to their watch-list and whenever there are events on those entities I would like an email to be sent out to the interested participants. The use-case roughly translates to some one expressing an interest in a product information page on the catalog and an email being sent whenever any activity happens on that product (price goes down, there is a positive review etc.,). I

How to update only consumed sql rows with Apache Camel SQL Component?

筅森魡賤 提交于 2019-12-08 04:32:06
问题 I'm new in Camel and i try to process SQL data. If the SQL consume (select) is done, i try to update the consumed rows, but i just get a "bad SQL grammar" exception. I use the Apache Camel SQL-Component, where the starting endpoint is a sql select statement. To mark them as consumed, i use the onConsume parameter of the SQL-Component. In the select, v_table is the view of the original table t_table , which is used afterwards in the update. So the id of a row in v_table and t_table is the same

JAXB marshalling in Apache Camel

穿精又带淫゛_ 提交于 2019-12-08 04:13:29
问题 I am new to Apache camel and need to perform a task where i need to marshal an object to xml file. I am using the below code but it is not working. Here, foo.pojo is package where JAXB annotated classes are present JaxbDataFormat jaxbDataFormat = new JaxbDataFormat("foo.pojo"); from("direct:start").marshal(jaxbDataFormat).to("file:C:/Users/Anand.Jain/Desktop/hello/abc.xml").end(); Please help. 回答1: Option 1: Configure the context path JaxbDataFormat jaxbDataFormat = new JaxbDataFormat("foo

Throttling in Camel

南楼画角 提交于 2019-12-08 04:10:51
问题 I am trying to figure out throttling concepts in Camel. I have already seen Camel's route policy, but this works for number of inflight exchanges. My route is following: routeBuilders.add(new RouteBuilder() { @Override public void configure() throws Exception { from("rabbitmq://127.0.0.1:5672/abc?queue=a&username=XXX&password=XXX&autoAck=false&durable=true&exchangeType=direct&autoDelete=false") .to("rabbitmq://127.0.0.1:5672/abc?queue=b&username=XXX&password=XXX&autoAck=false&durable=true

Dynamic routing in camel en-queues messages infinitely

左心房为你撑大大i 提交于 2019-12-08 03:49:25
问题 I am working on camel’s dynamic router to derive and dispatch to the relevant queue by referring http://camel.apache.org/dynamic-router.html Following is the camel config xml: <route id="dynamicRouter" autoStartup="true"> <from uri="vm://service1?concurrentConsumers=10&timeout=0" /> <choice> <when> <simple>${body.documentStatus} == 'SUCCESS' </simple> <log message="routing to dynamic router" /> <dynamicRouter> <!-- use a method call on a bean as dynamic router --> <method ref="messageRouter"

JPA component in camel cannot reconnect automatically to database

随声附和 提交于 2019-12-08 03:41:59
问题 When I reboot my database while my application is running, JPA components cannot reconnect automatically. 2017-02-09 17:45:08,400 ERROR o.h.e.j.spi.SqlExceptionHelper(131) - Connection closed. - [Camel (camel-1) thread #99 - jpa://com.toto.Toto ] But still I am able to execute SQL request with spring-data in my CXF routes. My datasource definition in context.xml : <!-- JDBC connection --> <Resource name="jdbc/oracle" auth="Container" type="javax.sql.DataSource" username="toto" password="toto"