Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

This component will by default load the iBatis SqlMapConfig file from the root of the classpath and expected named as SqlMapConfig.xml.
It uses Spring resource loading so you can define it using classpath, file or http as prefix to load resources with those schemes.
In Camel 2.2 you can configure this on the iBatisComponent with the setSqlMapConfig(String) method.

Options

Div
classconfluenceTableSmall

Option

Type

Default

Description

consumer.onConsume

String

null

Statements to run after consuming. Can be used, for example, to update rows after they have been consumed and processed in Camel. See sample later. Multiple statements can be separated with comma.

consumer.useIterator

boolean

true

If true each row returned when polling will be processed individually. If false the entire List of data is set as the IN body.

consumer.routeEmptyResultSet

boolean

false

Sets whether empty result set should be routed or not. By default, empty result sets are not routed.

statementType

StatementType

null

Mandatory to specify for IbatisProducer to control which iBatis SqlMapClient method to invoke. The enum values are: QueryForObject, QueryForList, Insert, Update, Delete.

maxMessagesPerPoll

int

0

An integer to define a maximum messages to gather per poll. By default, no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disabled it.

isolation

String

TRANSACTION_REPEATABLE_READ

Camel 2.9: A String the defines the transaction isolation level of the will be used. Allowed values are TRANSACTION_NONE, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE

isolation

String

TRANSACTION_REPEATABLE_READ

Camel 2.9: A String the defines the transaction isolation level of the will be used. Allowed values are TRANSACTION_NONE, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE

Wiki Markup
{div:class=confluenceTableSmall} || Option || Type || Default || Description || | {{consumer.onConsume}} | {{String}} | {{null}} | Statements to run after consuming. Can be used, for example, to update rows after they have been consumed and processed in Camel. See sample later. Multiple statements can be separated with comma. | | {{consumer.useIterator}} | {{boolean}} | {{true}} | If {{true}} each row returned when polling will be processed individually. If {{false}} the entire {{List}} of data is set as the IN body. | | {{consumer.routeEmptyResultSet}} | {{boolean}} | {{false}} | Sets whether empty result set should be routed or not. By default, empty result sets are not routed. | | {{statementType}} | {{StatementType}} | {{null}} | Mandatory to specify for IbatisProducer to control which iBatis {{SqlMapClient}} method to invoke. The enum values are: {{QueryForObject}}, {{QueryForList}}, {{Insert}}, {{Update}}, {{Delete}}. | | {{maxMessagesPerPoll}} | {{int}} | {{0}} | An integer to define a maximum messages to gather per poll. By default, no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disabled it. | | {{isolation}} | {{String}} | {{TRANSACTION_REPEATABLE_READ}} | *Camel 2.9:* A String the defines the transaction isolation level of the will be used. Allowed values are TRANSACTION_NONE, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE | | {{isolation}} | {{String}} | {{TRANSACTION_REPEATABLE_READ}} | *Camel 2.9:* A String the defines the transaction isolation level of the will be used. Allowed values are TRANSACTION_NONE, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE | {div}

Message Headers

Camel will populate the result message, either IN or OUT with a header with the operationName used:

Div
classconfluenceTableSmall

Header

Type

Description

CamelIBatisStatementName

String

The statementName used (for example: insertAccount).

CamelIBatisResult

Object

The response returned from iBatis in any of the operations. For instance an INSERT could return the auto-generated key, or number of rows etc.

Wiki Markup
{div:class=confluenceTableSmall} || Header || Type || Description || | {{CamelIBatisStatementName}} | {{String}} | The *statementName* used (for example: insertAccount). | | {{CamelIBatisResult}} | {{Object}} | The *response* returned from iBatis in any of the operations. For instance an {{INSERT}} could return the auto-generated key, or number of rows etc. | {div}

Message Body

The response from iBatis will only be set as body if it's a SELECT statement. That means, for example, for INSERT statements Camel will not replace the body. This allows you to continue routing and keep the original body. The response from iBatis is always stored in the header with the key CamelIBatisResult.

...