当前位置: 首页>>代码示例>>Java>>正文


Java TopicConfig类代码示例

本文整理汇总了Java中com.hazelcast.config.TopicConfig的典型用法代码示例。如果您正苦于以下问题:Java TopicConfig类的具体用法?Java TopicConfig怎么用?Java TopicConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TopicConfig类属于com.hazelcast.config包,在下文中一共展示了TopicConfig类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: activate

import com.hazelcast.config.TopicConfig; //导入依赖的package包/类
@Activate
protected void activate() {
    localNodeId = clusterService.getLocalNode().id();
    listenerRegistry = new AbstractListenerRegistry<>();
    eventDispatcher.addSink(LeadershipEvent.class, listenerRegistry);

    TopicConfig topicConfig = new TopicConfig();
    topicConfig.setGlobalOrderingEnabled(true);
    topicConfig.setName(TOPIC_HZ_ID);
    storeService.getHazelcastInstance().getConfig().addTopicConfig(topicConfig);

    messageHandlingExecutor = Executors.newSingleThreadExecutor(
            groupedThreads("onos/store/leadership", "message-handler"));

    clusterCommunicator.addSubscriber(
            LEADERSHIP_EVENT_MESSAGE_SUBJECT,
            new InternalLeadershipEventListener(),
            messageHandlingExecutor);

    log.info("Hazelcast Leadership Service started");
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:22,代码来源:HazelcastLeadershipService.java

示例2: setTopicConfig

import com.hazelcast.config.TopicConfig; //导入依赖的package包/类
private void setTopicConfig(Config config) {
	TopicConfig topicConfig = config.getTopicConfig("yourTopicName");
	topicConfig.setGlobalOrderingEnabled(true);
	topicConfig.setStatisticsEnabled(true);

	MessageListener<String> implementation = new MessageListener<String>() {
		@Override
		public void onMessage(Message<String> message) {
			// process the message
		}
	};
	topicConfig.addMessageListenerConfig(new ListenerConfig(implementation));
}
 
开发者ID:eetlite,项目名称:eet.osslite.cz,代码行数:14,代码来源:HazelcastConfiguration.java

示例3: initializeListeners

import com.hazelcast.config.TopicConfig; //导入依赖的package包/类
private void initializeListeners() {
    final TopicConfig topicConfig = node.config.findMatchingTopicConfig(name);
    for (ListenerConfig lc : topicConfig.getMessageListenerConfigs()) {
        try {
            node.listenerManager.createAndAddListenerItem(name, lc, InstanceType.TOPIC);
            for (MemberImpl member : node.clusterManager.getMembers()) {
                addListener(member.getAddress(), true);
            }
        } catch (Exception e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
        }
    }
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:14,代码来源:TopicManager.java

示例4: getConfig

import com.hazelcast.config.TopicConfig; //导入依赖的package包/类
@JMXAttribute("Config")
@JMXDescription("Topic configuration")
public String getConfig() {
    final TopicConfig config = managementService.getInstance().getConfig().getTopicConfig(getName());
    return config.toString();
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:7,代码来源:TopicMBean.java


注:本文中的com.hazelcast.config.TopicConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。