Skip to content

Commit 6b80c1f

Browse files
artembilangaryrussell
authored andcommitted
GH-865: Restart DirMLC for any consume exception
Fixes #865 **Cherry-pick to 2.0.x**
1 parent d6b3007 commit 6b80c1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/DirectMessageListenerContainer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ private void doConsumeFromQueue(String queue) {
660660
catch (AmqpApplicationContextClosedException e) {
661661
throw new AmqpConnectException(e);
662662
}
663-
catch (IOException | AmqpConnectException e) {
663+
catch (Exception e) {
664664
RabbitUtils.closeChannel(channel);
665665
RabbitUtils.closeConnection(connection);
666666

@@ -876,7 +876,7 @@ int incrementAndGetEpoch() {
876876

877877
@Override
878878
public void handleDelivery(String consumerTag, Envelope envelope,
879-
BasicProperties properties, byte[] body) throws IOException {
879+
BasicProperties properties, byte[] body) {
880880
MessageProperties messageProperties =
881881
getMessagePropertiesConverter().toMessageProperties(properties, envelope, "UTF-8");
882882
messageProperties.setConsumerTag(consumerTag);
@@ -939,7 +939,7 @@ public void handleDelivery(String consumerTag, Envelope envelope,
939939
}
940940
}
941941

942-
private void callExecuteListener(Message message, long deliveryTag) throws Exception {
942+
private void callExecuteListener(Message message, long deliveryTag) {
943943
boolean channelLocallyTransacted = isChannelLocallyTransacted();
944944
try {
945945
executeListener(getChannel(), message);

0 commit comments

Comments
 (0)