You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Stub Component

Available as of Camel 2.10

The stub: component provides a simple way to stub out any physical endpoints for easy testing. Just add stub: in front of any endpoint URI and things just work.

Under the covers the Stub component creates VM endpoints.

So if you are in development and want to try a route out but don't want to connect to a specific SMTP or Http endpoint, just put stub: in front and stub it out! (smile)

URI format

stub:someUri

Where someUri can be any URI at all with any query.

Note the main difference between Stub and VM is that VM will validate the URI and parameters you give it; so putting vm: in front of a typical URI with query arguments will typically fail; Stub wont though, it will basically ignore all the query parameters to let you quickly just stub out one or more endpoints in your route temporarily.

Examples

Here's a few samples

  • No labels