mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-23 14:15:47 +00:00
Merge pull request #394 from ukwa/update-ampq-client
Update AMPQ client library to address security warning.
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@
|
||||
<dependency>
|
||||
<groupId>com.rabbitmq</groupId>
|
||||
<artifactId>amqp-client</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<version>4.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.logging.Level;
|
||||
@@ -180,7 +181,7 @@ public class AMQPUrlReceiver
|
||||
// start up again
|
||||
try {
|
||||
startConsumer();
|
||||
} catch (IOException e) {
|
||||
} catch (IOException | TimeoutException e) {
|
||||
logger.log(Level.SEVERE, "problem starting AMQP consumer (will try again after 10 seconds)", e);
|
||||
}
|
||||
}
|
||||
@@ -193,7 +194,7 @@ public class AMQPUrlReceiver
|
||||
consumerTag = null;
|
||||
logger.info("Cancelled URLConsumer.");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} catch (IOException | TimeoutException e) {
|
||||
logger.log(Level.SEVERE, "problem cancelling AMQP consumer (will try again after 10 seconds)", e);
|
||||
}
|
||||
}
|
||||
@@ -209,7 +210,7 @@ public class AMQPUrlReceiver
|
||||
}
|
||||
}
|
||||
|
||||
public void startConsumer() throws IOException {
|
||||
public void startConsumer() throws IOException, TimeoutException {
|
||||
Consumer consumer = new UrlConsumer(channel());
|
||||
channel().exchangeDeclare(getExchange(), "direct", true);
|
||||
channel().queueDeclare(getQueueName(), durable,
|
||||
@@ -235,7 +236,7 @@ public class AMQPUrlReceiver
|
||||
// try to synchronously start the consumer right now, so
|
||||
// that the queue is bound before crawling starts
|
||||
starterRestarter.startConsumer();
|
||||
} catch (IOException e) {
|
||||
} catch (IOException | TimeoutException e) {
|
||||
logger.log(Level.SEVERE, "problem starting AMQP consumer (will try again soon)", e);
|
||||
}
|
||||
starterRestarter.start();
|
||||
@@ -278,7 +279,7 @@ public class AMQPUrlReceiver
|
||||
transient protected Connection connection = null;
|
||||
transient protected Channel channel = null;
|
||||
|
||||
protected Connection connection() throws IOException {
|
||||
protected Connection connection() throws IOException, TimeoutException {
|
||||
lock.lock();
|
||||
try {
|
||||
if (connection != null && !connection.isOpen()) {
|
||||
@@ -302,7 +303,7 @@ public class AMQPUrlReceiver
|
||||
}
|
||||
}
|
||||
|
||||
protected Channel channel() throws IOException {
|
||||
protected Channel channel() throws IOException, TimeoutException {
|
||||
lock.lock();
|
||||
try {
|
||||
if (channel != null && !channel.isOpen()) {
|
||||
|
||||
Reference in New Issue
Block a user