I need to receive messages of a queue, but this queue is inside in another machine(AWS instance) with https(https://www.mymachine.com/rabbitmq) but when I want to establish a connection to the queue I get a NullPointerException.
This is a part of code:
factory.setHost(https://www.mymachine.com/rabbitmq);
Connection connection = factory.newConnection();
channel = connection.createChannel();
channel.exchangeDeclare(EXCHANGE_NAME, "fanout");
queueName = channel.queueDeclare().getQueue();
channel.queueBind(queueName, EXCHANGE_NAME, "");