Package com.taobao.metamorphosis.client.producer

Examples of com.taobao.metamorphosis.client.producer.SendResult



    SendResult sendMessageToServer(final Message message, final long timeout, final TimeUnit unit,
            final boolean saveToLocalWhileForbidden) throws MetaClientException, InterruptedException,
            MetaOpeartionTimeoutException {
        final SendResult sendResult = this.sendMessageToServer(message, timeout, unit);
        if (this.needSaveToLocalWhenSendFailed(sendResult)
                || this.needSaveToLocalWhenForbidden(saveToLocalWhileForbidden, sendResult)) {
            log.warn("send to server fail,save to local." + sendResult.getErrorMessage());
            return this.saveMessageToLocal(message, Partition.RandomPartiton, timeout, unit);
        }
        else {
            return sendResult;
        }
View Full Code Here


    public SendResultWrapper sendMessage(long timeout) {
        SendResultWrapper result = new SendResultWrapper();
        Message message = this.nextMessage();
        result.setMessage(message);
        try {
            SendResult sendResult = this.producer.sendMessage(message, timeout, TimeUnit.MILLISECONDS);
            result.setSendResult(sendResult);
        }
        catch (MetaClientException e) {
            result.setException(e);
        }
View Full Code Here

        MessageProducer producer = this.getOrCreateProducer(topic);
        try {
            return producer.sendMessage(msg, timeout, unit);
        }
        catch (MetaClientException e) {
            return new SendResult(false, null, -1, ExceptionUtils.getFullStackTrace(e));
        }
    }
View Full Code Here

        MessageProducer producer = this.getOrCreateProducer(topic);
        try {
            return producer.sendMessage(msg);
        }
        catch (MetaClientException e) {
            return new SendResult(false, null, -1, ExceptionUtils.getFullStackTrace(e));
        }
    }
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.client.producer.SendResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.