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

时间:2015-10-21 18:21:43

标签: apache-camel netty

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

我检查了文档,我在休息时放了一个断点并检查了标题,属性,......到处都找不到合适的方法来获取这些信息。

标题日志:

GET:http://localhost:8080/category, {Accept = text / html,application / xhtml + xml,application / xml; q = 0.9,image / webp, / ; q = 0.8,Accept-Encoding = gzip,deflate,sdch,Accept-语言= 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 = / category,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,类似Gecko)Chrome / 46.0.2490.71 Safari / 537.36}

1 个答案:

答案 0 :(得分:0)

您应该填充两个标题:

CamelNettyLocalAddress和CamelNettyRemoteAddress。

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