2017-07-04 7 views
0

を接続して、私のコードは、RabbitMQのとPCのローカルIPv4アドレスRabbitMQの、私はリモートでRabbitMQのために接続するリモートホストに

public class ReceiveLogsDirect { 

     private static final String EXCHANGE_NAME = "direct_logs"; 

     public static void main(String[] argv) throws Exception { 
     ConnectionFactory factory = new ConnectionFactory(); 
      factory.setUsername("guest"); 
      factory.setPassword("guest"); 
      factory.setVirtualHost("/"); 
      factory.setHost("192.168.23.214"); 
      factory.setPort(5672); 
     Connection connection = factory.newConnection(); 
     Channel channel = connection.createChannel(); 

     channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.DIRECT); 
     String queueName = channel.queueDeclare().getQueue(); 


      channel.queueBind(queueName, EXCHANGE_NAME, "user_one"); 

     System.out.println(" [*] Waiting for messages. To exit press CTRL+C"); 

     Consumer consumer = new DefaultConsumer(channel) { 
      @Override 
      public void handleDelivery(String consumerTag, Envelope envelope, 
            AMQP.BasicProperties properties, byte[] body) throws IOException { 
      String message = new String(body, "UTF-8"); 
      System.out.println(" [x] Received '" + envelope.getRoutingKey() + "':'" + message + "'"); 
      } 
     }; 
     channel.basicConsume(queueName, true, consumer); 
     } 
    } 

192.168.23.214ですが、私は次のエラー

Exception in thread "main" com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile. 
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:349) 
at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:63) 
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:99) 
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:911) 
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:870) 
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:828) 
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:979) 
at tutorial5.ReceiveLogsDirect.main(ReceiveLogsDirect.java:21) 
を持っています

私のrabbitmq.config contein 1行:[{loopback_users, []}]. 何か提案がありますか?

+0

に自分の設定を変更**問題につながりますか? –

答えて

0

は最後に、私はあなたの** list_user_permissionsを置いてもらえません[{rabbit, [{loopback_users, []}]}].

関連する問題