RabbitMqClient implements IMessagingClient { String getQueueName() { StringBuilder queueName = new StringBuilder(); queueName.append( this.domain ); queueName.append( "." ); if( this.ownerKind == RecipientKind.DM ) { queueName.append( "roboconf-dm" ); } else { queueName.append( this.applicationName ); queueName.append( "." ); queueName.append( MessagingUtils.escapeInstancePath( this.scopedInstancePath )); } return queueName.toString(); } protected  RabbitMqClient( ReconfigurableClient<?> reconfigurable, Map<String,String> messagingProperties ); protected  RabbitMqClient( ReconfigurableClient<?> reconfigurable, Map<String,String> messagingProperties, RecipientKind ownerKind ); final ReconfigurableClient<?> getReconfigurableClient(); @Override final void setMessageQueue( RoboconfMessageQueue messageQueue ); @Override final synchronized boolean isConnected(); @Override final String getMessagingType(); @Override final Map<String,String> getConfiguration(); @Override void setOwnerProperties( RecipientKind ownerKind, String domain, String applicationName, String scopedInstancePath ); @Override void openConnection(); @Override void closeConnection(); @Override void deleteMessagingServerArtifacts( Application application ); @Override void publish( MessagingContext ctx, Message msg ); @Override void subscribe( MessagingContext ctx ); @Override void unsubscribe( MessagingContext ctx );  }
@Test public void testGetQueueName() throws Exception { Map<String,String> configuration = new HashMap<> (); configuration.put( RABBITMQ_SERVER_IP, "localhost" ); configuration.put( RABBITMQ_SERVER_USERNAME, "guest" ); configuration.put( RABBITMQ_SERVER_PASSWORD, "guest" ); RabbitMqClient client = new RabbitMqClient( null, configuration, RecipientKind.DM ); client.setOwnerProperties( RecipientKind.DM, "domain", "app", "/root" ); Assert.assertEquals( "domain.roboconf-dm", client.getQueueName()); client.setOwnerProperties( RecipientKind.AGENTS, "domain", "app", "/root" ); Assert.assertEquals( "domain.app.root", client.getQueueName()); client.setOwnerProperties( RecipientKind.AGENTS, "domain1", "app", "/root" ); Assert.assertEquals( "domain1.app.root", client.getQueueName()); }