Skip to content

Commit 0f59c10

Browse files
author
Ann Witbrock
committed
Tidied Exceptions
1 parent e3997e7 commit 0f59c10

File tree

10 files changed

+18
-35
lines changed

10 files changed

+18
-35
lines changed

java/EmitLog.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import java.io.IOException;
21
import com.rabbitmq.client.ConnectionFactory;
32
import com.rabbitmq.client.Connection;
43
import com.rabbitmq.client.Channel;
@@ -7,8 +6,7 @@ public class EmitLog {
76

87
private static final String EXCHANGE_NAME = "logs";
98

10-
public static void main(String[] argv)
11-
throws java.io.IOException {
9+
public static void main(String[] argv) throws Exception {
1210

1311
ConnectionFactory factory = new ConnectionFactory();
1412
factory.setHost("localhost");
@@ -41,5 +39,5 @@ private static String joinStrings(String[] strings, String delimiter) {
4139
}
4240
return words.toString();
4341
}
44-
4542
}
43+

java/EmitLogDirect.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import java.io.IOException;
21
import com.rabbitmq.client.ConnectionFactory;
32
import com.rabbitmq.client.Connection;
43
import com.rabbitmq.client.Channel;
@@ -7,8 +6,7 @@ public class EmitLogDirect {
76

87
private static final String EXCHANGE_NAME = "direct_logs";
98

10-
public static void main(String[] argv)
11-
throws java.io.IOException {
9+
public static void main(String[] argv) throws Exception {
1210

1311
ConnectionFactory factory = new ConnectionFactory();
1412
factory.setHost("localhost");
@@ -50,3 +48,4 @@ private static String joinStrings(String[] strings, String delimiter, int startI
5048
return words.toString();
5149
}
5250
}
51+

java/EmitLogTopic.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ public class EmitLogTopic {
66

77
private static final String EXCHANGE_NAME = "topic_logs";
88

9-
public static void main(String[] argv)
10-
throws Exception {
9+
public static void main(String[] argv) throws Exception {
1110

1211
ConnectionFactory factory = new ConnectionFactory();
1312
factory.setHost("localhost");

java/NewTask.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import java.io.IOException;
21
import com.rabbitmq.client.ConnectionFactory;
32
import com.rabbitmq.client.Connection;
43
import com.rabbitmq.client.Channel;
@@ -8,7 +7,7 @@ public class NewTask {
87

98
private static final String TASK_QUEUE_NAME = "task_queue";
109

11-
public static void main(String[] argv) throws java.io.IOException {
10+
public static void main(String[] argv) throws Exception {
1211

1312
ConnectionFactory factory = new ConnectionFactory();
1413
factory.setHost("localhost");
@@ -43,4 +42,4 @@ private static String joinStrings(String[] strings, String delimiter) {
4342
}
4443
return words.toString();
4544
}
46-
}
45+
}

java/ReceiveLogs.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import java.io.IOException;
21
import com.rabbitmq.client.ConnectionFactory;
32
import com.rabbitmq.client.Connection;
43
import com.rabbitmq.client.Channel;
@@ -8,9 +7,7 @@ public class ReceiveLogs {
87

98
private static final String EXCHANGE_NAME = "logs";
109

11-
public static void main(String[] argv)
12-
throws java.io.IOException,
13-
java.lang.InterruptedException {
10+
public static void main(String[] argv) throws Exception {
1411

1512
ConnectionFactory factory = new ConnectionFactory();
1613
factory.setHost("localhost");
@@ -34,3 +31,4 @@ public static void main(String[] argv)
3431
}
3532
}
3633
}
34+

java/ReceiveLogsDirect.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import java.io.IOException;
21
import com.rabbitmq.client.ConnectionFactory;
32
import com.rabbitmq.client.Connection;
43
import com.rabbitmq.client.Channel;
@@ -8,9 +7,7 @@ public class ReceiveLogsDirect {
87

98
private static final String EXCHANGE_NAME = "direct_logs";
109

11-
public static void main(String[] argv)
12-
throws java.io.IOException,
13-
java.lang.InterruptedException {
10+
public static void main(String[] argv) throws Exception {
1411

1512
ConnectionFactory factory = new ConnectionFactory();
1613
factory.setHost("localhost");
@@ -43,3 +40,4 @@ public static void main(String[] argv)
4340
}
4441
}
4542
}
43+

java/ReceiveLogsTopic.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ public class ReceiveLogsTopic {
77

88
private static final String EXCHANGE_NAME = "topic_logs";
99

10-
public static void main(String[] argv)
11-
throws Exception {
10+
public static void main(String[] argv) throws Exception {
1211

1312
ConnectionFactory factory = new ConnectionFactory();
1413
factory.setHost("localhost");

java/Recv.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import java.io.IOException;
21
import com.rabbitmq.client.ConnectionFactory;
32
import com.rabbitmq.client.Connection;
43
import com.rabbitmq.client.Channel;
@@ -8,9 +7,7 @@ public class Recv {
87

98
private final static String QUEUE_NAME = "hello";
109

11-
public static void main(String[] argv)
12-
throws java.io.IOException,
13-
java.lang.InterruptedException {
10+
public static void main(String[] argv) throws Exception {
1411

1512
ConnectionFactory factory = new ConnectionFactory();
1613
factory.setHost("localhost");
@@ -29,4 +26,4 @@ public static void main(String[] argv)
2926
System.out.println(" [x] Received '" + message + "'");
3027
}
3128
}
32-
}
29+
}

java/Send.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import java.io.IOException;
21
import com.rabbitmq.client.ConnectionFactory;
32
import com.rabbitmq.client.Connection;
43
import com.rabbitmq.client.Channel;
@@ -7,8 +6,7 @@ public class Send {
76

87
private final static String QUEUE_NAME = "hello";
98

10-
public static void main(String[] argv)
11-
throws java.io.IOException {
9+
public static void main(String[] argv) throws Exception {
1210

1311
ConnectionFactory factory = new ConnectionFactory();
1412
factory.setHost("localhost");
@@ -23,4 +21,4 @@ public static void main(String[] argv)
2321
channel.close();
2422
connection.close();
2523
}
26-
}
24+
}

java/Worker.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import java.io.IOException;
21
import com.rabbitmq.client.ConnectionFactory;
32
import com.rabbitmq.client.Connection;
43
import com.rabbitmq.client.Channel;
@@ -8,9 +7,7 @@ public class Worker {
87

98
private static final String TASK_QUEUE_NAME = "task_queue";
109

11-
public static void main(String[] argv)
12-
throws java.io.IOException,
13-
java.lang.InterruptedException {
10+
public static void main(String[] argv) throws Exception {
1411

1512
ConnectionFactory factory = new ConnectionFactory();
1613
factory.setHost("localhost");
@@ -43,3 +40,4 @@ private static void doWork(String task) throws InterruptedException {
4340
}
4441
}
4542
}
43+

0 commit comments

Comments
 (0)