Package com.taobao.metamorphosis.client.producer

Examples of com.taobao.metamorphosis.client.producer.MessageProducer.rollback()


                // ��ʼ����
                producer.beginTransaction();
                // �������ڷ���������Ϣ
                if (!producer.sendMessage(new Message(topic, line.getBytes())).isSuccess()) {
                    // ����ʧ�ܣ������ع�
                    producer.rollback();
                    continue;
                }
                if (!producer.sendMessage(new Message(topic, line.getBytes())).isSuccess()) {
                    producer.rollback();
                    continue;
View Full Code Here


                    // ����ʧ�ܣ������ع�
                    producer.rollback();
                    continue;
                }
                if (!producer.sendMessage(new Message(topic, line.getBytes())).isSuccess()) {
                    producer.rollback();
                    continue;
                }
                // �ύ
                producer.commit();
View Full Code Here

                // �ύ
                producer.commit();

            }
            catch (final Exception e) {
                producer.rollback();
            }
        }
    }

View Full Code Here

                final byte[] data = ("hello" + j + i).getBytes();
                final Message msg = new Message(topic, data);
                messageProducer.beginTransaction();
                final SendResult result = messageProducer.sendMessage(msg);
                if (!result.isSuccess()) {
                    messageProducer.rollback();
                    throw new RuntimeException("Send message failed:" + result.getErrorMessage());
                }
                messageProducer.commit();
                this.messages.add(msg);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.