Validating route behavior under heavy load
Every so often you will find yourself developing routes that you need to validate for performance under load, as well as their general correctness. The mocking techniques that have been discussed so far will only help you determine whether a test message correctly exercises the route.
This recipe will show how you can use the DataSet
Component to generate a set of test data and play it through your route. It will then demonstrate how this same component can be used as a bulk mocking mechanism to validate your route logic under load. This technique is not a replacement for proper system integration load testing. It provides a means to more easily unit test scenarios involving larger numbers of messages.
Consider the following routing logic, which is defined in a RouteBuilder
implementation that includes property setters allowing us to inject start and end URIs:
public class SlowlyTransformingRouteBuilder extends RouteBuilder { private String...