Hello,
I'm using mqtt client3.6 with Rabbitmq
I have added vhost and user using rabbitmqctl command
and also set permission added some conf it like
rabbitmqctl add_vhost hardikHost
rabbitmqctl add_user nirav nirav
rabbitmqctl set_permissions -p hardikHost nirav "nirav.*" ".*" ".*"
now i'm going to connect with server its snipped code is
String broker = "tcp://localhost:1883";
//String broker = "ssl://localhost:8883";
String clientId = "Publisher";
MemoryPersistence persistence = new MemoryPersistence();
MqttConnectOptions connOpts = new MqttConnectOptions();
connOpts.setUserName("hardikHost:nirav");
connOpts.setPassword("nirav".toCharArray());
connOpts.setCleanSession(true);
MqttClient sampleClient = new MqttClient(broker, clientId, persistence);
sampleClient.connect(connOpts);
System.out.println("connected");
MqttMessage message=new MqttMessage("HELLO".getBytes());
message.setQos(1);
sampleClient.publish(TOPIC, message);
System.out.println("published");
here this code is working fine, but in this topic is different as compare to user permissions.
any thing wrong in above code?