Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

article updates for better connection handling

  • Loading branch information...
commit c5e745974a07bf2949678df27247f53dd050c3f8 1 parent 480568d
@jamesward jamesward authored
Showing with 15 additions and 16 deletions.
  1. +7 −2 ARTICLE.md
  2. +8 −14 README.md
View
9 ARTICLE.md
@@ -129,6 +129,7 @@ The `SchedulerMain` class needs to be updated to add a new message onto a queue
byte[] body = msg.getBytes("UTF-8");
channel.basicPublish(exchangeName, routingKey, null, body);
logger.info("Message Sent: " + msg);
+ connection.close();
}
catch (Exception e) {
logger.error(e.getMessage(), e);
@@ -138,7 +139,7 @@ The `SchedulerMain` class needs to be updated to add a new message onto a queue
}
-In this example every time the `HelloJob` is executed it adds a message onto a RabbitMQ message queue simply containing a String with the time the String was created. Running the updated `SchedulerMain` should add a new message to the queue every 2 seconds.
+In this example every time the `HelloJob` is executed it adds a message onto a RabbitMQ message queue simply containing a String with the time the String was created. Running the updated `SchedulerMain` should add a new message to the queue every 5 seconds.
Processing Jobs From a Queue
@@ -243,8 +244,12 @@ You can verify that this is happening by watching the Heroku logs for your appli
You should see something like:
-*** NEED OUTPUT ***
+ 2012-06-26T22:26:47+00:00 app[scheduler.1]: 100223 [DefaultQuartzScheduler_Worker-1] INFO com.heroku.devcenter.SchedulerMain - Message Sent: Sent at:1340749607126
+ 2012-06-26T22:26:47+00:00 app[worker.2]: 104798 [main] INFO com.heroku.devcenter.WorkerMain - Message Received: Sent at:1340749607126
+ 2012-06-26T22:26:52+00:00 app[scheduler.1]: 105252 [DefaultQuartzScheduler_Worker-2] INFO com.heroku.devcenter.SchedulerMain - Message Sent: Sent at:1340749612155
+ 2012-06-26T22:26:52+00:00 app[worker.1]: 109738 [main] INFO com.heroku.devcenter.WorkerMain - Message Received: Sent at:1340749612155
+In this example execution the scheduler creates 2 messages which are handled by the two different worker Dynos. This shows that the work is being scheduled and distributed correctly.
Further Leaning
---------------
View
22 README.md
@@ -1,14 +1,8 @@
-# Embedded Jetty template application
-
-This is a template for a web application that uses embedded Jetty. The sample code consists of a JSP (this page) and a simple servlet.
-
-## Running the application locally
-
-First build with:
-
- $mvn clean install
-
-Then run it with:
-
- $java -cp target/classes:target/dependency/* com.example.Main
-
+# Run on Heroku
+
+ heroku create
+ heroku addons:add cloudamqp
+ git push heroku master
+ heroku scale scheduler=1
+ heroku scale worker=2
+ heroku logs -t

0 comments on commit c5e7459

Please sign in to comment.
Something went wrong with that request. Please try again.