Hystrix icon indicating copy to clipboard operation
Hystrix copied to clipboard

custom servlet url pattern does not work

Open omayevskiy opened this issue 12 years ago • 4 comments

If defining in web.xml

<servlet-mapping>
        <servlet-name>HystrixMetricsStreamServlet</servlet-name>
        <url-pattern>/my/hystrix.stream</url-pattern>
</servlet-mapping>

I cannot access it with hystrix-dashboard (commit 908a9a061faf24aab5bf7920b19ea970f4f32620) (yes I adjusted the url to http://myapp/my/hystrix.stream instead of http://myapp/hystrix.stream)

StackTrace:

ERROR  com.netflix.hystrix.dashboard.stream.ProxyStreamServlet:115 [ProxyStreamServlet] [doGet]: Error proxying request: http://localhost:8080/dealer-admin-GERMANY/hystrix.stream
java.lang.RuntimeException: org.mortbay.jetty.EofException
    at com.netflix.hystrix.dashboard.stream.ProxyStreamServlet.doGet(ProxyStreamServlet.java:109)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.mortbay.jetty.EofException
    at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:603)
    at com.netflix.hystrix.dashboard.stream.ProxyStreamServlet.doGet(ProxyStreamServlet.java:97)
    ... 19 more

How ever if we use the standard one:

<servlet-mapping>
        <servlet-name>HystrixMetricsStreamServlet</servlet-name>
        <url-pattern>/hystrix.stream</url-pattern>
</servlet-mapping>

then it works perfectly.

omayevskiy avatar Jul 16 '14 14:07 omayevskiy

I can't see in either the stream servlet, or the proxy servlet (https://github.com/Netflix/Hystrix/blob/master/hystrix-dashboard/src/main/java/com/netflix/hystrix/dashboard/stream/ProxyStreamServlet.java) anything that hard codes the /hystrix.stream URL.

I'm open to pull requests if you can find and fix the issue.

benjchristensen avatar Jul 16 '14 15:07 benjchristensen

without looking at the source code, can you reproduce this issue?

omayevskiy avatar Jul 17 '14 08:07 omayevskiy

I don't have time to debug this one right now as I have other higher priority items I'm working on. If you don't have time to figure out what's wrong and provide a fix, the issue can stay open until someone gets to it.

benjchristensen avatar Jul 17 '14 16:07 benjchristensen

Closing out due to age of issue. If there is something further please comment again on what needs to happen.

benjchristensen avatar Dec 12 '14 00:12 benjchristensen