Tag: apache camel

Exchange.getIn()。getBody()在第二次调用时返回camel中的空字符串

我有2个相同的电话: String msg1 = exchange.getIn().getBody(String.class); String msg2 = exchange.getIn().getBody(String.class); 在msg1中,我得到了正确的期望值,但msg2是一个空字符串。 我没有设置Out消息,所以交换In消息应该仍然完好无损。 请解释为什么会这样。 骆驼路线: Hello World ${header.firedTime} 处理器仅包含上面的2个语句。 route1中的处理是正确的,但是在route2中我得到了描述的行为:第一次调用 – 有效字符串,第二次调用 – 空字符串。 所以我想也许它与HttpMessage转换有关。

Apache Camel http到http路由(有可能吗?)

我现在开始与Camel。 我见过http客户端的http4组件和http服务器的jetty组件。 我见过几个使用其中一个的例子。 我想知道是否可以将它们组合在一起。 例 from(“jetty:http://0.0.0.0:8080/myapp/myservice”) .to(“http4://www.google.com”); 这将使骆驼成为一个简单的基于http的路由器/代理。 Web浏览器会点击骆驼url而不是google。 (谷歌只是一个例子,我有一个真正的基于POST的服务,我想使用) 这条路线可行吗? 我应该研究Camel还是我需要一个不同的软件框架? 将来我还需要在两者之间添加转换/filter​​。 我试过它并获得了一个nullpointerexception [qtp757856402-14] SendProcessor DEBUG >>>> Endpoint[http4://www.google.com] Exchange[Message: [Body is instance of java.io.InputStream]] [qtp757856402-14] DefaultErrorHandler DEBUG Failed delivery for exchangeId: ID-IT12-53265-1302683969823-0-1. On delivery attempt: 0 caught: java.lang.NullPointerException [qtp757856402-14] DefaultErrorHandler ERROR Failed delivery for exchangeId: ID-IT12-53265-1302683969823-0-1. Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException java.lang.NullPointerException

Apache Camel – 在启动时触发任务仅运行一次

我正在使用Camel和Spring开发Java项目。 我们想在Spring完成它的事情并且Camel完成构建所有路由之后在单例bean上触发初始化方法。 我们不能在类创建时调用该方法,因为它与从@Component spring注释中获取的其他类具有动态链接,并且我们不知道何时/是否已经加载这些类以实际运行init方法作为a的一部分构造函数。 如何在Camel启动完成后立即调用一个或多个方法来运行? 谢谢!

引起:java.net.SocketException:来自服务器的文件意外结束

当我通过SOAP UI运行WS时,我正在间歇地得到以下错误。 有时它不起作用,然后它继续工作,然后有时它不起作用。 另一个问题是测试Web服务工作正常,客户端没有任何问题,但我们切换到生产问题的时刻。 谷歌搜索并做了一些更改(HttpConfig超时,jetty maxIdleTime)但仍然无法使其工作:(任何想法如何我可以缩小问题是什么? org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024] Caused by: java.net.SocketException: SocketException invoking https://www.website:443/gateway/ServicePortV2: Unexpected end of file from server at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.7.0_25] Caused by: java.net.SocketException: Unexpected end of file from server at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:718)[:1.7.0_25] at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)[:1.7.0_25] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1322)[:1.7.0_25] at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)[:1.7.0_25] at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)[:1.7.0_25] at org.apache.cxf.transport.http.HTTPConduit.processRetransmit(HTTPConduit.java:1004)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024] at org.apache.cxf.transport.http.HTTPConduit.access$400(HTTPConduit.java:148)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024] at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRetransmits(HTTPConduit.java:1504)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024] […]