此内容没有您所选择的语言版本。

Chapter 153. 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
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
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.