Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.此内容没有您所选择的语言版本。
Chapter 149. Stub
Stub Component 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Available as of Camel 2.10
The stub: component provides a simple way to stub out any physical endpoints while in development or testing, allowing you for example to run a route without needing to actually connect to a specific SMTP or HTTP endpoint. Just add stub: in front of any endpoint URI to stub out the endpoint.
Internally the Stub component creates VM endpoints. 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 usually fail. Stub won't though, as it basically ignores all query parameters to let you quickly stub out one or more endpoints in your route temporarily.
URI format 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
stub:someUri
stub:someUri
Where
someUri
can be any URI with any query parameters.
Examples 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Here are a few samples:
- stub:smtp://somehost.foo.com?user=whatnot&something=else
- stub:http://somehost.bar.com/something