2

below is my java code i am using to create rabbitmq connection for creating index into elasticsearch, which throws exception. when i use factory.setHost("localhost"); instead of factory.setHost("192.168.xx.xxx"); it works fine but when i use IP it cause me below exception

exception com.rabbitmq.client.PossibleAuthenticationFailureException: Possibly caused by authentication failure

below is java code i am using for connection -

    factory = new ConnectionFactory();
    String value = null;
    if(serviceConfiguration == null)
        throw new NullObjectFoundException("ServiceConfiguration object is not set");
        factory.setUsername("guest");
        factory.setPassword("guest");
        factory.setVirtualHost("/");
        factory.setHost("192.168.xx.xxx");
        factory.setPort(Integer.parseInt( 5672));

    try{
        conn = factory.newConnection();
        return conn;
    }   // try
    catch(Exception e){
        System.out.println(e);
    }   // catch
Rikhi Sahu
  • 655
  • 1
  • 7
  • 19

0 Answers0