Permalink
Browse files

Merge pull request #1 from carlhoerberg/patch-1

Use a static ConnectionFactory
  • Loading branch information...
2 parents c5e7459 + b28657d commit 041a8cf9342aae3f4e94f5ba8811db4246ce21c9 @jamesward jamesward committed Jun 26, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/java/com/heroku/devcenter/SchedulerMain.java
@@ -16,8 +16,10 @@
public class SchedulerMain {
final static Logger logger = LoggerFactory.getLogger(SchedulerMain.class);
+ final static ConnectionFactory factory = new ConnectionFactory();
public static void main(String[] args) throws Exception {
+ factory.setUri(System.getenv("CLOUDAMQP_URL"));
Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
scheduler.start();
@@ -38,8 +40,6 @@ public static void main(String[] args) throws Exception {
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
- ConnectionFactory factory = new ConnectionFactory();
- factory.setUri(System.getenv("CLOUDAMQP_URL"));
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
String exchangeName = "sample-exchange";

0 comments on commit 041a8cf

Please sign in to comment.