gpt4 book ai didi

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

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

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

WildcardConfiguration.<init>介绍

暂无

代码示例

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

public SimpleAddressManager(final BindingsFactory bindingsFactory, final StorageManager storageManager) {
 this(bindingsFactory, new WildcardConfiguration(), storageManager);
}

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

@Test
  public void testWildcardConversion() throws Exception {
   String amqTarget = "TEST.ONE.>";
   String coreTarget = OpenWireUtil.OPENWIRE_WILDCARD.convert(amqTarget, new WildcardConfiguration());
   assertEquals("TEST.ONE.#", coreTarget);

   amqTarget = "TEST.*.ONE";
   coreTarget = OpenWireUtil.OPENWIRE_WILDCARD.convert(amqTarget, new WildcardConfiguration());
   assertEquals("TEST.*.ONE", coreTarget);

   amqTarget = "a.*.>.>";
   coreTarget = OpenWireUtil.OPENWIRE_WILDCARD.convert(amqTarget, new WildcardConfiguration());
   assertEquals("a.*.#.#", coreTarget);
  }
}

代码示例来源: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

@Override
@Before
public void setUp() throws Exception {
 super.setUp();
 WildcardConfiguration wildcardConfiguration = new WildcardConfiguration();
 wildcardConfiguration.setDelimiter('/');
 Configuration configuration = createDefaultInVMConfig().setWildcardRoutingEnabled(true).setTransactionTimeoutScanPeriod(500).setWildCardConfiguration(wildcardConfiguration);
 server = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
 server.start();
 server.getManagementService().enableNotifications(false);
 locator = createInVMNonHALocator();
 sf = createSessionFactory(locator);
 clientSession = addClientSession(sf.createSession(false, true, true));
}

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

final String TOPIC = "test/+/some/#";
WildcardConfiguration wildcardConfiguration = new WildcardConfiguration();
wildcardConfiguration.setAnyWords('#');
wildcardConfiguration.setDelimiter('/');

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

try {
  WildcardConfiguration wildcardConfiguration = new WildcardConfiguration();
  wildcardConfiguration.setAnyWords('#');
  wildcardConfiguration.setDelimiter('/');

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

@Test
public void testMatchingDocsCustomUnderscorDelimiter() throws Throwable {
 WildcardConfiguration wildcardConfiguration = new WildcardConfiguration();
 wildcardConfiguration.setDelimiter('_');
 HierarchicalObjectRepository<String> repo = new HierarchicalObjectRepository<>(wildcardConfiguration);
 repo.addMatch("a_b_#", "ab#");
 repo.addMatch("a_b_d_#", "abd#");
 repo.addMatch("#", "root");
 Assert.assertEquals("ab#", repo.getMatch("a_b"));
 Assert.assertEquals("ab#", repo.getMatch("a_b_c"));
 Assert.assertEquals("abd#", repo.getMatch("a_b_d_lll"));
 Assert.assertEquals("root", repo.getMatch("z_z_z_z_z"));
 Assert.assertEquals("root", repo.getMatch("a_babc"));
 Assert.assertEquals("ab#", repo.getMatch("a_b_dabc"));
 Assert.assertEquals("abd#", repo.getMatch("a_b_d"));
}

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

@Test
public void testMatchingDocsCustomForwardSlashDelimiter() throws Throwable {
 WildcardConfiguration wildcardConfiguration = new WildcardConfiguration();
 wildcardConfiguration.setDelimiter('/');
 HierarchicalObjectRepository<String> repo = new HierarchicalObjectRepository<>(wildcardConfiguration);
 repo.addMatch("a/b/#", "ab#");
 repo.addMatch("a/b/d/#", "abd#");
 repo.addMatch("#", "root");
 Assert.assertEquals("ab#", repo.getMatch("a/b"));
 Assert.assertEquals("ab#", repo.getMatch("a/b/c"));
 Assert.assertEquals("abd#", repo.getMatch("a/b/d/lll"));
 Assert.assertEquals("root", repo.getMatch("z/z/z/z/z"));
 Assert.assertEquals("root", repo.getMatch("a/babc"));
 Assert.assertEquals("ab#", repo.getMatch("a/b/dabc"));
 Assert.assertEquals("abd#", repo.getMatch("a/b/d"));
}

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