This page offers several hints for performance tuning which would be good to keep in mind:

OpenHub = Apache Camel

There are many resources (articles, comments in discussions, etc.) which are related to Apache Camel performance issues.

List of interesting ones:

Database connection

OpenHub uses database for saving messages and their states (cross several nodes in the cluster):


Count of database connections must correlate with

  • number of concurrent consumers for processing asynchronous messages. See configuration parameter ohf.asynch.concurrentConsumers
  • number of incoming asynchronous requests for processing 
  • number of incoming synchronous requests if OpenHub is enabled for saving requests/responses

Count of database connections must be at least count of incomming asynchronous requests plus count of concurrent consumers together.

SEDA configuration

Crucial component for processing incoming requests is SEDA component.

There are several points for keeping in mind:

    public static final String URI_ASYNC_PROCESSING_MSG = "seda:asynch_message_route"
            + "?concurrentConsumers={{" + ASYNCH_CONCURRENT_CONSUMERS + "}}&waitForTaskToComplete=Never"
            + "&blockWhenFull=true&queueFactory=#" + PRIORITY_QUEUE_FACTORY;
    @Bean(name = AsynchConstants.PRIORITY_QUEUE_FACTORY)
    public PriorityBlockingQueueFactory priorityQueueFactory() {
        PriorityBlockingQueueFactory<Exchange> queueFactory = new PriorityBlockingQueueFactory<>();
        queueFactory.setComparator(new MsgPriorityComparator());
        return queueFactory;
    }
public void logStartProcessing(@Body Message msg,
@Nullable @Header(AsynchConstants.MSG_QUEUE_INSERT_HEADER) Long msgInsertTime) {
	LOG.debug("Starts processing of the message {}, waited in queue for {} ms", msg.toHumanString(),
	msgInsertTime != null ? (System.currentTimeMillis() - msgInsertTime) : "-");
}
2019-01-14 19:52:48 [Camel (camelContext) thread #20 - seda://asynch_message_route, ALTA, ID:95fc3756-182d-11e9-b9c2-005056010488] WARN syncProcessOut_route - Message (msg_id = 37357, correlationId = ID:95fc3756-182d-11e9-b9c2-005056010488) was obsolete, stopped further processing.

Thread pools

        defaultProfile = new ThreadPoolProfile(defaultThreadPoolProfileId);
        defaultProfile.setDefaultProfile(true);
        defaultProfile.setPoolSize(10);
        defaultProfile.setMaxPoolSize(20);
        defaultProfile.setKeepAliveTime(60L);
        defaultProfile.setTimeUnit(TimeUnit.SECONDS);
        defaultProfile.setMaxQueueSize(1000);
        defaultProfile.setAllowCoreThreadTimeOut(false);
        defaultProfile.setRejectedPolicy(ThreadPoolRejectedPolicy.CallerRuns);
        ThreadPoolProfile threadPoolProfile = camelContext.getExecutorServiceManager().getDefaultThreadPoolProfile();
        threadPoolProfile.setId(DEFAULT_THREAD_PROFILE);
        threadPoolProfile.setMaxPoolSize(MAX_THREAD_POOL_SIZE);

Throttling

Throttling can be disabled: ohf.disable.throttling = false

Caching

Use Cache / memory-grid functionality to increase performance when often data reading is necessary.