Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Camel supports pluggable pools for services. At this time of write we have pools for:

  • Producer

The default producer service pool is org.apache.camel.impl.DefaultProducerServicePool and is used by default in Camel for pooling Producer.

The need for pooling Producer is only apparent in some Components in Camel to support thread safe producers and support concurrency. And using pooling we can improve performance as we do not have the overhead of creating, starting and stopping the Producer at each invocation. So where is it needed then, well these components uses pooled Producersproducers:

Usage

By default Camel uses a shared org.apache.camel.impl.DefaultProducerServicePool provided by CamelContext. This default pool will pool up till 100 Producers producers per Endpoint. So if you have 6 endpoints there can be up till 6 x 100 in total in the pool. However each Endpoint have a limit of up till 100 Producersproducers.

Pluggable

...

producer pooling

Camel supports using a 3rd part pool implementation. What is needed is to implement an adapter by implementing the org.apache.camel.spi.ServicePool interface and define the generic as Endpoint as the key and Producer as the service.

Then set your custom pooling on the CamelContext with the setProducerServicePoll method.

See Also

...