apache-camel

Initializing camel from Spring annotation config

三世轮回 提交于 2019-12-06 01:07:45
问题 I am trying to learn Spring and understand how it works. I have followed some tutorials in setting up Spring and Camel, and have had it working using default setups. I am now attempting to convert as much as possible of my configuration XML-files to Java-classes. So far I have been successful in creating the camel-routes in a Java-class (extending SpringRouteBuilder and implementing configure() ), and all the beans from my spring-configuration file (Bean->Function with @Bean). The only part I

Is it possible to build a Reactive Application using a non-Functional language?

痴心易碎 提交于 2019-12-06 01:07:14
I would like to understand if the principles behind the Reactive Application manifesto can be achieved using a non-functional language . Some people say that since FP use immutable states and free side-effects functions, they are easier to implement concurrent, distributed and resilient systems. But how can we achieve that using Java for example? There are some frameworks like Apache Camel, that have some components to work with, like Camel RX , and Camel SEDA . Are these frameworks enough? I will try to clarify my question: I think of reactive programming as new programming paradigm, and a

Apache Camel concurrentConsumers vs threads

*爱你&永不变心* 提交于 2019-12-05 23:56:08
i spent almost two days to understand the concept concurrentConsumers vs threads in Apache Camel. but i really don't understand the concept. could anyone help me to understand the concept. I am using camel 2.12.0. from("jms:queue:start?concurrentConsumers=5") .threads(3, 3, "replyThread") .bean(new SomeBean()); pom.xml ========================================== <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <camel.version>2.12.0</camel.version> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1<

Camel-Jetty http proxy + large response data casue issue: Buffering capacity exceeded

谁都会走 提交于 2019-12-05 23:46:24
jetty expert, I got error when getting back large data via camel-jetty as http proxy, any experience/idea/suggestion are welcome, thanks in advance. RouteBuilder code: from("servlet:balancer?matchOnUriPrefix=true") .to("jetty:http://vm-a38e-8f19.nam.nsroot.net:19999/balancer/?" + "bridgeEndpoint=true" + "&disableStreamCache=true" + "&throwExceptionOnFailure=false" + "&bufferSize=1024000000" + "&inboundBufferSize=1024000000" + "&outboundBufferSize=1024000000" + "&eagerCheckContentAvailable=true" + "&httpClient.responseBufferSize=1024000000&responseBufferSize=1024000000&chunked=false") ENV: <jdk

In an Apache Camel application, how can unit tests inject mock endpoints in place of real ones?

非 Y 不嫁゛ 提交于 2019-12-05 21:36:39
问题 I am implementing a message translator pattern with Apache Camel, to consume messages from a RESTful endpoint and send them onward to an AMQP endpoint. The enclosing application is based on Spring Boot, and so I'm using Camel's "spring-boot" component to integrate the two frameworks. As suggested by the documentation in this spring-boot link, I'm implementing my Camel route inside of a @Configuration -annotated class which extends RouteBuilder : @Component public class MyRestToAmqpRouter

Apache Camel maven dependency issue with BundleContextAware and BundleContext

ⅰ亾dé卋堺 提交于 2019-12-05 20:59:17
I'm trying to configure Apache Camel in Spring in the Java config way as detailed in this example . However I'm stuck at the dependency step because BundleContextAware and (transitively) BundleContext cannot be resolved. It seems that the necessary transitive dependencies are not downloaded. Here is my pom.xml: <properties> <apache.camel.version>2.9.0</apache.camel.version> </properties> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>${apache.camel.version}</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel

Camel JAX-RS and Cross Domain Request

妖精的绣舞 提交于 2019-12-05 19:21:44
I'd like to be able to do HTTP requests on my localhost Camel instance (just for development purpose, I know this is bad practice). For now, I'm stuck with : Origin http://localhost:8000 is not allowed by Access-Control-Allow-Origin. I've search how can I tell Camel to allow such requests, but didn't find an answer. I'm using camel-cxf and the rsServer to create my endpoint. I've got an endpoint looking like that : public class LoginEndpoint { @GET @Path(LOGIN) @Produces(MediaType.APPLICATION_JSON) public Customer login(@QueryParam("email") String email, @QueryParam("password") String password

How to use apache camel to read data from mysql table and write into another table

坚强是说给别人听的谎言 提交于 2019-12-05 19:11:18
Guys I am using Apache Camel to read data from mysql table. I am successfully printing it on console. But according to my requirement I need to read the data from one mysql database, then filter it by using some condition and then insert the filtered data in another mysql database table. I am posting my code below.. public class camelJdbc { public static void main(String[] args) throws Exception { final String url = "jdbc:mysql://localhost:3306/emp"; final String url1 = "jdbc:mysql://localhost:3306/emp1"; DataSource dataSource = setupDataSource(url); DataSource dataSource1 = setupDataSource1

Apache Camel: multicast with aggregation - AggregationStrategy called too often

旧巷老猫 提交于 2019-12-05 18:52:18
I have the following strange (or at least unclear to me) behaviour for a multi-cast + aggregation. Consider the following route: from("direct:multicaster") .multicast() .to("direct:A", "direct:B") .aggregationStrategy(new AggregationStrategy() { @Override public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { if (oldExchange == null) { List firstResult = newExchange.getIn().getBody(List.class); newExchange.getIn().setBody(ImmutableList.copyOf(firstResult)); return newExchange; } else { List oldResults = oldExchange.getIn().getBody(List.class); List newResults = newExchange

How to get access token from Authorisation Server using Apache Camel routes?

自作多情 提交于 2019-12-05 18:19:59
I have an authorization server [Simple Class annotated with @SpringBootApplication , @RestController , @Configuration , @EnableAuthorizationServer & oauth2 security] running on port 8081 which works fine & provides the access token when requested from POSTMAN using POST method along with needful parameters in the form of key value pair, http://localhost:8080/oauth/token , but how should i implement the camel route in java to get the access token by passing parameters in body ? This question is more about sending multipart/form-data with Apache Camel. I was playing with it some time ago and