ThClient table reading activator
Reads records from a single 'ThClient' database table based on header values on the input message.
Reads records from the specified database table using the given offset and limit. This method reads records starting from the beginning of the table (as determined by GetFirst
) in database order (as determined by GetNext
).
Only the columns specified in the configuration of the ThClient connector are returned in the result set.
The input message must contain the following message headers:
- emagiz_thclient_database: the database to connect with; can be a
String
containing the database name defined in the configuration, aNumber
containing the database code defined in the configuration or an actualDatabaseDefinition
instance - emagiz_thclient_table: the table to read records from; can be a
String
containing the table name defined in the configuration, aNumber
containing the table code defined in the configuration or an actualTableDefinition
instance - emagiz_thclient_offset (int): offset (in number of records) from the beginning of the table where to start reading; negative values are treated as being zero (no offset)
- emagiz_thclient_limit (int): the maximum number of records to read; use
-1
for "unlimited", other negative values are treated as being zero
The output message is a Map
containing the following key/value pairs:
- <table name> (exactly one): the records that were read from the table as a
List
containing the records, with each record being aMap
of column names / field value pairs - _hasMore: a boolean indicating whether there were any more records in the table that weren't read after reaching the specified limit (not including records skipped because of the specified offset)
- _nextOffset (optional): an integer indicating the value for the offset that should be used in a subsequent call to retrieve the next set of records; only available when
_hasMore
istrue
The above output format is compatible with the input format of the JDBC result set to XML transformer.
ThClient connector
A fully configurated ThClientConnector
that this service activator will use to establish database connections.
Required
Method
Name of the Java method that will be called when a message is received.
The payload of the message will be passed to this method as a parameter. If the method has a return value, this will be used as the payload for the response message.
Requires reply
Specify whether the service method must return a non-null value. This value will be false
by default, but if set to true
, a ReplyRequiredException
will be thrown when the underlying service method returns a null
value.
Send timeout
Specify the maximum amount of time in milliseconds to wait when sending a reply message to the output channel.
By default the send will block for one second.
Advice can be added to change the behaviour of this endpoint, for example to add retry logic in case of failures. The following types of advice are available:
Retry advice: allows configuration of sophisticated retry scenarios; this includes specifying policies for retry attemps, backoff periods between attempts and the recovery strategy when retries are exhausted Circuit breaker: if a certain number of consecutive attempts fails, new requests will fail fast and no attempt will be made to invoke the request handler again until some time has expired Expression evaluating advice: general advice that evaluates a configurable SpEL expression on successful and/or failed attempts, and optionally can send a message to a success channel and/or failure channel
By adding multiple advices to this endpoint you can create even more complex combined behaviour. For example, if you add a circuit breaker and a retry advice, you can create a scenario where the circuit breaker only opens when all retries are exhaused. Note that the order of the advice types is important, as switching the order will change the combined behaviour: the first item in the list will be the top of the advice chain, meaning it will be the last advice that is evaluated. Also note that if any advice "traps" exceptions, all advices higher up in the chain won't know about any failures.
Output channel
Channel where output messages should be sent after (successfully) processing the input message.
You can select the nullChannel
here to silently drop the output messages.
Required
Input channel
Channel to consume the input messages from.
Required
Id
Name that uniquely identifies this flow component.
Required