Search in sources :

Example 1 with QuorumVoteHandler

use of org.apache.activemq.artemis.core.server.cluster.qourum.QuorumVoteHandler in project activemq-artemis by apache.

the class ClusterControl method sendQuorumVote.

public Vote sendQuorumVote(SimpleString handler, Vote vote) {
    try {
        ActiveMQServerLogger.LOGGER.sendingQuorumVoteRequest(getSessionFactory().getConnection().getRemoteAddress(), vote.toString());
        QuorumVoteReplyMessage replyMessage = (QuorumVoteReplyMessage) clusterChannel.sendBlocking(new QuorumVoteMessage(handler, vote), PacketImpl.QUORUM_VOTE_REPLY);
        QuorumVoteHandler voteHandler = server.getClusterManager().getQuorumManager().getVoteHandler(replyMessage.getHandler());
        replyMessage.decodeRest(voteHandler);
        Vote voteResponse = replyMessage.getVote();
        ActiveMQServerLogger.LOGGER.receivedQuorumVoteResponse(getSessionFactory().getConnection().getRemoteAddress(), voteResponse.toString());
        return voteResponse;
    } catch (ActiveMQException e) {
        return null;
    }
}
Also used : QuorumVoteMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.QuorumVoteMessage) Vote(org.apache.activemq.artemis.core.server.cluster.qourum.Vote) ActiveMQException(org.apache.activemq.artemis.api.core.ActiveMQException) QuorumVoteReplyMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.QuorumVoteReplyMessage) QuorumVoteHandler(org.apache.activemq.artemis.core.server.cluster.qourum.QuorumVoteHandler)

Aggregations

ActiveMQException (org.apache.activemq.artemis.api.core.ActiveMQException)1 QuorumVoteMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.QuorumVoteMessage)1 QuorumVoteReplyMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.QuorumVoteReplyMessage)1 QuorumVoteHandler (org.apache.activemq.artemis.core.server.cluster.qourum.QuorumVoteHandler)1 Vote (org.apache.activemq.artemis.core.server.cluster.qourum.Vote)1