DefaultClientEnvironment implements ClientEnvironment, Initializable { @Override public Properties getProducerConfig(String topic) throws IOException { Properties properties = m_producerCache.get(topic); if (properties == null) { properties = readConfigFile(String.format(PRODUCER_PATTERN, topic), m_producerDefault); m_producerCache.putIfAbsent(topic, properties); } return properties; }  @Override Properties getProducerConfig(String topic); @Override Properties getConsumerConfig(String topic); @Override Properties getGlobalConfig(); @Override void initialize();  }
@Test public void test() throws Exception { ClientEnvironment env = lookup(ClientEnvironment.class); Properties config = env.getProducerConfig("test_topic"); assertNotNull(config); assertEquals(config.getProperty("hermes"), "mq"); assertEquals(config.getProperty("inherited"), "got"); config = env.getProducerConfig("not_exist"); assertNotNull(config); assertEquals(config.getProperty("hermes"), "default"); assertEquals(config.getProperty("inherited"), "got"); }