Search in sources :

Example 6 with MsgQueueConsensusSettings

use of com.jd.blockchain.consensus.mq.settings.MsgQueueConsensusSettings in project jdchain-core by blockchain-jd-com.

the class ParticipantManagerService4MQ method initBlockQueue.

/**
 * 初始化区块队列
 *
 * @param context
 * @param nodeId
 * @throws Exception
 */
private void initBlockQueue(ParticipantContext context, int nodeId) throws Exception {
    MsgQueueConsensusSettings consensusSettings = (MsgQueueConsensusSettings) getConsensusSetting(context);
    String server = consensusSettings.getNetworkSettings().getServer();
    String blockTopic = consensusSettings.getNetworkSettings().getBlockTopic();
    MsgQueueConsumer blockConsumer = MsgQueueFactory.newConsumer(nodeId, server, blockTopic, true);
    blockConsumer.connect(null);
    blockConsumer.start();
    blockConsumer.close();
}
Also used : MsgQueueConsensusSettings(com.jd.blockchain.consensus.mq.settings.MsgQueueConsensusSettings) MsgQueueConsumer(com.jd.blockchain.consensus.mq.consumer.MsgQueueConsumer)

Aggregations

MsgQueueConsensusSettings (com.jd.blockchain.consensus.mq.settings.MsgQueueConsensusSettings)6 NodeSettings (com.jd.blockchain.consensus.NodeSettings)4 MsgQueueNodeSettings (com.jd.blockchain.consensus.mq.settings.MsgQueueNodeSettings)4 MsgQueueNodeConfig (com.jd.blockchain.consensus.mq.config.MsgQueueNodeConfig)3 MsgQueueConsensusConfig (com.jd.blockchain.consensus.mq.config.MsgQueueConsensusConfig)2 MsgQueueConsumer (com.jd.blockchain.consensus.mq.consumer.MsgQueueConsumer)2 MsgQueueBlockSettings (com.jd.blockchain.consensus.mq.settings.MsgQueueBlockSettings)2 MsgQueueNetworkSettings (com.jd.blockchain.consensus.mq.settings.MsgQueueNetworkSettings)2 BftsmartConsensusConfig (com.jd.blockchain.consensus.bftsmart.BftsmartConsensusConfig)1 BftsmartConsensusViewSettings (com.jd.blockchain.consensus.bftsmart.BftsmartConsensusViewSettings)1 BftsmartNodeConfig (com.jd.blockchain.consensus.bftsmart.BftsmartNodeConfig)1 BftsmartNodeSettings (com.jd.blockchain.consensus.bftsmart.BftsmartNodeSettings)1 DefaultMessageTransmitter (com.jd.blockchain.consensus.mq.client.DefaultMessageTransmitter)1 MsgQueueBlockConfig (com.jd.blockchain.consensus.mq.config.MsgQueueBlockConfig)1 MsgQueueNetworkConfig (com.jd.blockchain.consensus.mq.config.MsgQueueNetworkConfig)1 MsgQueueServerConfig (com.jd.blockchain.consensus.mq.config.MsgQueueServerConfig)1 MsgQueueProducer (com.jd.blockchain.consensus.mq.producer.MsgQueueProducer)1 MsgQueueServerSettings (com.jd.blockchain.consensus.mq.settings.MsgQueueServerSettings)1 RaftConfig (com.jd.blockchain.consensus.raft.config.RaftConfig)1 RaftConsensusConfig (com.jd.blockchain.consensus.raft.config.RaftConsensusConfig)1