Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
DataSet ComponentTesting of distributed and asynchronous processing is notoriously difficult. The Mock, Test and DataSet endpoints work great with the Camel Testing Framework to simplify your unit and integration testing using Enterprise Integration Patterns and Camel's large range of Components together with the powerful Bean Integration. The DataSet component provides a mechanism to easily perform load & soak testing of your system. It works by allowing you to create DataSet instances both as a source of messages and as a way to assert that the data set is received. Camel will use the throughput logger when sending dataset's. URI formatdataset:name[?options] Where Camel ships with a support implementation of Camel also ships with some implementations that can be used for testing:
all of which extend Options
You can append query options to the URI in the following format: Configuring DataSetCamel will lookup in the Registry for a bean implementing the <bean id="myDataSet" class="com.mycompany.MyDataSet"> <property name="size" value="100"/> </bean> ExampleFor example, to test that a set of messages are sent to a queue and then consumed from the queue without losing any messages: // Send the dataset to a queue from("dataset:foo") .to("activemq:SomeQueue"); // Now lets test that the messages are consumed correctly from("activemq:SomeQueue") .to("dataset:foo"); The above would look in the Registry to find the
|
Property | Type | Default | Description |
---|---|---|---|
|
|
| Specifies the default message body. For |
|
| null |
|
|
|
| Specifies how many messages to send/consume. |
reportCount | long | -1 | Specifies the number of messages to be received before reporting progress. Useful for showing progress of a large load test. If < 0, then If == 0 then Else set to |
SimpleDataSet
The SimpleDataSet
extends DataSetSupport
, and adds a default body.
Additional Properties on SimpleDataSet
Property | Type | Default | Description |
---|---|---|---|
|
|
| Specifies the default message body. By default, the |
ListDataSet (Camel 2.17)
The ListDataSet
extends DataSetSupport
, and adds a list of default bodies.
Additional Properties on ListDataSet
Property | Type | Default | Description |
---|---|---|---|
|
|
| Specifies the default message body. By default, the |
|
| the size of the | Specifies how many messages to send/consume. This value can be different from the size of the |
FileDataSet (Camel 2.17)
The SimpleDataSet
extends ListDataSet
, and adds support for loading the bodies from a file.
Additional Properties on FileDataSet
Property | Type | Default | Description |
---|---|---|---|
|
| null | Specifies the source file for payloads |
|
| \z | Specifies the delimiter pattern used by a |