Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added dataSetIndex option

DataSet Component

Include Page
Testing Summary Include
Testing Summary Include

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 format

Code Block

dataset:name[?options]

Where name is used to find the DataSet instance in the Registry

...

Div
classconfluenceTableSmall

Option

Default

Description

produceDelay

3

Allows a delay in ms to be specified, which causes producers to pause in order to simulate slow producers. Uses a minimum of 3 ms delay unless you set this option to -1 to force no delay at all.

consumeDelay

0

Allows a delay in ms to be specified, which causes consumers to pause in order to simulate slow consumers.

preloadSize

0

Sets how many messages should be preloaded (sent) before the route completes its initialization.

initialDelay

1000

Camel 2.1: Time period in millis to wait before starting sending messages.

minRate

0

Wait until the DataSet contains at least this number of messages

dataSetIndexlenient

Camel 2.17: Controls the behavior of the CamelDataSetIndex header. The supported values are strict, lenient and off. The default behavior prior to Camel 2.17 can be restored using dataSetIndex=strict

For consumers:
- strict or lenient => The CamelDataSetIndex header will always be set
- off => The CamelDataSetIndex header will not be set

For producers:
- strict => The CamelDataSetIndex header must be present and the value of the header will be verified
- lenient => If the CamelDataSetIndex header is present, the value of the header will be verified. If the header is not present, it will be set.
- off => If the CamelDataSetIndex header is present, the value of the header will not be verified. If the header is not present, it will not be set.

 

You can append query options to the URI in the following format, ?option=value&option=value&...

...

Camel will lookup in the Registry for a bean implementing the DataSet interface. So you can register your own DataSet as:

Code Block
xml
xml

   <bean id="myDataSet" class="com.mycompany.MyDataSet">
      <property name="size" value="100"/>
   </bean>

...

For example, to test that a set of messages are sent to a queue and then consumed from the queue without losing any messages:

Code Block

// 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");

...

Div
classconfluenceTableSmall

Property

Type

Default

Description

defaultBody

Object

<hello>world!</hello>

Specifies the default message body. For SimpleDataSet it is a constant payload; though if you want to create custom payloads per message, create your own derivation of DataSetSupport.

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 size / 5, if is 0 then size, else set to reportCount value.

size

long

10

Specifies how many messages to send/consume.

Include Page
Endpoint See Also
Endpoint See Also