Skip to content

Commit

Permalink
Reduced number of concurrent connections because there is a limit dep…
Browse files Browse the repository at this point in the history
…ending on the number of available cores times 2 in Grizzly's NetworkListener
  • Loading branch information
Christoph Seibert committed Apr 4, 2018
1 parent 3e0aa5a commit 1fd939b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ public void testConcurrency() throws Exception {
executeHystrixCommand(); // Execute a Hystrix command so that metrics are initialized.
List<EventInput> streamList = new ArrayList<EventInput>();
try {
// Fire 5 requests, validate their responses and hold these connections.
for (int i = 0; i < 5; i++) {
// Fire 3 requests, validate their responses and hold these connections.
for (int i = 0; i < 3; i++) {
EventInput stream = getStream();
System.out.println("Received Response for Request#" + (i + 1));
streamList.add(stream);
validateStream(stream, 1000);
System.out.println("Validated Response#" + (i + 1));
}

// Sixth request should fail since max configured connection is 5.
// Fourth request should fail since max configured connection is 3.
try {
streamList.add(getStreamFailFast());
Assert.fail("Expected 'ServiceUnavailableException' but, request went through.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
hystrix.stream.utilization.intervalInMilliseconds=10
hystrix.stream.dashboard.intervalInMilliseconds=10
hystrix.stream.config.intervalInMilliseconds=10
hystrix.stream.config.intervalInMilliseconds=10
hystrix.config.stream.maxConcurrentConnections=3

0 comments on commit 1fd939b

Please sign in to comment.