Apache camel configuration - apache-camel

I use apache camel-cdi and wildfly 8.2. How to configurate thread pool for camel?
In documentation I only see config for spring, but I use java ee with wildfly

You can check Java DSL configuration to create a thread pool in Camel.
import org.apache.camel.spi.ExecutorServiceManager;
import org.apache.camel.spi.ThreadPoolProfile;
ExecutorServiceManager manager = context.getExecutorServiceManager();
ThreadPoolProfile defaultProfile = manager.getDefaultThreadPoolProfile();
// Now, customize the profile settings.
defaultProfile.setPoolSize(SomeSize);
defaultProfile.setMaxQueueSize(QueueSize);

This depends on your use case but you can definitely use thread pooling with Camel Java DSL. The format would be something like the below:
ExecutorService threadPool = Executors.newFixedThreadPool(20);
.split(body().tokenize("\n")).streaming().executorService(threadPool)
Individual components can also allow for individual threading (see file2 for example). If you have the Camel in Action book, chapter 10 is all about concurrency. It goes into threading and concurrency in much more detail.

Related

using reactive-streams with Apache Camel Saga

I would like to know if it is possible to use reactive streams in Apache Camel. I know reactive-streams is a component from Apache but I couldn't get it to work the way they explain in the documentation. I would like to know if there is any possible solutions available in github that could help me understand apache camel along with reactive-streams except the one's from apache.
I could possibly use Producer Template with reactor-core but the route logic that sits in RouteBuilder configure method would still be blocking I/O. Any helps would be appreciated?

Stop Apache Camel from starting LevelDB until the route using it is started

I have an Apache Camel Route that uses LevelDB as the aggregation repository. My problem is that when the Camel Context is started the LevelDBAggregationRepository is automatically started by Camel even if the Camel Route it is used in is off and not started.
Is there a way of preventing this?
Why is this important for me? I want my application to be highly available, so I want to share the same LevelDB between nodes. But the LevelDBAggregationRepository unfortunately does not support using multiple processes at a time, and I have no SQL DB available for the JDBC Aggregation Repository.
So, my current solution attempt is to use a route policy that ensures that only one node at a time has the Camel Route enabled (determined by leader election with Zookeeper). However, when I start a second node with the route turned off, its Camel Context tries to launch the LevelDB anyway and then all hell breaks loose.

Difference between camel-jbpm and jboss jbpm?

What is the difference between Apache camel-jbpm and jboss jbpm ?
Since Apache camel(2.16.3) is having one component as camel-jbpm.
I am confused which one I should use ? I am integrating with karaf. please suggest.
JBoss BPM (business process - a.k.a human workflow) is a project you can find and read more about here:
http://www.jbpm.org/
Apache Camel is an integration library that allows to integrate with a lot of different system. Doing so by using Camel components. One of these components is camel-jbpm that makes it possible/easier to use JBPM from Camel users.
http://camel.apache.org/jbpm
So if you have an existing BPM system and need to integrate with that from a Camel application or Java application, then using the camel-jpmn can make that (much) easier.

Active - Passive Fuse FTP interfaces using Idempotent repository

We have a clustered environment where same camel ftp endpoint is installed on multiple fuse instances. I want message(file) to be consumed by only one fuse instance. I am planning to achieve this by implementing IdempotentRepository interface with database persistence. Want to make sure that this approach will work or there is a better way to do it?
If you don't want to depend on a database for doing this you could try with Hazelcast. Hazelcast is a distributed data cache that can be used as a idempotent repository without external dependencies. Also, Apache Camel provides a class for doing this. There is a nice tutorial explaining how to do it: Hazelcast Idempotent Repository Tutorial

Updating camel version in fuse esb

Hi I would like to know which camel version is used in Fuse esb (jboss-fuse-6.0.0.redhat-024),
according to the migration guide it's 2.10.0 .
how can I update it to use 2.10.5 ?
JBoss fuse is using customer version of Camel which is based on the Camel 2.10.x branch.
As there are lots other projects which may relates to this Camel version, I don't suggest you to change the version yourself.

Resources