Skip to content

Commit b41cbfb

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

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
@@ -609,7 +609,7 @@ private void doConsumeFromQueue(String queue) {
609609
catch (AmqpApplicationContextClosedException e) {
610610
throw new AmqpConnectException(e);
611611
}
612-
catch (IOException | AmqpConnectException e) {
612+
catch (Exception e) {
613613
RabbitUtils.closeChannel(channel);
614614
RabbitUtils.closeConnection(connection);
615615

@@ -825,7 +825,7 @@ int incrementAndGetEpoch() {
825825

826826
@Override
827827
public void handleDelivery(String consumerTag, Envelope envelope,
828-
BasicProperties properties, byte[] body) throws IOException {
828+
BasicProperties properties, byte[] body) {
829829
MessageProperties messageProperties =
830830
getMessagePropertiesConverter().toMessageProperties(properties, envelope, "UTF-8");
831831
messageProperties.setConsumerTag(consumerTag);
@@ -888,7 +888,7 @@ public void handleDelivery(String consumerTag, Envelope envelope,
888888
}
889889
}
890890

891-
private void callExecuteListener(Message message, long deliveryTag) throws Exception {
891+
private void callExecuteListener(Message message, long deliveryTag) {
892892
boolean channelLocallyTransacted = isChannelLocallyTransacted();
893893
try {
894894
executeListener(getChannel(), message);

0 commit comments

Comments
 (0)