Skip to content

Commit 246bf61

Browse files
committed
Fix links in Queue-Based Load Leveling blog
1 parent eaee2b0 commit 246bf61

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

_posts/queue-load-leveling/2017-01-13-queue-load-leveling.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Queue-Based Load Leveling Pattern
44
author: cha
55
---
66

7-
![Queue-Based Load Leveling]({{ site.baseurl }}/assets/queue-load-leveling-title.png)
7+
![Queue-Based Load Leveling]({{ site.baseurl }}/assets/queue-load-leveling-title.png)
88

99
## Problem
1010
Many solutions in the cloud involve running tasks that invoke services. In this environment, if a service is subjected to intermittent heavy loads, it can cause performance or reliability issues. If the same service is utilized by a number of tasks running concurrently, it can be difficult to predict the volume of requests to which the service might be subjected at any given point in time. It is possible that a service might experience peaks in demand that cause it to become overloaded and unable to respond to requests in a timely manner.
@@ -21,27 +21,27 @@ The queue effectively decouples the tasks from the service, and the service can
2121
## Benefits
2222
* It can help to maximize availability because delays arising in services will not have an immediate and direct impact on the application, which can continue to post messages to the queue even when the service is not available or is not currently processing messages.
2323
* It can help to maximize scalability because both the number of queues and the number of services can be varied to meet demand.
24-
* It can help to control costs because the number of service instances deployed needs only to be sufficient to meet average
24+
* It can help to control costs because the number of service instances deployed needs only to be sufficient to meet average
2525
load rather than the peak load.
2626

2727
## Implementation
2828
* We will demonstrate Queue-Based Load Leveling Pattern by developing a simple application.
2929
* Following are the core classes in the application,
3030
- TaskGenerator: This is the service requester class where we create any number of requests and submit them to the Task Queue. Each TaskGenerator instance is a Thread. Each requester submits requests at its own rate.
31-
32-
<script src="http://gist-it.appspot.com/http://github.com/iluwatar/java-design-patterns/raw/master/queue-load-leveling/src/main/java/org/queue/load/leveling/TaskGenerator.java?slice=27:89"></script>
33-
31+
32+
<script src="http://gist-it.appspot.com/http://github.com/iluwatar/java-design-patterns/raw/master/queue-load-leveling/src/main/java/com/iluwatar/queue/load/leveling/TaskGenerator.java?slice=27:89"></script>
33+
3434
- Message: TaskGenerators create objects of Message class and submit them to the MessageQueue.
35-
36-
<script src="http://gist-it.appspot.com/http://github.com/iluwatar/java-design-patterns/raw/master/queue-load-leveling/src/main/java/org/queue/load/leveling/Message.java?slice=28:47"></script>
37-
35+
36+
<script src="http://gist-it.appspot.com/http://github.com/iluwatar/java-design-patterns/raw/master/queue-load-leveling/src/main/java/com/iluwatar/queue/load/leveling/Message.java?slice=28:47"></script>
37+
3838
- MessageQueue: In this class we have a BlockingQueue which takes messages submitted from the TaskGenerators. This class is just used for storing and retreiving tasks from the Queue.
39-
40-
<script src="http://gist-it.appspot.com/http://github.com/iluwatar/java-design-patterns/raw/master/queue-load-leveling/src/main/java/org/queue/load/leveling/MessageQueue.java?slice=30:77"></script>
41-
39+
40+
<script src="http://gist-it.appspot.com/http://github.com/iluwatar/java-design-patterns/raw/master/queue-load-leveling/src/main/java/com/iluwatar/queue/load/leveling/MessageQueue.java?slice=30:77"></script>
41+
4242
- ServiceExecutor: Picks up the tasks from the MessageQueue and serves them. The ServiceRequester picks up requests at constant rate even though the TaksGenerators submitted at a different rate.
43-
44-
<script src="http://gist-it.appspot.com/http://github.com/iluwatar/java-design-patterns/raw/master/queue-load-leveling/src/main/java/org/queue/load/leveling/ServiceExecutor.java?slice=28:67"></script>
43+
44+
<script src="http://gist-it.appspot.com/http://github.com/iluwatar/java-design-patterns/raw/master/queue-load-leveling/src/main/java/com/iluwatar/queue/load/leveling/ServiceExecutor.java?slice=28:67"></script>
4545

4646
## Output
4747
Running the test application produces the following output:
@@ -65,7 +65,7 @@ load rather than the peak load.
6565
21:04:11.913 [pool-1-thread-2] INFO org.queue.load.leveling.App - Message-3 submitted by pool-1-thread-1 is served.
6666
21:04:12.914 [pool-1-thread-2] INFO org.queue.load.leveling.App - Message-2 submitted by pool-1-thread-1 is served.
6767
21:04:13.914 [pool-1-thread-2] INFO org.queue.load.leveling.App - Message-1 submitted by pool-1-thread-1 is served.
68-
21:04:14.915 [pool-1-thread-2] INFO org.queue.load.leveling.App - Service Executor: Waiting for Messages to serve ..
68+
21:04:14.915 [pool-1-thread-2] INFO org.queue.load.leveling.App - Service Executor: Waiting for Messages to serve ..
6969
21:04:15.915 [pool-1-thread-2] INFO org.queue.load.leveling.App - Service Executor: Waiting for Messages to serve ..
7070
```
7171

0 commit comments

Comments
 (0)