@Override
    protected void execute() {
        try {
            channel.confirmSelect();
            publish(Utility.GenerateRandomTask());
            channel.waitForConfirmsOrDie();
            channel.close();
            connection.close();
            ConnectionFactory factory = new ConnectionFactory();
            factory.setHost("127.0.0.1");
            connection = factory.newConnection();
            channel = connection.createChannel();
        } catch (IOException ex) {
            System.err.println(ex.getMessage());
        } catch (InterruptedException ex) {
            Logger.getLogger(HandshakePublisher.class.getName()).log(Level.SEVERE, null, ex);
        }
    }