JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-2728

Add remote client address to message properties

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.4.4
  • Fix Version/s: 1.4.4
  • Component/s: Transport: HTTP(S) / Jetty, Transport: TCP / UDP / SSL / Multicast
  • Labels:
    None
  • Environment:

    All.

  • User impact:
    Low
  • Similar Issues:
    None

Description

Currently, when an exception is raised when processing a message from an http client, information accompanying the exception stacktrace does not include the address of the client. This complicates troubleshooting. A patch similar to that mentioned at http://mule.mulesource.org/display/MULE/mail/5571095 should solve this problem. The mail concerned talks about patching the tcp implementation in Mule.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    HttpMessageReceiver.java.diff
    26/Nov/07 12:56 AM
    2 kB
    Hann Wei Toh

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Hann Wei Toh added a comment - 26/Nov/07 12:56 AM

A patch for org.mule.providers.http.HttpMessageReceiver is attached. It adds the instance variable remoteClientAddress. The value comes from socket.getRemoteSocketAddress ().toString (). After a MuleMessage is instantiated, and before routeMessage() is invoked, the remote client address is stored as the property named MULE_REMOTE_CLIENT_ADDRESS of the MuleMessage.

This allows us to see the http client address in an exception stacktrace, for example:

jvm 1 | at org.mule.providers.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:187)
jvm 1 | at org.mule.providers.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:155)
jvm 1 | at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
jvm 1 | at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:9
87)
jvm 1 | at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
528)
jvm 1 | at java.lang.Thread.run(Unknown Source)
jvm 1 |
jvm 1 | ********************************************************************************
jvm 1 |
jvm 1 | 14:18:30,587 ERROR oadExceptionStrategy [eiver.2]: Message being processed is: org.mule.providers.http.HttpMe
ssageAdapter/org.mule.providers.http.HttpMessageAdapter@6a435f{id=685f29ed-9be7-11dc-b791-95c48a029aff, payload=[B, corr
elationId=null, correlationGroup=-1, correlationSeq=-1, encoding=UTF-8, exceptionPayload=null, properties={
jvm 1 | MULE_REMOTE_SYNC=true
jvm 1 | http.version=HTTP/1.1
jvm 1 | Authorization=Basic YW5vbjphbm9ucGFzc3dk
jvm 1 | User-Agent=curl/7.16.3 (i686-pc-cygwin) libcurl/7.16.3 OpenSSL/0.9.8e zlib/1.2.3 libssh2/0.15-CVS
jvm 1 | MULE_REMOTE_CLIENT_ADDRESS=/127.0.0.1:4459
jvm 1 | Accept=/
jvm 1 | MULE_ORIGINATING_ENDPOINT=OperationTypeCheckerSyncEndpoint
jvm 1 | Content-Length=38
jvm 1 | Content-Type=application/x-www-form-urlencoded
jvm 1 | http.method=POST
jvm 1 | http.request=/OperationTypeChecker
jvm 1 | Host=localhost:7000
jvm 1 | }}

Show
Hann Wei Toh added a comment - 26/Nov/07 12:56 AM A patch for org.mule.providers.http.HttpMessageReceiver is attached. It adds the instance variable remoteClientAddress. The value comes from socket.getRemoteSocketAddress ().toString (). After a MuleMessage is instantiated, and before routeMessage() is invoked, the remote client address is stored as the property named MULE_REMOTE_CLIENT_ADDRESS of the MuleMessage. This allows us to see the http client address in an exception stacktrace, for example: jvm 1 | at org.mule.providers.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:187) jvm 1 | at org.mule.providers.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:155) jvm 1 | at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310) jvm 1 | at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:9 87) jvm 1 | at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: 528) jvm 1 | at java.lang.Thread.run(Unknown Source) jvm 1 | jvm 1 | ******************************************************************************** jvm 1 | jvm 1 | 14:18:30,587 ERROR oadExceptionStrategy [eiver.2]: Message being processed is: org.mule.providers.http.HttpMe ssageAdapter/org.mule.providers.http.HttpMessageAdapter@6a435f{id=685f29ed-9be7-11dc-b791-95c48a029aff, payload=[B, corr elationId=null, correlationGroup=-1, correlationSeq=-1, encoding=UTF-8, exceptionPayload=null, properties={ jvm 1 | MULE_REMOTE_SYNC=true jvm 1 | http.version=HTTP/1.1 jvm 1 | Authorization=Basic YW5vbjphbm9ucGFzc3dk jvm 1 | User-Agent=curl/7.16.3 (i686-pc-cygwin) libcurl/7.16.3 OpenSSL/0.9.8e zlib/1.2.3 libssh2/0.15-CVS jvm 1 | MULE_REMOTE_CLIENT_ADDRESS=/127.0.0.1:4459 jvm 1 | Accept=/ jvm 1 | MULE_ORIGINATING_ENDPOINT=OperationTypeCheckerSyncEndpoint jvm 1 | Content-Length=38 jvm 1 | Content-Type=application/x-www-form-urlencoded jvm 1 | http.method=POST jvm 1 | http.request=/OperationTypeChecker jvm 1 | Host=localhost:7000 jvm 1 | }}
Hide
Permalink
Andrew Perepelytsya added a comment - 28/Nov/07 01:10 PM

http://fisheye.codehaus.org/changelog/mule/?cs=9936
http://fisheye.codehaus.org/changelog/mule/?cs=9937

Thanks for the patch. I've reworked it to better fit the existing API, as well as applied it to TCP/SSL/HTTPS/Multicast transports.

Show
Andrew Perepelytsya added a comment - 28/Nov/07 01:10 PM http://fisheye.codehaus.org/changelog/mule/?cs=9936 http://fisheye.codehaus.org/changelog/mule/?cs=9937 Thanks for the patch. I've reworked it to better fit the existing API, as well as applied it to TCP/SSL/HTTPS/Multicast transports.

People

  • Assignee:
    Andrew Perepelytsya
    Reporter:
    Hann Wei Toh
Vote (0)
Watch (1)

Dates

  • Created:
    26/Nov/07 12:45 AM
    Updated:
    28/Nov/07 01:10 PM
    Resolved:
    28/Nov/07 01:10 PM

Time Tracking

Estimated:
1d
Original Estimate - 1 day
Remaining:
1d
Remaining Estimate - 1 day
Logged:
Not Specified
Time Spent - Not Specified

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.