Package com.aliyun.openservices.ons.api.transaction

Examples of com.aliyun.openservices.ons.api.transaction.TransactionProducer



    public static void main(String[] args) {
        Properties properties = new Properties();
        properties.put(PropertyKeyConst.ProducerId, "ProducerId1");
        TransactionProducer producer =
                ONSFactory.createTransactionProducer(properties, new LocalTransactionCheckerImpl());
        producer.start();
        Message msg = new Message("TopicTestONS", "TagA", "Hello ONS".getBytes());
        SendResult sendResult = producer.send(msg, new LocalTransactionExecuter() {
            @Override
            public TransactionStatus execute(Message msg, Object arg) {
                return TransactionStatus.CommitTransaction;
            }
        }, null);

        System.out.println(sendResult);

        producer.shutdown();
    }
View Full Code Here

TOP

Related Classes of com.aliyun.openservices.ons.api.transaction.TransactionProducer

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.