use of com.jd.blockchain.consensus.mq.producer.MsgQueueProducer in project jdchain-core by blockchain-jd-com.
the class MsgQueueConsensusClient method init.
public void init() {
String server = msgQueueNetworkSettings.getServer();
String txTopic = msgQueueNetworkSettings.getTxTopic();
String txResultTopic = msgQueueNetworkSettings.getTxResultTopic();
String msgTopic = msgQueueNetworkSettings.getMsgTopic();
String msgResultTopic = msgQueueNetworkSettings.getMsgResultTopic();
MsgQueueProducer txProducer = MsgQueueFactory.newProducer(server, txTopic, false);
MsgQueueProducer msgProducer = MsgQueueFactory.newProducer(server, msgTopic, false);
MsgQueueConsumer txResultConsumer = MsgQueueFactory.newConsumer(server, txResultTopic, false);
MsgQueueConsumer msgResultConsumer = MsgQueueFactory.newConsumer(server, msgResultTopic, false);
transmitter = new DefaultMessageTransmitter().setTxProducer(txProducer).setMsgProducer(msgProducer).setTxResultConsumer(txResultConsumer).setMsgResultConsumer(msgResultConsumer);
}
use of com.jd.blockchain.consensus.mq.producer.MsgQueueProducer in project jdchain-core by blockchain-jd-com.
the class ParticipantManagerService4MQ method createMQClient.
private DefaultMessageTransmitter createMQClient(ParticipantContext context) throws Exception {
MsgQueueConsensusSettings consensusSettings = (MsgQueueConsensusSettings) getConsensusSetting(context);
String server = consensusSettings.getNetworkSettings().getServer();
String txTopic = consensusSettings.getNetworkSettings().getTxTopic();
String txResultTopic = consensusSettings.getNetworkSettings().getTxResultTopic();
String msgTopic = consensusSettings.getNetworkSettings().getMsgTopic();
String msgResultTopic = consensusSettings.getNetworkSettings().getMsgResultTopic();
MsgQueueProducer txProducer = MsgQueueFactory.newProducer(server, txTopic, false);
MsgQueueConsumer txResultConsumer = MsgQueueFactory.newConsumer(server, txResultTopic, false);
MsgQueueProducer msgProducer = MsgQueueFactory.newProducer(server, msgTopic, false);
MsgQueueConsumer msgResultConsumer = MsgQueueFactory.newConsumer(server, msgResultTopic, false);
DefaultMessageTransmitter transmitter = new DefaultMessageTransmitter().setTxProducer(txProducer).setTxResultConsumer(txResultConsumer).setMsgProducer(msgProducer).setMsgResultConsumer(msgResultConsumer);
transmitter.connect();
return transmitter;
}
Aggregations