Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
f18aeab8
Commit
f18aeab8
authored
Jan 22, 2015
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace some of the log/printStackTraces with ignores
Fixes gh-153
parent
a45c0cce
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
17 deletions
+11
-17
SpringDecoder.java
...rg/springframework/cloud/netflix/feign/SpringDecoder.java
+3
-5
SendResponseFilter.java
...k/cloud/netflix/zuul/filters/post/SendResponseFilter.java
+0
-7
HystrixStreamTask.java
...ringframework/netflix/hystrix/amqp/HystrixStreamTask.java
+6
-3
HystrixDashboardConfiguration.java
...flix/hystrix/dashboard/HystrixDashboardConfiguration.java
+2
-2
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/SpringDecoder.java
View file @
f18aeab8
...
...
@@ -16,6 +16,8 @@
package
org
.
springframework
.
cloud
.
netflix
.
feign
;
import
static
org
.
springframework
.
cloud
.
netflix
.
feign
.
FeignUtils
.
getHttpHeaders
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.lang.reflect.ParameterizedType
;
...
...
@@ -23,7 +25,6 @@ import java.lang.reflect.Type;
import
javax.inject.Provider
;
import
lombok.extern.apachecommons.CommonsLog
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.web.HttpMessageConverters
;
import
org.springframework.http.HttpHeaders
;
...
...
@@ -36,12 +37,9 @@ import feign.Response;
import
feign.codec.DecodeException
;
import
feign.codec.Decoder
;
import
static
org
.
springframework
.
cloud
.
netflix
.
feign
.
FeignUtils
.
getHttpHeaders
;
/**
* @author Spencer Gibb
*/
@CommonsLog
public
class
SpringDecoder
implements
Decoder
{
@Autowired
...
...
@@ -93,7 +91,7 @@ public class SpringDecoder implements Decoder {
this
.
response
.
body
().
close
();
}
catch
(
IOException
ex
)
{
log
.
error
(
"Error closing response body"
,
ex
);
// Ignore exception on close...
}
}
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/post/SendResponseFilter.java
View file @
f18aeab8
...
...
@@ -34,12 +34,10 @@ import com.netflix.zuul.ZuulFilter;
import
com.netflix.zuul.constants.ZuulConstants
;
import
com.netflix.zuul.constants.ZuulHeaders
;
import
com.netflix.zuul.context.RequestContext
;
import
lombok.extern.apachecommons.CommonsLog
;
/**
* @author Spencer Gibb
*/
@CommonsLog
public
class
SendResponseFilter
extends
ZuulFilter
{
private
static
DynamicBooleanProperty
INCLUDE_DEBUG_HEADER
=
DynamicPropertyFactory
...
...
@@ -149,17 +147,12 @@ public class SendResponseFilter extends ZuulFilter {
byte
[]
bytes
=
new
byte
[
INITIAL_STREAM_BUFFER_SIZE
.
get
()];
int
bytesRead
=
-
1
;
while
((
bytesRead
=
zin
.
read
(
bytes
))
!=
-
1
)
{
// TODO
// if (Debug.debugRequest() && !Debug.debugRequestHeadersOnly()) {
// Debug.addRequestDebug("OUTBOUND: < " + new String(bytes, 0, bytesRead));
// }
try
{
out
.
write
(
bytes
,
0
,
bytesRead
);
out
.
flush
();
}
catch
(
IOException
ex
)
{
// ignore
log
.
debug
(
"Error writing response"
,
ex
);
}
// doubles buffer size if previous read filled it
if
(
bytesRead
==
bytes
.
length
)
{
...
...
spring-cloud-netflix-hystrix-amqp/src/main/java/org/springframework/netflix/hystrix/amqp/HystrixStreamTask.java
View file @
f18aeab8
...
...
@@ -23,6 +23,7 @@ import java.util.Collection;
import
java.util.concurrent.LinkedBlockingQueue
;
import
lombok.extern.apachecommons.CommonsLog
;
import
org.codehaus.jackson.JsonFactory
;
import
org.codehaus.jackson.JsonGenerator
;
import
org.springframework.beans.BeansException
;
...
...
@@ -77,21 +78,23 @@ public class HystrixStreamTask implements ApplicationContextAware {
this
.
jsonMetrics
.
drainTo
(
metrics
);
if
(!
metrics
.
isEmpty
())
{
if
(
log
.
isTraceEnabled
())
{
log
.
trace
(
"sending amqp metrics size: "
+
metrics
.
size
());
}
for
(
String
json
:
metrics
)
{
// TODO: batch all metrics to one message
try
{
this
.
channel
.
send
(
json
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"Error sending json to channel"
,
ex
);
if
(
log
.
isTraceEnabled
())
{
log
.
trace
(
"failed sending amqp metrics: "
+
ex
.
getMessage
());
}
}
}
}
}
// @InboundChannelAdapter()
// TODO: move fixedRate to configuration
@Scheduled
(
fixedRateString
=
"${hystrix.stream.amqp.gatherRate:500}"
)
public
void
gatherMetrics
()
{
try
{
...
...
spring-cloud-netflix-hystrix-dashboard/src/main/java/org/springframework/cloud/netflix/hystrix/dashboard/HystrixDashboardConfiguration.java
View file @
f18aeab8
...
...
@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
lombok.extern.apachecommons.CommonsLog
;
import
org.apache.http.Header
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.HttpStatus
;
...
...
@@ -49,7 +50,6 @@ import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
*/
@SuppressWarnings
(
"deprecation"
)
@Configuration
@CommonsLog
public
class
HystrixDashboardConfiguration
{
private
static
final
String
DEFAULT_TEMPLATE_LOADER_PATH
=
"classpath:/templates/"
;
...
...
@@ -209,7 +209,7 @@ public class HystrixDashboardConfiguration {
is
.
close
();
}
catch
(
Exception
ex
)
{
log
.
debug
(
"Error closing input stream"
,
ex
);
// ignore errors on close
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment