public void sendMessage(final Message message, final SendMessageCallback cb, final long time, final TimeUnit unit) {
try {
final String topic = message.getTopic();
final Partition partition = this.selectPartition(message);
if (partition == null) {
throw new MetaClientException("There is no aviable partition for topic " + topic
+ ",maybe you don't publish it at first?");
}
final String serverUrl = this.producerZooKeeper.selectBroker(topic, partition);
if (serverUrl == null) {
throw new MetaClientException("There is no aviable server right now for topic " + topic
+ " and partition " + partition + ",maybe you don't publish it at first?");
}
final int flag = MessageFlagUtils.getFlag(message);
final byte[] encodedData = MessageUtils.encodePayload(message);