blob: 3b01b6f077e66be3eb81ba51e33d01023454f12a [file] [log] [blame]
// kafka-connector options: START
[[camel-jpa-kafka-connector-sink]]
= camel-jpa-kafka-connector sink configuration
When using camel-jpa-kafka-connector as sink make sure to use the following Maven dependency to have support for the connector:
[source,xml]
----
<dependency>
<groupId>org.apache.camel.kafkaconnector</groupId>
<artifactId>camel-jpa-kafka-connector</artifactId>
<version>x.x.x</version>
<!-- use the same version as your Camel Kafka connector version -->
</dependency>
----
The camel-jpa sink connector supports 25 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Priority
| *camel.sink.path.entityType* | Entity class name | null | ConfigDef.Importance.HIGH
| *camel.sink.endpoint.join Transaction* | The camel-jpa component will join transaction by default. You can use this option to turn this off, for example if you use LOCAL_RESOURCE and join transaction doesn't work with your JPA provider. This option can also be set globally on the JpaComponent, instead of having to set it on all endpoints. | true | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.maximum Results* | Set the maximum number of results to retrieve on the Query. | -1 | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.namedQuery* | To use a named query. | null | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.native Query* | To use a custom native query. You may want to use the option resultClass also when using native queries. | null | ConfigDef.Importance.MEDIUM
| * camel.sink.endpoint.persistence Unit* | The JPA persistence unit used by default. | "camel" | ConfigDef.Importance.HIGH
| *camel.sink.endpoint.query* | To use a custom query. | null | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.result Class* | Defines the type of the returned payload (we will call entityManager.createNativeQuery(nativeQuery, resultClass) instead of entityManager.createNativeQuery(nativeQuery)). Without this option, we will return an object array. Only has an affect when using in conjunction with native query when consuming data. | null | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.findEntity* | If enabled then the producer will find a single entity by using the message body as key and entityType as the class type. This can be used instead of a query to find a single entity. | false | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.flushOn Send* | Flushes the EntityManager after the entity bean has been persisted. | true | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.lazyStart Producer* | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.remove* | Indicates to use entityManager.remove(entity). | false | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.useExecute Update* | To configure whether to use executeUpdate() when producer executes a query. When you use INSERT, UPDATE or DELETE statement as a named query, you need to specify this option to 'true'. | null | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.usePersist* | Indicates to use entityManager.persist(entity) instead of entityManager.merge(entity). Note: entityManager.persist(entity) doesn't work for detached entities (where the EntityManager has to execute an UPDATE instead of an INSERT query)! | false | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.usePassed InEntityManager* | If set to true, then Camel will use the EntityManager from the header JpaConstants.ENTITY_MANAGER instead of the configured entity manager on the component/endpoint. This allows end users to control which entity manager will be in use. | false | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.basic PropertyBinding* | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.entity ManagerProperties* | Additional properties for the entity manager to use. | null | ConfigDef.Importance.MEDIUM
| *camel.sink.endpoint.shared EntityManager* | Whether to use Spring's SharedEntityManager for the consumer/producer. Note in most cases joinTransaction should be set to false as this is not an EXTENDED EntityManager. | false | ConfigDef.Importance.MEDIUM
| * camel.sink.endpoint.synchronous* | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | ConfigDef.Importance.MEDIUM
| *camel.component.jpa.entity ManagerFactory* | To use the EntityManagerFactory. This is strongly recommended to configure. | null | ConfigDef.Importance.MEDIUM
| *camel.component.jpa.join Transaction* | The camel-jpa component will join transaction by default. You can use this option to turn this off, for example if you use LOCAL_RESOURCE and join transaction doesn't work with your JPA provider. This option can also be set globally on the JpaComponent, instead of having to set it on all endpoints. | true | ConfigDef.Importance.MEDIUM
| *camel.component.jpa.shared EntityManager* | Whether to use Spring's SharedEntityManager for the consumer/producer. Note in most cases joinTransaction should be set to false as this is not an EXTENDED EntityManager. | false | ConfigDef.Importance.MEDIUM
| * camel.component.jpa.transaction Manager* | To use the PlatformTransactionManager for managing transactions. | null | ConfigDef.Importance.MEDIUM
| *camel.component.jpa.lazyStart Producer* | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | ConfigDef.Importance.MEDIUM
| *camel.component.jpa.basic PropertyBinding* | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | ConfigDef.Importance.MEDIUM
|===
// kafka-connector options: END