Apache camel 带有netty4 http的两个捆绑包—一个服务器和一个客户机服务—加载客户机不使用的负载';T
随后的客户端骆驼上下文加载并运行良好。此原子服务通过DIRECT vm接受来自其他捆绑包的请求,以连接到外部REST服务器Apache camel 带有netty4 http的两个捆绑包—一个服务器和一个客户机服务—加载客户机不使用的负载';T,apache-camel,netty4,Apache Camel,Netty4,随后的客户端骆驼上下文加载并运行良好。此原子服务通过DIRECT vm接受来自其他捆绑包的请求,以连接到外部REST服务器 <camelContext id="_camuatomicservicecontext" xmlns="http://camel.apache.org/schema/blueprint"> <route id="_camuatomicserviceroute1">
<camelContext id="_camuatomicservicecontext" xmlns="http://camel.apache.org/schema/blueprint">
<route id="_camuatomicserviceroute1">
<from id="_from1" uri="direct-vm:camuatomicservice">
<description>accepts vm messages directly </description>
</from>
<log id="_log1" message="Camu Atomic Service body = ${body}, header= ${header.uriPattern}"/>
<setHeader headerName="api.key" id="_setHeader1">
<constant>"9GC1hnEeNIWVbehmxxjUwkj1Wcx2Y-P7SgOUZvVUzkM"</constant>
</setHeader>
<setHeader headerName="CamelHttpPath" id="_setHeader1">
<simple>${header.uriPattern}</simple>
</setHeader>
<setHeader headerName="CamelHttpMethod" id="_setHeader2">
<simple>${header.CamelHttpMethod}</simple>
</setHeader>
<to id="_to1" pattern="InOut" uri="netty4-http:http:{{camu.host}}:{{camu.port}}/{{camu.path}}?matchOnUriPrefix=true"/>
<log id="_log2" message="CamuAtomicService Response body ${body}"/>
</route>
</camelContext>
直接接受vm消息
“9GC1HNENIWVBEHMXXJUWKJ1WCX2Y-P7SGOUZVUZKM”
${header.uriPattern}
${header.CamelHttpMethod}
所以我想要一个模型API来测试。我在另一个包中创建了以下上下文以进行测试。但它拒绝启动。我在文档中读到,同一主机和端口上的netty4 http组件必须具有相同的配置。但它仍然不会启动
<camelContext id="_camumockcontext1" xmlns="http://camel.apache.org/schema/blueprint">
<route id="_camumockroute1">
<from id="_from1" pattern="InOut" uri="netty4-http:http:localhost:8288/external?matchOnUriPrefix=true">
<description>Mock the Camu API</description>
</from>
<process id="_process1" ref="CogMockProcessor"/>
<log id="_log1" message="Made it here CamuMock headers = ${headers}"/>
</route>
</camelContext>
模拟camuapi
我尝试了log:set DEBUG,但在hawtio中没有看到与此捆绑包相关的任何内容。原因是与另一个捆绑包的端口冲突。然而,尽管我在blueprint和properties中更改了端口,并将其提交给本地git repo,但构建没有更新jar文件,这意味着端口没有更改以匹配源代码。我去了目标,删除了jar文件,重建并重新部署了它。吸取的教训如果来源看起来不错,但有些东西不起作用,请在hawtio中再次检查您所做的更改是否生效