gpt4 book ai didi

org.apache.activemq.artemis.core.config.WildcardConfiguration.setAnyWords()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 14:27:05 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.activemq.artemis.core.config.WildcardConfiguration.setAnyWords()方法的一些代码示例,展示了WildcardConfiguration.setAnyWords()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WildcardConfiguration.setAnyWords()方法的具体详情如下:
包路径:org.apache.activemq.artemis.core.config.WildcardConfiguration
类名称:WildcardConfiguration
方法名:setAnyWords

WildcardConfiguration.setAnyWords介绍

暂无

代码示例

代码示例来源:origin: apache/activemq-artemis

/**
* @param e
* @return
*/
protected void parseWildcardConfiguration(final Element e, final Configuration mainConfig) {
 WildcardConfiguration conf = mainConfig.getWildcardConfiguration();
 conf.setDelimiter(getString(e, "delimiter", Character.toString(conf.getDelimiter()), Validators.NO_CHECK).charAt(0));
 conf.setAnyWords(getString(e, "any-words", Character.toString(conf.getAnyWords()), Validators.NO_CHECK).charAt(0));
 conf.setSingleWord(getString(e, "single-word", Character.toString(conf.getSingleWord()), Validators.NO_CHECK).charAt(0));
 conf.setRoutingEnabled(getBoolean(e, "enabled", conf.isRoutingEnabled()));
 conf.setRoutingEnabled(getBoolean(e, "routing-enabled", conf.isRoutingEnabled()));
}

代码示例来源:origin: apache/activemq-artemis

private WildcardConfiguration createWildCardConfiguration() {
 WildcardConfiguration wildcardConfiguration = new WildcardConfiguration();
 wildcardConfiguration.setAnyWords('#');
 wildcardConfiguration.setDelimiter('/');
 wildcardConfiguration.setRoutingEnabled(true);
 wildcardConfiguration.setSingleWord('+');
 return wildcardConfiguration;
}

代码示例来源:origin: apache/activemq-artemis

private void addWildCardConfiguration(Configuration configuration) {
 WildcardConfiguration wildcardConfiguration = new WildcardConfiguration();
 wildcardConfiguration.setAnyWords('#');
 wildcardConfiguration.setDelimiter('/');
 wildcardConfiguration.setRoutingEnabled(true);
 wildcardConfiguration.setSingleWord('+');
 configuration.setWildCardConfiguration(wildcardConfiguration);
}

代码示例来源:origin: apache/activemq-artemis

@Override
public void configureBroker() throws Exception {
 super.configureBroker();
 WildcardConfiguration wildcardConfiguration = new WildcardConfiguration();
 wildcardConfiguration.setDelimiter('.');
 wildcardConfiguration.setSingleWord('*');
 wildcardConfiguration.setAnyWords('>');
 server.getConfiguration().setWildCardConfiguration(wildcardConfiguration);
}

代码示例来源:origin: apache/activemq-artemis

@Test
public void testWildCardAddressRemovalDifferentWildcard() throws Exception {
 final WildcardConfiguration configuration = new WildcardConfiguration();
 configuration.setAnyWords('>');
 WildcardAddressManager ad = new WildcardAddressManager(new BindingFactoryFake(), configuration, null);
 ad.addAddressInfo(new AddressInfo(SimpleString.toSimpleString("Topic1.>"), RoutingType.MULTICAST));
 ad.addAddressInfo(new AddressInfo(SimpleString.toSimpleString("Topic1.test"), RoutingType.MULTICAST));
 ad.addBinding(new BindingFake("Topic1.>", "one"));
 assertEquals(1, ad.getBindingsForRoutingAddress(SimpleString.toSimpleString("Topic1.>")).getBindings().size());
 assertEquals(1, ad.getBindingsForRoutingAddress(SimpleString.toSimpleString("Topic1.test")).getBindings().size());
 assertEquals(0, ad.getDirectBindings(SimpleString.toSimpleString("Topic1.test")).getBindings().size());
 assertEquals(1, ad.getDirectBindings(SimpleString.toSimpleString("Topic1.>")).getBindings().size());
 //Remove the address
 ad.removeAddressInfo(SimpleString.toSimpleString("Topic1.test"));
 //should still have 1 address and binding
 assertEquals(1, ad.getAddresses().size());
 assertEquals(1, ad.getBindings().size());
 ad.removeBinding(SimpleString.toSimpleString("one"), null);
 ad.removeAddressInfo(SimpleString.toSimpleString("Topic1.>"));
 assertEquals(0, ad.getAddresses().size());
 assertEquals(0, ad.getBindings().size());
}

代码示例来源:origin: apache/activemq-artemis

@Test
public void testWildCardAddressDirectBindings() throws Exception {
 final WildcardConfiguration configuration = new WildcardConfiguration();
 configuration.setAnyWords('>');
 WildcardAddressManager ad = new WildcardAddressManager(new BindingFactoryFake(), configuration, null);
 ad.addAddressInfo(new AddressInfo(SimpleString.toSimpleString("Topic1.>"), RoutingType.MULTICAST));
 ad.addAddressInfo(new AddressInfo(SimpleString.toSimpleString("Topic1.test"), RoutingType.MULTICAST));
 ad.addAddressInfo(new AddressInfo(SimpleString.toSimpleString("Topic1.test.test1"), RoutingType.MULTICAST));
 ad.addAddressInfo(new AddressInfo(SimpleString.toSimpleString("Topic1.test.test2"), RoutingType.MULTICAST));
 ad.addAddressInfo(new AddressInfo(SimpleString.toSimpleString("Topic2.>"), RoutingType.MULTICAST));
 ad.addAddressInfo(new AddressInfo(SimpleString.toSimpleString("Topic2.test"), RoutingType.MULTICAST));
 ad.addBinding(new BindingFake("Topic1.>", "one"));
 ad.addBinding(new BindingFake("Topic1.test", "two"));
 ad.addBinding(new BindingFake("Topic2.test", "three"));
 assertEquals(1, ad.getBindingsForRoutingAddress(SimpleString.toSimpleString("Topic1.>")).getBindings().size());
 assertEquals(2, ad.getBindingsForRoutingAddress(SimpleString.toSimpleString("Topic1.test")).getBindings().size());
 assertEquals(1, ad.getBindingsForRoutingAddress(SimpleString.toSimpleString("Topic1.test.test1")).getBindings().size());
 assertEquals(1, ad.getBindingsForRoutingAddress(SimpleString.toSimpleString("Topic1.test.test2")).getBindings().size());
 assertEquals(1, ad.getDirectBindings(SimpleString.toSimpleString("Topic1.>")).getBindings().size());
 assertEquals(1, ad.getDirectBindings(SimpleString.toSimpleString("Topic1.test")).getBindings().size());
 assertEquals(0, ad.getDirectBindings(SimpleString.toSimpleString("Topic1.test1")).getBindings().size());
 assertEquals(0, ad.getDirectBindings(SimpleString.toSimpleString("Topic1.test2")).getBindings().size());
 assertEquals(0, ad.getDirectBindings(SimpleString.toSimpleString("Topic2.>")).getBindings().size());
 assertEquals(1, ad.getDirectBindings(SimpleString.toSimpleString("Topic2.test")).getBindings().size());
}

代码示例来源:origin: apache/activemq-artemis

wildcardConfiguration.setAnyWords('#');
wildcardConfiguration.setDelimiter('/');
wildcardConfiguration.setRoutingEnabled(true);

代码示例来源:origin: apache/activemq-artemis

wildcardConfiguration.setAnyWords('#');
wildcardConfiguration.setDelimiter('/');
wildcardConfiguration.setRoutingEnabled(true);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com