camel netty4http 和 camel rest dsl:获取远程地址

camel netty4http and camel rest dsl: Get remote address

我正在寻找一种使用 camel rest dsl 和 Netty4 Http 组件获取 ip 地址的方法。

我查看了文档,在我的休息处设置了一个断点,并检查了 headers、属性……所有地方,但找不到获取此信息的正确方法。

Headers 日志:

获取:http://localhost:8080/category, {接受=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q =0.8, Accept-Encoding=gzip, deflate, sdch, Accept-Language=fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4, breadcrumbId =ID-nateriver-54582-1445489005229-0-1,CamelCATEGORY_ACTION=listAction,CamelHttpMethod=GET,CamelHttpPath=,CamelHttpUri=/类别,CamelHttpUrl=http://localhost:8080/category,CamelJmsDeliveryMode=2,Connection=keep-alive, Content-Length=0, Cookie=JSESSIONID=fowfzar8n09e16ej9jui6nmsv, Host=localhost:8080, JMSCorrelationID=null, JMSDeliveryMode=2, JMSDestination=topic://Statistics, JMSExpiration=0, JMSMessageID=ID:nateriver -54592-1445489009836-3:1:7:1:1,JMSPriority=4,JMSRedelivered=false,JMSReplyTo=null,JMSTimestamp=1445489017233,JMSType=null,JMSXGroupID=null,JMSXUserID=null,Upgrade-Insecure-Requests=1 , User-Agent=Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36}

你应该得到两个 headers 填充:

CamelNettyLocalAddress 和 CamelNettyRemoteAddress。

请参阅此处 netty-http 的调试日志清楚地显示了这一点。 http://camel.465427.n5.nabble.com/How-to-create-case-insensitive-URI-route-with-netty4-http-td5766517.html#a5766558