【问题标题】:camel netty4http and camel rest dsl: Get remote addresscamel netty4http 和 camel rest dsl:获取远程地址
【发布时间】:2015-10-21 18:21:43
【问题描述】:

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

我检查了文档,我在休息处放置了一个断点,并检查了标题、属性、......无处不在,但找不到获取此信息的正确方法。

标题日志:

获取: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- Language=fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4, breadcrumbId=ID-nariver-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:natriver-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}

【问题讨论】:

  • 你真的检查了标题吗?我使用netty,并且客户端在标题中可见。
  • 我做到了。我正在使用 Camel rest dsl 和 netty4 http 组件(不仅仅是 netty)。我检查了标题,(没有来自客户端的 IP 地址)。

标签: apache-camel netty


【解决方案1】:

您应该填充两个标题:

CamelNettyLocalAddress 和 CamelNettyRemoteAddress。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-04-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-02
    • 2018-07-02
    • 2015-09-13
    相关资源
    最近更新 更多