http - 使用 Apache Camel 做一个火而忘记 HTTP 请求

标签 http apache-camel apache-httpclient-4.x asynchttpclient

我想知道是否可以执行 HTTP POST 请求并忘记,不要等到收到响应。我不确定我应该使用 HTTP 组件还是 AHC,我想 AHC 更适合我的场景。

我正在使用 Apache Camel 2.12.1 和 Spring XML。如果可能,我该如何实现?

谢谢!

最佳答案

在 http4 和 ahc Camel 组件之间进行选择不是异步问题,而是重负载下的性能问题。换句话说,如果你的请求率很小或中等,http4 组件就足够了。

无论目标组件是什么,都有几种实现“请求即发即弃”的方法:

在这两种情况下,请求都将在单独的线程中执行,因此调用者不会等待。

关于http - 使用 Apache Camel 做一个火而忘记 HTTP 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20134860/

相关文章:

apache-camel - Camel : Is it Possible to Implement Request/Reply & Competing Consumers with the Help of Asynchronous Processor?

java - 如何在 java 中设置 SSL 协议(protocol)版本?我怎么知道是哪一个? javax.net.ssl.SSLException : Received fatal alert: protocol_version 异常

java - 上传带有附加信息的多个文件(Spring RestController)

python - 在python中很好地使用连字符访问字段名称

java - MongoDB 身份验证和 Apache Camel 的问题

java - 写入 Apache Camel OPC UA 服务器失败,但返回良好的 StatusCode

authentication - Apache HttpClient 4.3.1 中使用 HTTP 隧道/HTTPS 连接的抢占式代理身份验证

java - HttpClient javax.net.ssl.SSLPeerUnverifiedException : peer not authenticated when time shifted?

asp.net-core - Blazor 项目中出现 "No connection could be made because the target machine actively refused it."错误

rest - 有效请求但空数据的正确 REST 响应代码是什么?