@Test void declareQueue() throws IOException { new RabbitmqClientDemo().declareQueue(); }
@Override public void declareQueue() throws IOException { Connection connection = connection(connectionFactory()); Channel channel = connection.createChannel(); try { channel.queueDeclare("demo1",true,false,false,null); }catch (IOException e){ if ("406".equals(((AMQImpl.Channel.Close) (((ShutdownSignalException)e.getCause())).getReason()).getReplyCode())){ channel = connection.createChannel(); channel.queueDelete("demo1"); channel.queueDeclare("demo1",false,false,false,null); } } }
RabbitmqClientDemo implements ClientDemo { @Override public void declareQueue() throws IOException { Connection connection = connection(connectionFactory()); Channel channel = connection.createChannel(); try { channel.queueDeclare("demo1",true,false,false,null); }catch (IOException e){ if ("406".equals(((AMQImpl.Channel.Close) (((ShutdownSignalException)e.getCause())).getReason()).getReplyCode())){ channel = connection.createChannel(); channel.queueDelete("demo1"); channel.queueDeclare("demo1",false,false,false,null); } } } }
RabbitmqClientDemo implements ClientDemo { @Override public void declareQueue() throws IOException { Connection connection = connection(connectionFactory()); Channel channel = connection.createChannel(); try { channel.queueDeclare("demo1",true,false,false,null); }catch (IOException e){ if ("406".equals(((AMQImpl.Channel.Close) (((ShutdownSignalException)e.getCause())).getReason()).getReplyCode())){ channel = connection.createChannel(); channel.queueDelete("demo1"); channel.queueDeclare("demo1",false,false,false,null); } } }  }
RabbitmqClientDemo implements ClientDemo { @Override public void declareQueue() throws IOException { Connection connection = connection(connectionFactory()); Channel channel = connection.createChannel(); try { channel.queueDeclare("demo1",true,false,false,null); }catch (IOException e){ if ("406".equals(((AMQImpl.Channel.Close) (((ShutdownSignalException)e.getCause())).getReason()).getReplyCode())){ channel = connection.createChannel(); channel.queueDelete("demo1"); channel.queueDeclare("demo1",false,false,false,null); } } }  ConnectionFactory connectionFactory(); Connection connection(ConnectionFactory connectionFactory); @Override void declareQueue(); }
RabbitmqClientDemo implements ClientDemo { @Override public void declareQueue() throws IOException { Connection connection = connection(connectionFactory()); Channel channel = connection.createChannel(); try { channel.queueDeclare("demo1",true,false,false,null); }catch (IOException e){ if ("406".equals(((AMQImpl.Channel.Close) (((ShutdownSignalException)e.getCause())).getReason()).getReplyCode())){ channel = connection.createChannel(); channel.queueDelete("demo1"); channel.queueDeclare("demo1",false,false,false,null); } } }  ConnectionFactory connectionFactory(); Connection connection(ConnectionFactory connectionFactory); @Override void declareQueue();  }