rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From duhengfore...@apache.org
Subject [rocketmq-ons] 28/43: Add support for OpenMessaging
Date Fri, 06 Dec 2019 04:22:50 GMT
This is an automated email from the ASF dual-hosted git repository.

duhengforever pushed a commit to branch OpenMessaging
in repository https://gitbox.apache.org/repos/asf/rocketmq-ons.git

commit beb29e1e2f8dba3e2e00e04d91d0a2ba7f35f297
Author: duhenglucky <duheng0522@gmail.com>
AuthorDate: Tue Sep 3 11:18:37 2019 +0800

    Add support for OpenMessaging
---
 ons-core/ons-api/pom.xml                           |  28 ---
 .../java/org/apache/rocketmq/ons/api/Action.java   |  26 ---
 .../java/org/apache/rocketmq/ons/api/Admin.java    |  37 ---
 .../org/apache/rocketmq/ons/api/Constants.java     |  21 --
 .../apache/rocketmq/ons/api/ConsumeContext.java    |  21 --
 .../java/org/apache/rocketmq/ons/api/Consumer.java |  29 ---
 .../apache/rocketmq/ons/api/ExpressionType.java    |  24 --
 .../java/org/apache/rocketmq/ons/api/MQType.java   |  38 ----
 .../java/org/apache/rocketmq/ons/api/Message.java  | 251 ---------------------
 .../apache/rocketmq/ons/api/MessageAccessor.java   |  41 ----
 .../apache/rocketmq/ons/api/MessageListener.java   |  23 --
 .../apache/rocketmq/ons/api/MessageSelector.java   |  49 ----
 .../org/apache/rocketmq/ons/api/ONSFactory.java    |  88 --------
 .../org/apache/rocketmq/ons/api/ONSFactoryAPI.java |  40 ----
 .../rocketmq/ons/api/OnExceptionContext.java       |  56 -----
 .../java/org/apache/rocketmq/ons/api/Producer.java |  37 ---
 .../rocketmq/ons/api/PropertyValueConst.java       |  27 ---
 .../org/apache/rocketmq/ons/api/SendCallback.java  |  24 --
 .../org/apache/rocketmq/ons/api/SendResult.java    |  47 ----
 .../rocketmq/ons/api/batch/BatchConsumer.java      |  27 ---
 .../ons/api/batch/BatchMessageListener.java        |  29 ---
 .../rocketmq/ons/api/bean/BatchConsumerBean.java   | 114 ----------
 .../apache/rocketmq/ons/api/bean/ConsumerBean.java | 157 -------------
 .../rocketmq/ons/api/bean/OrderConsumerBean.java   | 111 ---------
 .../rocketmq/ons/api/bean/OrderProducerBean.java   |  82 -------
 .../apache/rocketmq/ons/api/bean/ProducerBean.java |  98 --------
 .../apache/rocketmq/ons/api/bean/Subscription.java |  93 --------
 .../rocketmq/ons/api/bean/SubscriptionExt.java     |  47 ----
 .../ons/api/bean/TransactionProducerBean.java      |  95 --------
 .../ons/api/exception/ONSClientException.java      |  42 ----
 .../ons/api/order/ConsumeOrderContext.java         |  21 --
 .../ons/api/order/MessageOrderListener.java        |  25 --
 .../ons/api/order/MessageQueueSelector.java        |  25 --
 .../apache/rocketmq/ons/api/order/OrderAction.java |  26 ---
 .../rocketmq/ons/api/order/OrderConsumer.java      |  35 ---
 .../rocketmq/ons/api/order/OrderProducer.java      |  28 ---
 .../api/transaction/LocalTransactionChecker.java   |  24 --
 .../api/transaction/LocalTransactionExecuter.java  |  26 ---
 .../ons/api/transaction/TransactionProducer.java   |  38 ----
 .../ons/api/transaction/TransactionStatus.java     |  28 ---
 ons-core/ons-client/pom.xml                        |   9 +-
 .../rocketmq/MessagingAccessPointImpl.java}        |  53 +++--
 .../ons/api/impl/constant}/PropertyKeyConst.java   |   5 +-
 .../ons/api/impl/rocketmq/BatchConsumerImpl.java   |  25 +-
 .../ons/api/impl/rocketmq/ConsumerImpl.java        |  33 ++-
 .../ons/api/impl/rocketmq/ONSClientAbstract.java   |  29 +--
 .../ons/api/impl/rocketmq/ONSConsumerAbstract.java |  28 ++-
 .../rocketmq/ons/api/impl/rocketmq/ONSUtil.java    |  16 +-
 .../ons/api/impl/rocketmq/OrderConsumerImpl.java   |  27 ++-
 .../ons/api/impl/rocketmq/OrderProducerImpl.java   |  26 +--
 .../ons/api/impl/rocketmq/ProducerImpl.java        |  39 ++--
 .../api/impl/rocketmq/TransactionProducerImpl.java |  16 +-
 .../tracehook/OnsClientSendMessageHookImpl.java    |  11 +-
 .../impl/rocketmq/NameServerAutoUpdateTest.java    |  44 ++--
 .../impl/rocketmq/ONSClientTokenUpdateTest.java    |  47 ++--
 ons-core/pom.xml                                   |  12 +-
 ons-sample/pom.xml                                 |  10 +-
 .../ons/sample/consumer/MessageListenerImpl.java   |   8 +-
 .../ons/sample/consumer/SimpleMQConsumer.java      |  12 +-
 .../ons/sample/consumer/SimpleOrderConsumer.java   |  18 +-
 .../producer/LocalTransactionCheckerImpl.java      |   6 +-
 .../ons/sample/producer/MQTimerProducer.java       |  19 +-
 .../ons/sample/producer/SimpleMQProducer.java      |  19 +-
 .../ons/sample/producer/SimpleOrderProducer.java   |  19 +-
 .../sample/producer/SimpleTransactionProducer.java |  25 +-
 65 files changed, 299 insertions(+), 2335 deletions(-)

diff --git a/ons-core/ons-api/pom.xml b/ons-core/ons-api/pom.xml
deleted file mode 100644
index adbec96..0000000
--- a/ons-core/ons-api/pom.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>org.apache.rocketmq</groupId>
-        <artifactId>ons-all</artifactId>
-        <version>1.0.1-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>jar</packaging>
-    <artifactId>ons-api</artifactId>
-    <name>ons-api ${project.version}</name>
-</project>
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Action.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Action.java
deleted file mode 100644
index 2c0a2c9..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Action.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api;
-
-
-public enum Action {
-
-    CommitMessage,
-
-    ReconsumeLater,
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Admin.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Admin.java
deleted file mode 100644
index 702d9a5..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Admin.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-import java.util.Properties;
-
-
-public interface Admin {
-
-    boolean isStarted();
-
-
-    boolean isClosed();
-
-
-    void start();
-
-
-    void updateCredential(Properties credentialProperties);
-
-
-    void shutdown();
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Constants.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Constants.java
deleted file mode 100644
index a51ba20..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Constants.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-public class Constants {
-    public static final String TRANSACTION_ID = "__transactionId__";
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ConsumeContext.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ConsumeContext.java
deleted file mode 100644
index 5973428..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ConsumeContext.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-public class ConsumeContext {
-
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Consumer.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Consumer.java
deleted file mode 100644
index a592559..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Consumer.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-
-public interface Consumer extends Admin {
-
-    void subscribe(final String topic, final String subExpression, final MessageListener listener);
-
-
-    void subscribe(final String topic, final MessageSelector selector, final MessageListener listener);
-
-
-    void unsubscribe(final String topic);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ExpressionType.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ExpressionType.java
deleted file mode 100644
index 1980ac6..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ExpressionType.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-public enum ExpressionType {
-
-    SQL92,
-
-    TAG
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MQType.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MQType.java
deleted file mode 100644
index 17d4afa..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MQType.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-public enum MQType {
-
-    NOTIFY("NOTIFY"),
-
-    METAQ("METAQ");
-
-    private String name;
-
-    MQType(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Message.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Message.java
deleted file mode 100644
index db56b15..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Message.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-
-public class Message implements Serializable {
-
-    private static final long serialVersionUID = -1385924226856188094L;
-
-
-    Properties systemProperties;
-
-
-    private String topic;
-
-
-    private Properties userProperties;
-
-
-    private byte[] body;
-
-
-    public Message() {
-        this(null, null, "", null);
-    }
-
-
-    public Message(String topic, String tag, String key, byte[] body) {
-        this.topic = topic;
-        this.body = body;
-
-        this.putSystemProperties(SystemPropKey.TAG, tag);
-        this.putSystemProperties(SystemPropKey.KEY, key);
-    }
-
-
-    public void putSystemProperties(final String key, final String value) {
-        if (null == this.systemProperties) {
-            this.systemProperties = new Properties();
-        }
-
-        if (key != null && value != null) {
-            this.systemProperties.put(key, value);
-        }
-    }
-
-
-    public Message(String topic, String tags, byte[] body) {
-        this(topic, tags, "", body);
-    }
-
-
-    public void putUserProperties(final String key, final String value) {
-        if (null == this.userProperties) {
-            this.userProperties = new Properties();
-        }
-
-        if (key != null && value != null) {
-            this.userProperties.put(key, value);
-        }
-    }
-
-
-    public String getUserProperties(final String key) {
-        if (null != this.userProperties) {
-            return (String) this.userProperties.get(key);
-        }
-
-        return null;
-    }
-
-
-    public String getTopic() {
-        return topic;
-    }
-
-
-    public void setTopic(String topic) {
-        this.topic = topic;
-    }
-
-
-    public String getTag() {
-        return this.getSystemProperties(SystemPropKey.TAG);
-    }
-
-
-    public String getSystemProperties(final String key) {
-        if (null != this.systemProperties) {
-            return this.systemProperties.getProperty(key);
-        }
-
-        return null;
-    }
-
-
-    public void setTag(String tag) {
-        this.putSystemProperties(SystemPropKey.TAG, tag);
-    }
-
-
-    public String getKey() {
-        return this.getSystemProperties(SystemPropKey.KEY);
-    }
-
-
-    public void setKey(String key) {
-        this.putSystemProperties(SystemPropKey.KEY, key);
-    }
-
-
-    public String getMsgID() {
-        return this.getSystemProperties(SystemPropKey.MSGID);
-    }
-
-
-    public void setMsgID(String msgid) {
-        this.putSystemProperties(SystemPropKey.MSGID, msgid);
-    }
-
-    public Properties getSystemProperties() {
-        if (null == systemProperties) {
-            return new Properties();
-        }
-        return systemProperties;
-    }
-
-    public void setSystemProperties(Properties systemProperties) {
-        this.systemProperties = systemProperties;
-    }
-
-    public Properties getUserProperties() {
-        if (null == userProperties) {
-            return new Properties();
-        }
-        return userProperties;
-    }
-
-    public void setUserProperties(Properties userProperties) {
-        this.userProperties = userProperties;
-    }
-
-    public byte[] getBody() {
-        return body;
-    }
-
-    public void setBody(byte[] body) {
-        this.body = body;
-    }
-
-
-    public int getReconsumeTimes() {
-        String pro = this.getSystemProperties(SystemPropKey.RECONSUMETIMES);
-        if (pro != null) {
-            return Integer.parseInt(pro);
-        }
-
-        return 0;
-    }
-
-
-    public void setReconsumeTimes(final int value) {
-        putSystemProperties(SystemPropKey.RECONSUMETIMES, String.valueOf(value));
-    }
-
-
-    public long getBornTimestamp() {
-        String pro = this.getSystemProperties(SystemPropKey.BORNTIMESTAMP);
-        if (pro != null) {
-            return Long.parseLong(pro);
-        }
-
-        return 0L;
-    }
-
-
-    public void setBornTimestamp(final long value) {
-        putSystemProperties(SystemPropKey.BORNTIMESTAMP, String.valueOf(value));
-    }
-
-
-    public String getBornHost() {
-        String pro = this.getSystemProperties(SystemPropKey.BORNHOST);
-        return pro == null ? "" : pro;
-    }
-
-
-    public void setBornHost(final String value) {
-        putSystemProperties(SystemPropKey.BORNHOST, value);
-    }
-
-
-    public long getStartDeliverTime() {
-        String pro = this.getSystemProperties(SystemPropKey.STARTDELIVERTIME);
-        if (pro != null) {
-            return Long.parseLong(pro);
-        }
-
-        return 0L;
-    }
-
-    public String getShardingKey() {
-        String pro = this.getSystemProperties(SystemPropKey.SHARDINGKEY);
-        return pro == null ? "" : pro;
-    }
-
-    public void setShardingKey(final String value) {
-        putSystemProperties(SystemPropKey.SHARDINGKEY, value);
-    }
-
-
-    public void setStartDeliverTime(final long value) {
-        putSystemProperties(SystemPropKey.STARTDELIVERTIME, String.valueOf(value));
-    }
-
-    @Override
-    public String toString() {
-        return "Message [topic=" + topic + ", systemProperties=" + systemProperties + ", userProperties=" + userProperties + ", body="
-            + (body != null ? body.length : 0) + "]";
-    }
-
-
-    static public class SystemPropKey {
-        public static final String TAG = "__TAG";
-        public static final String KEY = "__KEY";
-        public static final String MSGID = "__MSGID";
-        public static final String SHARDINGKEY = "__SHARDINGKEY";
-        public static final String RECONSUMETIMES = "__RECONSUMETIMES";
-        public static final String BORNTIMESTAMP = "__BORNTIMESTAMP";
-        public static final String BORNHOST = "__BORNHOST";
-
-        public static final String STARTDELIVERTIME = "__STARTDELIVERTIME";
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MessageAccessor.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MessageAccessor.java
deleted file mode 100644
index 61f23b1..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MessageAccessor.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-import java.util.Properties;
-
-
-public class MessageAccessor {
-    public static Properties getSystemProperties(final Message msg) {
-        return msg.systemProperties;
-    }
-
-
-    public static void setSystemProperties(final Message msg, Properties systemProperties) {
-        msg.systemProperties = systemProperties;
-    }
-
-
-    public static void putSystemProperties(final Message msg, final String key, final String value) {
-        msg.putSystemProperties(key, value);
-    }
-
-
-    public static String getSystemProperties(final Message msg, final String key) {
-        return msg.getSystemProperties(key);
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MessageListener.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MessageListener.java
deleted file mode 100644
index 22b56c7..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MessageListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-
-public interface MessageListener {
-
-    Action consume(final Message message, final ConsumeContext context);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MessageSelector.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MessageSelector.java
deleted file mode 100644
index f28bdae..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/MessageSelector.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api;
-
-public class MessageSelector {
-
-    private ExpressionType type;
-
-    private String subExpression;
-
-    public static MessageSelector bySql(String subExpression) {
-        return new MessageSelector(ExpressionType.SQL92, subExpression);
-    }
-
-    public static MessageSelector byTag(String subExpression) {
-        return new MessageSelector(ExpressionType.TAG, subExpression);
-    }
-
-    private MessageSelector() {
-    }
-
-    private MessageSelector(ExpressionType type, String subExpression) {
-        this.type = type;
-        this.subExpression = subExpression;
-    }
-
-    public ExpressionType getType() {
-        return type;
-    }
-
-    public String getSubExpression() {
-        return subExpression;
-    }
-}
\ No newline at end of file
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ONSFactory.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ONSFactory.java
deleted file mode 100644
index eaff503..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ONSFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-import org.apache.rocketmq.ons.api.batch.BatchConsumer;
-import org.apache.rocketmq.ons.api.order.OrderConsumer;
-import org.apache.rocketmq.ons.api.order.OrderProducer;
-import org.apache.rocketmq.ons.api.transaction.LocalTransactionChecker;
-import org.apache.rocketmq.ons.api.transaction.TransactionProducer;
-import java.util.Properties;
-
-
-public class ONSFactory {
-
-
-    private static ONSFactoryAPI onsFactory = null;
-
-    static {
-        try {
-
-            Class<?> factoryClass =
-                    ONSFactory.class.getClassLoader().loadClass(
-                            "org.apache.rocketmq.ons.api.impl.ONSFactoryNotifyAndMetaQImpl");
-            onsFactory = (ONSFactoryAPI) factoryClass.newInstance();
-        } catch (Throwable e) {
-            try {
-                Class<?> factoryClass =
-                        ONSFactory.class.getClassLoader().loadClass(
-                                "org.apache.rocketmq.ons.api.impl.ONSFactoryImpl");
-                onsFactory = (ONSFactoryAPI) factoryClass.newInstance();
-            } catch (Throwable e1) {
-                e.printStackTrace();
-                e1.printStackTrace();
-            }
-        }
-    }
-
-
-
-    public static Producer createProducer(final Properties properties) {
-        return onsFactory.createProducer(properties);
-    }
-
-
-
-    public static OrderProducer createOrderProducer(final Properties properties) {
-        return onsFactory.createOrderProducer(properties);
-    }
-
-
-
-    public static TransactionProducer createTransactionProducer(final Properties properties,
-                                                                final LocalTransactionChecker checker) {
-        return onsFactory.createTransactionProducer(properties, checker);
-    }
-
-
-
-    public static Consumer createConsumer(final Properties properties) {
-        return onsFactory.createConsumer(properties);
-    }
-
-
-    public static BatchConsumer createBatchConsumer(final Properties properties) {
-        return onsFactory.createBatchConsumer(properties);
-    }
-
-
-
-    public static OrderConsumer createOrderedConsumer(final Properties properties) {
-        return onsFactory.createOrderedConsumer(properties);
-    }
-
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ONSFactoryAPI.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ONSFactoryAPI.java
deleted file mode 100644
index b4bdd8a..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/ONSFactoryAPI.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-import org.apache.rocketmq.ons.api.batch.BatchConsumer;
-import org.apache.rocketmq.ons.api.order.OrderConsumer;
-import org.apache.rocketmq.ons.api.order.OrderProducer;
-import org.apache.rocketmq.ons.api.transaction.LocalTransactionChecker;
-import org.apache.rocketmq.ons.api.transaction.TransactionProducer;
-import java.util.Properties;
-
-public interface ONSFactoryAPI {
-
-    Producer createProducer(final Properties properties);
-
-    Consumer createConsumer(final Properties properties);
-
-    BatchConsumer createBatchConsumer(final Properties properties);
-
-    OrderProducer createOrderProducer(final Properties properties);
-
-    OrderConsumer createOrderedConsumer(final Properties properties);
-
-    TransactionProducer createTransactionProducer(final Properties properties,
-        final LocalTransactionChecker checker);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/OnExceptionContext.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/OnExceptionContext.java
deleted file mode 100644
index 3eb7620..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/OnExceptionContext.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-
-
-public class OnExceptionContext {
-
-
-    private String messageId;
-
-
-    private String topic;
-
-
-    private ONSClientException exception;
-
-    public String getMessageId() {
-        return messageId;
-    }
-
-    public void setMessageId(String messageId) {
-        this.messageId = messageId;
-    }
-
-    public String getTopic() {
-        return topic;
-    }
-
-    public void setTopic(String topic) {
-        this.topic = topic;
-    }
-
-    public ONSClientException getException() {
-        return exception;
-    }
-
-    public void setException(ONSClientException exception) {
-        this.exception = exception;
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Producer.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Producer.java
deleted file mode 100644
index e45e613..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/Producer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-import java.util.concurrent.ExecutorService;
-
-public interface Producer extends Admin {
-
-
-    @Override
-    void start();
-
-    @Override
-    void shutdown();
-
-    SendResult send(final Message message);
-
-    void sendOneway(final Message message);
-
-    void sendAsync(final Message message, final SendCallback sendCallback);
-
-    void setCallbackExecutor(final ExecutorService callbackExecutor);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/PropertyValueConst.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/PropertyValueConst.java
deleted file mode 100644
index c748447..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/PropertyValueConst.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-
-public class PropertyValueConst {
-
-
-    public static final String BROADCASTING = "BROADCASTING";
-
-
-    public static final String CLUSTERING = "CLUSTERING";
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/SendCallback.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/SendCallback.java
deleted file mode 100644
index ade3f70..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/SendCallback.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-public interface SendCallback {
-
-    void onSuccess(final SendResult sendResult);
-
-    void onException(final OnExceptionContext context);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/SendResult.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/SendResult.java
deleted file mode 100644
index 2dd0bb5..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/SendResult.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api;
-
-public class SendResult {
-
-    private String messageId;
-
-    private String topic;
-
-
-    public String getMessageId() {
-        return messageId;
-    }
-
-
-    public void setMessageId(String messageId) {
-        this.messageId = messageId;
-    }
-
-    public String getTopic() {
-        return topic;
-    }
-
-    public void setTopic(String topic) {
-        this.topic = topic;
-    }
-
-    @Override
-    public String toString() {
-        return "SendResult[topic=" + topic + ", messageId=" + messageId + ']';
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/batch/BatchConsumer.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/batch/BatchConsumer.java
deleted file mode 100644
index 848a139..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/batch/BatchConsumer.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.batch;
-
-import org.apache.rocketmq.ons.api.Admin;
-
-public interface BatchConsumer extends Admin {
-
-    void subscribe(final String topic, final String subExpression, final BatchMessageListener listener);
-
-    void unsubscribe(final String topic);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/batch/BatchMessageListener.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/batch/BatchMessageListener.java
deleted file mode 100644
index 3716a90..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/batch/BatchMessageListener.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.batch;
-
-import org.apache.rocketmq.ons.api.Action;
-import org.apache.rocketmq.ons.api.ConsumeContext;
-import org.apache.rocketmq.ons.api.Message;
-import java.util.List;
-
-
-public interface BatchMessageListener {
-
-    Action consume(final List<Message> messages, final ConsumeContext context);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/BatchConsumerBean.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/BatchConsumerBean.java
deleted file mode 100644
index 1cfedde..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/BatchConsumerBean.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.bean;
-
-import java.util.Map;
-import java.util.Properties;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.batch.BatchConsumer;
-import org.apache.rocketmq.ons.api.batch.BatchMessageListener;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-
-
-public class BatchConsumerBean implements BatchConsumer {
-
-    private Properties properties;
-
-
-    private Map<Subscription, BatchMessageListener> subscriptionTable;
-
-    private BatchConsumer batchConsumer;
-
-    @Override
-    public boolean isStarted() {
-        return this.batchConsumer.isStarted();
-    }
-
-    @Override
-    public boolean isClosed() {
-        return this.batchConsumer.isClosed();
-    }
-
-
-    @Override
-    public void start() {
-        if (null == this.properties) {
-            throw new ONSClientException("properties not set");
-        }
-
-        if (null == this.subscriptionTable) {
-            throw new ONSClientException("subscriptionTable not set");
-        }
-
-        this.batchConsumer = ONSFactory.createBatchConsumer(this.properties);
-
-        for (final Map.Entry<Subscription, BatchMessageListener> next : this.subscriptionTable.entrySet()) {
-            this.subscribe(next.getKey().getTopic(), next.getKey().getExpression(), next.getValue());
-        }
-
-        this.batchConsumer.start();
-    }
-
-    @Override
-    public void updateCredential(Properties credentialProperties) {
-        if (this.batchConsumer != null) {
-            this.batchConsumer.updateCredential(credentialProperties);
-        }
-    }
-
-
-    @Override
-    public void shutdown() {
-        if (this.batchConsumer != null) {
-            this.batchConsumer.shutdown();
-        }
-    }
-
-    @Override
-    public void subscribe(final String topic, final String subExpression, final BatchMessageListener listener) {
-        if (null == this.batchConsumer) {
-            throw new ONSClientException("subscribe must be called after BatchConsumerBean started");
-        }
-        this.batchConsumer.subscribe(topic, subExpression, listener);
-    }
-
-    @Override
-    public void unsubscribe(final String topic) {
-        if (null == this.batchConsumer) {
-            throw new ONSClientException("unsubscribe must be called after BatchConsumerBean started");
-        }
-        this.batchConsumer.unsubscribe(topic);
-    }
-
-    public Properties getProperties() {
-        return properties;
-    }
-
-    public void setProperties(final Properties properties) {
-        this.properties = properties;
-    }
-
-    public Map<Subscription, BatchMessageListener> getSubscriptionTable() {
-        return subscriptionTable;
-    }
-
-    public void setSubscriptionTable(
-        final Map<Subscription, BatchMessageListener> subscriptionTable) {
-        this.subscriptionTable = subscriptionTable;
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/ConsumerBean.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/ConsumerBean.java
deleted file mode 100644
index 839ad62..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/ConsumerBean.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.bean;
-
-import java.lang.reflect.Method;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-import org.apache.rocketmq.ons.api.Consumer;
-import org.apache.rocketmq.ons.api.ExpressionType;
-import org.apache.rocketmq.ons.api.MessageListener;
-import org.apache.rocketmq.ons.api.MessageSelector;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-
-
-public class ConsumerBean implements Consumer {
-
-    private Properties properties;
-
-
-    private Map<Subscription, MessageListener> subscriptionTable;
-
-    private Consumer consumer;
-
-
-    @Override
-    public void start() {
-        if (null == this.properties) {
-            throw new ONSClientException("properties not set");
-        }
-
-        if (null == this.subscriptionTable) {
-            throw new ONSClientException("subscriptionTable not set");
-        }
-
-        this.consumer = ONSFactory.createConsumer(this.properties);
-
-        Iterator<Entry<Subscription, MessageListener>> it = this.subscriptionTable.entrySet().iterator();
-        while (it.hasNext()) {
-            Entry<Subscription, MessageListener> next = it.next();
-            if ("com.aliyun.openservices.ons.api.impl.notify.ConsumerImpl".equals(this.consumer.getClass().getCanonicalName())
-                && (next.getKey() instanceof SubscriptionExt)) {
-                SubscriptionExt subscription = (SubscriptionExt) next.getKey();
-                for (Method method : this.consumer.getClass().getMethods()) {
-                    if ("subscribeNotify".equals(method.getName())) {
-                        try {
-                            method.invoke(consumer, subscription.getTopic(), subscription.getExpression(),
-                                    subscription.isPersistence(), next.getValue());
-                        } catch (Exception e) {
-                            throw new ONSClientException("subscribeNotify invoke exception", e);
-                        }
-                        break;
-                    }
-                }
-
-            } else {
-                Subscription subscription = next.getKey();
-                if (subscription.getType() == null || ExpressionType.TAG.name().equals(subscription.getType())) {
-
-                    this.subscribe(subscription.getTopic(), subscription.getExpression(), next.getValue());
-
-                } else if (ExpressionType.SQL92.name().equals(subscription.getType())) {
-
-                    this.subscribe(subscription.getTopic(), MessageSelector.bySql(subscription.getExpression()), next.getValue());
-                } else {
-
-                    throw new ONSClientException(String.format("Expression type %s is unknown!", subscription.getType()));
-                }
-            }
-
-        }
-
-        this.consumer.start();
-    }
-
-    @Override
-    public void updateCredential(Properties credentialProperties) {
-        if (this.consumer != null) {
-            this.consumer.updateCredential(credentialProperties);
-        }
-    }
-
-
-    @Override
-    public void shutdown() {
-        if (this.consumer != null) {
-            this.consumer.shutdown();
-        }
-    }
-
-    @Override
-    public void subscribe(String topic, String subExpression, MessageListener listener) {
-        if (null == this.consumer) {
-            throw new ONSClientException("subscribe must be called after consumerBean started");
-        }
-        this.consumer.subscribe(topic, subExpression, listener);
-    }
-
-    @Override
-    public void subscribe(final String topic, final MessageSelector selector, final MessageListener listener) {
-        if (null == this.consumer) {
-            throw new ONSClientException("subscribe must be called after consumerBean started");
-        }
-        this.consumer.subscribe(topic, selector, listener);
-    }
-
-    @Override
-    public void unsubscribe(String topic) {
-        if (null == this.consumer) {
-            throw new ONSClientException("unsubscribe must be called after consumerBean started");
-        }
-        this.consumer.unsubscribe(topic);
-    }
-
-    public Properties getProperties() {
-        return properties;
-    }
-
-    public void setProperties(Properties properties) {
-        this.properties = properties;
-    }
-
-    public Map<Subscription, MessageListener> getSubscriptionTable() {
-        return subscriptionTable;
-    }
-
-    public void setSubscriptionTable(Map<Subscription, MessageListener> subscriptionTable) {
-        this.subscriptionTable = subscriptionTable;
-    }
-
-    @Override
-    public boolean isStarted() {
-        return this.consumer.isStarted();
-    }
-
-    @Override
-    public boolean isClosed() {
-        return this.consumer.isClosed();
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/OrderConsumerBean.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/OrderConsumerBean.java
deleted file mode 100644
index e5b6402..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/OrderConsumerBean.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.bean;
-
-import java.util.Map;
-import java.util.Properties;
-import org.apache.rocketmq.ons.api.MessageSelector;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-import org.apache.rocketmq.ons.api.order.MessageOrderListener;
-import org.apache.rocketmq.ons.api.order.OrderConsumer;
-
-public class OrderConsumerBean implements OrderConsumer {
-
-    private Properties properties;
-
-    private Map<Subscription, MessageOrderListener> subscriptionTable;
-
-    private OrderConsumer orderConsumer;
-
-    @Override
-    public boolean isStarted() {
-        return this.orderConsumer.isStarted();
-    }
-
-    @Override
-    public boolean isClosed() {
-        return this.orderConsumer.isClosed();
-    }
-
-    @Override
-    public void start() {
-        if (null == this.properties) {
-            throw new ONSClientException("properties not set");
-        }
-
-        if (null == this.subscriptionTable) {
-            throw new ONSClientException("subscriptionTable not set");
-        }
-
-        this.orderConsumer = ONSFactory.createOrderedConsumer(this.properties);
-
-        for (final Map.Entry<Subscription, MessageOrderListener> next : this.subscriptionTable.entrySet()) {
-            this.subscribe(next.getKey().getTopic(), next.getKey().getExpression(), next.getValue());
-        }
-
-        this.orderConsumer.start();
-    }
-
-    @Override
-    public void updateCredential(Properties credentialProperties) {
-        if (this.orderConsumer != null) {
-            this.orderConsumer.updateCredential(credentialProperties);
-        }
-    }
-
-    @Override
-    public void shutdown() {
-        if (this.orderConsumer != null) {
-            this.orderConsumer.shutdown();
-        }
-    }
-
-    @Override
-    public void subscribe(final String topic, final String subExpression, final MessageOrderListener listener) {
-        if (null == this.orderConsumer) {
-            throw new ONSClientException("subscribe must be called after OrderConsumerBean started");
-        }
-        this.orderConsumer.subscribe(topic, subExpression, listener);
-    }
-
-    @Override
-    public void subscribe(String topic, MessageSelector selector, MessageOrderListener listener) {
-        if (null == this.orderConsumer) {
-            throw new ONSClientException("subscribe must be called after OrderConsumerBean started");
-        }
-        this.orderConsumer.subscribe(topic, selector, listener);
-    }
-
-    public Properties getProperties() {
-        return properties;
-    }
-
-    public void setProperties(final Properties properties) {
-        this.properties = properties;
-    }
-
-    public Map<Subscription, MessageOrderListener> getSubscriptionTable() {
-        return subscriptionTable;
-    }
-
-    public void setSubscriptionTable(
-        final Map<Subscription, MessageOrderListener> subscriptionTable) {
-        this.subscriptionTable = subscriptionTable;
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/OrderProducerBean.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/OrderProducerBean.java
deleted file mode 100644
index 64cf25b..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/OrderProducerBean.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.bean;
-
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.SendResult;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-import org.apache.rocketmq.ons.api.order.OrderProducer;
-import java.util.Properties;
-
-
-public class OrderProducerBean implements OrderProducer {
-
-    private Properties properties;
-
-    private OrderProducer orderProducer;
-
-
-    @Override
-    public void start() {
-        if (null == this.properties) {
-            throw new ONSClientException("properties not set");
-        }
-
-        this.orderProducer = ONSFactory.createOrderProducer(this.properties);
-        this.orderProducer.start();
-    }
-
-    @Override
-    public void updateCredential(Properties credentialProperties) {
-        if (this.orderProducer != null) {
-            this.orderProducer.updateCredential(credentialProperties);
-        }
-    }
-
-
-    @Override
-    public void shutdown() {
-        if (this.orderProducer != null) {
-            this.orderProducer.shutdown();
-        }
-    }
-
-    @Override
-    public boolean isStarted() {
-        return this.orderProducer.isStarted();
-    }
-
-    @Override
-    public boolean isClosed() {
-        return this.orderProducer.isClosed();
-    }
-
-    @Override
-    public SendResult send(final Message message, final String shardingKey) {
-        return this.orderProducer.send(message, shardingKey);
-    }
-
-    public Properties getProperties() {
-        return properties;
-    }
-
-    public void setProperties(final Properties properties) {
-        this.properties = properties;
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/ProducerBean.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/ProducerBean.java
deleted file mode 100644
index 2094158..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/ProducerBean.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.bean;
-
-import java.util.Properties;
-import java.util.concurrent.ExecutorService;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.Producer;
-import org.apache.rocketmq.ons.api.SendCallback;
-import org.apache.rocketmq.ons.api.SendResult;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-
-
-public class ProducerBean implements Producer {
-
-    private Properties properties;
-    private Producer producer;
-
-    @Override
-    public void start() {
-        if (null == this.properties) {
-            throw new ONSClientException("properties not set");
-        }
-
-        this.producer = ONSFactory.createProducer(this.properties);
-        this.producer.start();
-    }
-
-    @Override
-    public void updateCredential(Properties credentialProperties) {
-        if (this.producer != null) {
-            this.producer.updateCredential(credentialProperties);
-        }
-    }
-
-    @Override
-    public void shutdown() {
-        if (this.producer != null) {
-            this.producer.shutdown();
-        }
-    }
-
-
-    @Override
-    public SendResult send(Message message) {
-        return this.producer.send(message);
-    }
-
-
-    @Override
-    public void sendOneway(Message message) {
-        this.producer.sendOneway(message);
-    }
-
-    @Override
-    public void sendAsync(Message message, SendCallback sendCallback) {
-        this.producer.sendAsync(message, sendCallback);
-    }
-
-    @Override
-    public void setCallbackExecutor(final ExecutorService callbackExecutor) {
-        this.producer.setCallbackExecutor(callbackExecutor);
-    }
-
-    public Properties getProperties() {
-        return properties;
-    }
-
-    public void setProperties(Properties properties) {
-        this.properties = properties;
-    }
-
-    @Override
-    public boolean isStarted() {
-        return this.producer.isStarted();
-    }
-
-    @Override
-    public boolean isClosed() {
-        return this.producer.isClosed();
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/Subscription.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/Subscription.java
deleted file mode 100644
index 1840d4d..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/Subscription.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.bean;
-
-import org.apache.rocketmq.ons.api.ExpressionType;
-
-public class Subscription {
-    private String topic;
-    private String expression;
-
-    /**
-     * TAG or SQL92
-     * <br>if null, equals to TAG
-     *
-     * @see ExpressionType#TAG
-     * @see ExpressionType#SQL92
-     */
-    private String type;
-
-    public String getTopic() {
-        return topic;
-    }
-
-    public void setTopic(String topic) {
-        this.topic = topic;
-    }
-
-    public String getExpression() {
-        return expression;
-    }
-
-    public void setExpression(String expression) {
-        this.expression = expression;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(final String type) {
-        this.type = type;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((topic == null) ? 0 : topic.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        Subscription other = (Subscription) obj;
-        if (topic == null) {
-            if (other.topic != null) {
-                return false;
-            }
-        } else if (!topic.equals(other.topic)) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        return "Subscription [topic=" + topic + ", expression=" + expression + ", type=" + type + "]";
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/SubscriptionExt.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/SubscriptionExt.java
deleted file mode 100644
index 7413f90..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/SubscriptionExt.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.bean;
-
-
-public class SubscriptionExt extends Subscription {
-    private boolean persistence = true;
-
-    public boolean isPersistence() {
-        return persistence;
-    }
-
-    public void setPersistence(boolean persistence) {
-        this.persistence = persistence;
-    }
-
-    @Override
-    public int hashCode() {
-        return super.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        return super.equals(obj);
-    }
-
-    @Override
-    public String toString() {
-        return "Subscription [topic=" + super.getTopic() + ", expression=" + super.getExpression()
-            + ", persistence=" + persistence + "]";
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/TransactionProducerBean.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/TransactionProducerBean.java
deleted file mode 100644
index cb55e14..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/bean/TransactionProducerBean.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.bean;
-
-import java.util.Properties;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.SendResult;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-import org.apache.rocketmq.ons.api.transaction.LocalTransactionChecker;
-import org.apache.rocketmq.ons.api.transaction.LocalTransactionExecuter;
-import org.apache.rocketmq.ons.api.transaction.TransactionProducer;
-
-
-public class TransactionProducerBean implements TransactionProducer {
-
-    private Properties properties;
-
-
-    private LocalTransactionChecker localTransactionChecker;
-
-    private TransactionProducer transactionProducer;
-
-
-    @Override
-    public void start() {
-        if (null == this.properties) {
-            throw new ONSClientException("properties not set");
-        }
-
-        this.transactionProducer = ONSFactory.createTransactionProducer(properties, localTransactionChecker);
-        this.transactionProducer.start();
-    }
-
-    @Override
-    public void updateCredential(Properties credentialProperties) {
-        if (this.transactionProducer != null) {
-            this.transactionProducer.updateCredential(credentialProperties);
-        }
-    }
-
-
-    @Override
-    public void shutdown() {
-        if (this.transactionProducer != null) {
-            this.transactionProducer.shutdown();
-        }
-    }
-
-    @Override
-    public SendResult send(Message message, LocalTransactionExecuter executer, Object arg) {
-        return this.transactionProducer.send(message, executer, arg);
-    }
-
-    public Properties getProperties() {
-        return properties;
-    }
-
-    public void setProperties(Properties properties) {
-        this.properties = properties;
-    }
-
-    public LocalTransactionChecker getLocalTransactionChecker() {
-        return localTransactionChecker;
-    }
-
-    public void setLocalTransactionChecker(LocalTransactionChecker localTransactionChecker) {
-        this.localTransactionChecker = localTransactionChecker;
-    }
-
-    @Override
-    public boolean isStarted() {
-        return this.transactionProducer.isStarted();
-    }
-
-    @Override
-    public boolean isClosed() {
-        return this.transactionProducer.isClosed();
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/exception/ONSClientException.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/exception/ONSClientException.java
deleted file mode 100644
index a761e3b..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/exception/ONSClientException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.exception;
-
-
-public class ONSClientException extends RuntimeException {
-    private static final long serialVersionUID = 5755356574640041094L;
-
-
-    public ONSClientException() {
-    }
-
-
-    public ONSClientException(String message) {
-        super(message);
-    }
-
-
-    public ONSClientException(Throwable cause) {
-        super(cause);
-    }
-
-
-    public ONSClientException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/ConsumeOrderContext.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/ConsumeOrderContext.java
deleted file mode 100644
index f7102c3..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/ConsumeOrderContext.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api.order;
-
-public class ConsumeOrderContext {
-
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/MessageOrderListener.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/MessageOrderListener.java
deleted file mode 100644
index 20a4003..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/MessageOrderListener.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.order;
-
-import org.apache.rocketmq.ons.api.Message;
-
-public interface MessageOrderListener {
-
-    OrderAction consume(final Message message, final ConsumeOrderContext context);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/MessageQueueSelector.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/MessageQueueSelector.java
deleted file mode 100644
index bee8d64..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/MessageQueueSelector.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.order;
-
-import org.apache.rocketmq.ons.api.Message;
-
-public interface MessageQueueSelector {
-
-    int select(final int queueTotal, final Message msg, final Object arg);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/OrderAction.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/OrderAction.java
deleted file mode 100644
index e2dc190..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/OrderAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.order;
-
-
-public enum OrderAction {
-
-    Success,
-
-    Suspend,
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/OrderConsumer.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/OrderConsumer.java
deleted file mode 100644
index 4e73c1b..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/OrderConsumer.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.order;
-
-import org.apache.rocketmq.ons.api.Admin;
-import org.apache.rocketmq.ons.api.MessageSelector;
-
-
-public interface OrderConsumer extends Admin {
-
-    @Override
-    void start();
-
-    @Override
-    void shutdown();
-
-    void subscribe(final String topic, final String subExpression, final MessageOrderListener listener);
-
-    void subscribe(final String topic, final MessageSelector selector, final MessageOrderListener listener);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/OrderProducer.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/OrderProducer.java
deleted file mode 100644
index 4e9a0bb..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/order/OrderProducer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.order;
-
-import org.apache.rocketmq.ons.api.Admin;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.SendResult;
-
-
-public interface OrderProducer extends Admin {
-
-    SendResult send(final Message message, final String shardingKey);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/LocalTransactionChecker.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/LocalTransactionChecker.java
deleted file mode 100644
index eb46593..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/LocalTransactionChecker.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rocketmq.ons.api.transaction;
-
-import org.apache.rocketmq.ons.api.Message;
-
-public interface LocalTransactionChecker {
-
-    TransactionStatus check(final Message msg);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/LocalTransactionExecuter.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/LocalTransactionExecuter.java
deleted file mode 100644
index f3fe785..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/LocalTransactionExecuter.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.transaction;
-
-import org.apache.rocketmq.ons.api.Message;
-
-
-public interface LocalTransactionExecuter {
-
-    TransactionStatus execute(final Message msg, final Object arg);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/TransactionProducer.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/TransactionProducer.java
deleted file mode 100644
index c139db1..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/TransactionProducer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.transaction;
-
-import org.apache.rocketmq.ons.api.Admin;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.SendResult;
-
-
-public interface TransactionProducer extends Admin {
-
-    @Override
-    void start();
-
-
-    @Override
-    void shutdown();
-
-
-    SendResult send(final Message message,
-        final LocalTransactionExecuter executer,
-        final Object arg);
-}
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/TransactionStatus.java b/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/TransactionStatus.java
deleted file mode 100644
index c98c9ef..0000000
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/transaction/TransactionStatus.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.ons.api.transaction;
-
-
-public enum TransactionStatus {
-
-    CommitTransaction,
-
-    RollbackTransaction,
-
-    Unknow
-}
diff --git a/ons-core/ons-client/pom.xml b/ons-core/ons-client/pom.xml
index 0bcab99..057bce5 100644
--- a/ons-core/ons-client/pom.xml
+++ b/ons-core/ons-client/pom.xml
@@ -15,7 +15,8 @@
   limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.apache.rocketmq</groupId>
         <artifactId>ons-all</artifactId>
@@ -36,9 +37,9 @@
             <artifactId>commons-codec</artifactId>
         </dependency>
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>ons-api</artifactId>
-            <version>${project.version}</version>
+            <groupId>io.openmessaging</groupId>
+            <artifactId>openmessaging-api</artifactId>
+            <version>1.1.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/ONSFactoryImpl.java b/ons-core/ons-client/src/main/java/io/openmessaging/rocketmq/MessagingAccessPointImpl.java
similarity index 75%
rename from ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/ONSFactoryImpl.java
rename to ons-core/ons-client/src/main/java/io/openmessaging/rocketmq/MessagingAccessPointImpl.java
index 4fca00e..05cb230 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/ONSFactoryImpl.java
+++ b/ons-core/ons-client/src/main/java/io/openmessaging/rocketmq/MessagingAccessPointImpl.java
@@ -15,18 +15,24 @@
  * limitations under the License.
  */
 
-package org.apache.rocketmq.ons.api.impl;
+package io.openmessaging.rocketmq;
 
+import io.openmessaging.Constants;
+import io.openmessaging.Consumer;
+import io.openmessaging.Message;
+import io.openmessaging.MessagingAccessPoint;
+import io.openmessaging.Producer;
+import io.openmessaging.PullConsumer;
+import io.openmessaging.batch.BatchConsumer;
+import io.openmessaging.order.OrderConsumer;
+import io.openmessaging.order.OrderProducer;
+import io.openmessaging.transaction.LocalTransactionChecker;
+import io.openmessaging.transaction.TransactionProducer;
+import io.openmessaging.transaction.TransactionStatus;
+import java.util.Properties;
 import org.apache.rocketmq.client.producer.LocalTransactionState;
 import org.apache.rocketmq.client.producer.TransactionCheckListener;
 import org.apache.rocketmq.common.message.MessageExt;
-import java.util.Properties;
-import org.apache.rocketmq.ons.api.Constants;
-import org.apache.rocketmq.ons.api.Consumer;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.ONSFactoryAPI;
-import org.apache.rocketmq.ons.api.Producer;
-import org.apache.rocketmq.ons.api.batch.BatchConsumer;
 import org.apache.rocketmq.ons.api.impl.rocketmq.BatchConsumerImpl;
 import org.apache.rocketmq.ons.api.impl.rocketmq.ConsumerImpl;
 import org.apache.rocketmq.ons.api.impl.rocketmq.ONSUtil;
@@ -34,19 +40,33 @@ import org.apache.rocketmq.ons.api.impl.rocketmq.OrderConsumerImpl;
 import org.apache.rocketmq.ons.api.impl.rocketmq.OrderProducerImpl;
 import org.apache.rocketmq.ons.api.impl.rocketmq.ProducerImpl;
 import org.apache.rocketmq.ons.api.impl.rocketmq.TransactionProducerImpl;
-import org.apache.rocketmq.ons.api.order.OrderConsumer;
-import org.apache.rocketmq.ons.api.order.OrderProducer;
-import org.apache.rocketmq.ons.api.transaction.LocalTransactionChecker;
-import org.apache.rocketmq.ons.api.transaction.TransactionProducer;
-import org.apache.rocketmq.ons.api.transaction.TransactionStatus;
 
-public class ONSFactoryImpl implements ONSFactoryAPI {
+public class MessagingAccessPointImpl implements MessagingAccessPoint {
+
+    private Properties attributes;
+
+    public MessagingAccessPointImpl(Properties attributes) {
+        this.attributes = attributes;
+    }
+
+    @Override
+    public String version() {
+        return "1.1.3";
+    }
+
+    @Override public Properties attributes() {
+        return null;
+    }
+
+    @Override public PullConsumer createPullConsumer(Properties properties) {
+        return null;
+    }
+
     @Override
     public Producer createProducer(final Properties properties) {
         return new ProducerImpl(ONSUtil.extractProperties(properties));
     }
 
-
     @Override
     public Consumer createConsumer(final Properties properties) {
         return new ConsumerImpl(ONSUtil.extractProperties(properties));
@@ -62,7 +82,6 @@ public class ONSFactoryImpl implements ONSFactoryAPI {
         return new OrderProducerImpl(ONSUtil.extractProperties(properties));
     }
 
-
     @Override
     public OrderConsumer createOrderedConsumer(final Properties properties) {
         return new OrderConsumerImpl(ONSUtil.extractProperties(properties));
@@ -70,7 +89,7 @@ public class ONSFactoryImpl implements ONSFactoryAPI {
 
     @Override
     public TransactionProducer createTransactionProducer(Properties properties,
-                                                         final LocalTransactionChecker checker) {
+        final LocalTransactionChecker checker) {
         return new TransactionProducerImpl(ONSUtil.extractProperties(properties), new TransactionCheckListener() {
             @Override
             public LocalTransactionState checkLocalTransactionState(MessageExt msg) {
diff --git a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/PropertyKeyConst.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/constant/PropertyKeyConst.java
similarity index 97%
rename from ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/PropertyKeyConst.java
rename to ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/constant/PropertyKeyConst.java
index 6862189..ce4cf50 100644
--- a/ons-core/ons-api/src/main/java/org/apache/rocketmq/ons/api/PropertyKeyConst.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/constant/PropertyKeyConst.java
@@ -14,11 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.rocketmq.ons.api;
+package org.apache.rocketmq.ons.api.impl.constant;
 
-import javax.annotation.Generated;
-
-@Generated("ons-api")
 public class PropertyKeyConst {
 
     public static final String MessageModel = "MessageModel";
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/BatchConsumerImpl.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/BatchConsumerImpl.java
index 592a40c..8a77c5e 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/BatchConsumerImpl.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/BatchConsumerImpl.java
@@ -17,6 +17,14 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
+import io.openmessaging.Action;
+import io.openmessaging.Constants;
+import io.openmessaging.ConsumeContext;
+import io.openmessaging.Message;
+import io.openmessaging.PropertyValueConst;
+import io.openmessaging.batch.BatchConsumer;
+import io.openmessaging.batch.BatchMessageListener;
+import io.openmessaging.exception.OMSRuntimeException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -31,16 +39,7 @@ import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
 import org.apache.rocketmq.common.UtilAll;
 import org.apache.rocketmq.common.message.MessageExt;
 import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
-
-import org.apache.rocketmq.ons.api.Action;
-import org.apache.rocketmq.ons.api.Constants;
-import org.apache.rocketmq.ons.api.ConsumeContext;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.PropertyValueConst;
-import org.apache.rocketmq.ons.api.batch.BatchConsumer;
-import org.apache.rocketmq.ons.api.batch.BatchMessageListener;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 
 @Generated("ons-client")
 public class BatchConsumerImpl extends ONSConsumerAbstract implements BatchConsumer {
@@ -74,11 +73,11 @@ public class BatchConsumerImpl extends ONSConsumerAbstract implements BatchConsu
     @Override
     public void subscribe(String topic, String subExpression, BatchMessageListener listener) {
         if (null == topic) {
-            throw new ONSClientException("topic is null");
+            throw new OMSRuntimeException("topic is null");
         }
 
         if (null == listener) {
-            throw new ONSClientException("listener is null");
+            throw new OMSRuntimeException("listener is null");
         }
         this.subscribeTable.put(topic, listener);
         super.subscribe(topic, subExpression);
@@ -110,7 +109,7 @@ public class BatchConsumerImpl extends ONSConsumerAbstract implements BatchConsu
 
             BatchMessageListener listener = BatchConsumerImpl.this.subscribeTable.get(msgList.get(0).getTopic());
             if (null == listener) {
-                throw new ONSClientException("BatchMessageListener is null");
+                throw new OMSRuntimeException("BatchMessageListener is null");
             }
 
             final ConsumeContext context = new ConsumeContext();
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ConsumerImpl.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ConsumerImpl.java
index 415482f..0c5c696 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ConsumerImpl.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ConsumerImpl.java
@@ -17,11 +17,20 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
+import io.openmessaging.Action;
+import io.openmessaging.Constants;
+import io.openmessaging.ConsumeContext;
+import io.openmessaging.Consumer;
+import io.openmessaging.Message;
+import io.openmessaging.MessageListener;
+import io.openmessaging.MessageSelector;
+import io.openmessaging.PropertyValueConst;
+import io.openmessaging.exception.OMSRuntimeException;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
 
+import java.util.concurrent.ConcurrentHashMap;
 import javax.annotation.Generated;
 
 import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
@@ -29,17 +38,7 @@ import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
 import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
 import org.apache.rocketmq.common.message.MessageExt;
 import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
-
-import org.apache.rocketmq.ons.api.Action;
-import org.apache.rocketmq.ons.api.Constants;
-import org.apache.rocketmq.ons.api.ConsumeContext;
-import org.apache.rocketmq.ons.api.Consumer;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.MessageListener;
-import org.apache.rocketmq.ons.api.MessageSelector;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.PropertyValueConst;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 
 @Generated("ons-client")
 public class ConsumerImpl extends ONSConsumerAbstract implements Consumer {
@@ -64,11 +63,11 @@ public class ConsumerImpl extends ONSConsumerAbstract implements Consumer {
     @Override
     public void subscribe(String topic, String subExpression, MessageListener listener) {
         if (null == topic) {
-            throw new ONSClientException("topic is null");
+            throw new OMSRuntimeException("topic is null");
         }
 
         if (null == listener) {
-            throw new ONSClientException("listener is null");
+            throw new OMSRuntimeException("listener is null");
         }
         this.subscribeTable.put(topic, listener);
         super.subscribe(topic, subExpression);
@@ -77,11 +76,11 @@ public class ConsumerImpl extends ONSConsumerAbstract implements Consumer {
     @Override
     public void subscribe(final String topic, final MessageSelector selector, final MessageListener listener) {
         if (null == topic) {
-            throw new ONSClientException("topic is null");
+            throw new OMSRuntimeException("topic is null");
         }
 
         if (null == listener) {
-            throw new ONSClientException("listener is null");
+            throw new OMSRuntimeException("listener is null");
         }
         this.subscribeTable.put(topic, listener);
         super.subscribe(topic, selector);
@@ -111,7 +110,7 @@ public class ConsumerImpl extends ONSConsumerAbstract implements Consumer {
             }
             MessageListener listener = ConsumerImpl.this.subscribeTable.get(msg.getTopic());
             if (null == listener) {
-                throw new ONSClientException("MessageListener is null");
+                throw new OMSRuntimeException("MessageListener is null");
             }
 
             final ConsumeContext context = new ConsumeContext();
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSClientAbstract.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSClientAbstract.java
index 74735e6..1471c56 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSClientAbstract.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSClientAbstract.java
@@ -17,6 +17,9 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
+import io.openmessaging.Credentials;
+import io.openmessaging.LifeCycle;
+import io.openmessaging.exception.OMSRuntimeException;
 import java.util.Properties;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
@@ -30,10 +33,8 @@ import org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl;
 import org.apache.rocketmq.common.UtilAll;
 import org.apache.rocketmq.common.namesrv.TopAddressing;
 import org.apache.rocketmq.logging.InternalLogger;
-import org.apache.rocketmq.ons.api.Admin;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
 import org.apache.rocketmq.ons.api.impl.authority.SessionCredentials;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.api.impl.util.ClientLoggerUtil;
 import org.apache.rocketmq.ons.api.impl.util.NameAddrUtils;
 import org.apache.rocketmq.ons.open.trace.core.dispatch.AsyncDispatcher;
@@ -41,7 +42,7 @@ import org.apache.rocketmq.ons.open.trace.core.dispatch.AsyncDispatcher;
 import static org.apache.rocketmq.common.UtilAll.getPid;
 
 @Generated("ons-client")
-public abstract class ONSClientAbstract implements Admin {
+public abstract class ONSClientAbstract implements LifeCycle, Credentials {
 
     protected static final String WSADDR_INTERNAL = System.getProperty("com.aliyun.openservices.ons.addr.internal",
         "http://onsaddr-internal.aliyun.com:8080/rocketmq/nsaddr4client-internal");
@@ -74,16 +75,16 @@ public abstract class ONSClientAbstract implements Admin {
         this.sessionCredentials.updateContent(properties);
         if (this.sessionCredentials.getOnsChannel().equals(ONSChannel.ALIYUN) &&
             (null == this.sessionCredentials.getAccessKey() || "".equals(this.sessionCredentials.getAccessKey()))) {
-            throw new ONSClientException("please set access key");
+            throw new OMSRuntimeException("please set access key");
         }
 
         if (this.sessionCredentials.getOnsChannel().equals(ONSChannel.ALIYUN) &&
             (null == this.sessionCredentials.getSecretKey() || "".equals(this.sessionCredentials.getSecretKey()))) {
-            throw new ONSClientException("please set secret key");
+            throw new OMSRuntimeException("please set secret key");
         }
 
         if (null == this.sessionCredentials.getOnsChannel()) {
-            throw new ONSClientException("please set ons channel");
+            throw new OMSRuntimeException("please set ons channel");
         }
 
         this.nameServerAddr = getNameSrvAddrFromProperties();
@@ -95,7 +96,7 @@ public abstract class ONSClientAbstract implements Admin {
         }
         this.nameServerAddr = fetchNameServerAddr();
         if (null == nameServerAddr) {
-            throw new ONSClientException(FAQ.errorMessage("Can not find name server, May be your network problem.", FAQ.FIND_NS_FAILED));
+            throw new OMSRuntimeException(FAQ.errorMessage("Can not find name server, May be your network problem.", FAQ.FIND_NS_FAILED));
         }
 
         this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@@ -139,7 +140,7 @@ public abstract class ONSClientAbstract implements Admin {
                     LOGGER.info("connected to user-defined ons addr server, {} success, {}", property, nsAddrs);
                     return nsAddrs;
                 } else {
-                    throw new ONSClientException(FAQ.errorMessage("Can not find name server with onsAddr " + property, FAQ.FIND_NS_FAILED));
+                    throw new OMSRuntimeException(FAQ.errorMessage("Can not find name server with onsAddr " + property, FAQ.FIND_NS_FAILED));
                 }
             }
         }
@@ -208,14 +209,14 @@ public abstract class ONSClientAbstract implements Admin {
     protected void checkONSProducerServiceState(DefaultMQProducerImpl producer) {
         switch (producer.getServiceState()) {
             case CREATE_JUST:
-                throw new ONSClientException(
+                throw new OMSRuntimeException(
                     FAQ.errorMessage(String.format("You do not have start the producer[" + getPid() + "], %s", producer.getServiceState()),
                         FAQ.SERVICE_STATE_WRONG));
             case SHUTDOWN_ALREADY:
-                throw new ONSClientException(FAQ.errorMessage(String.format("Your producer has been shut down, %s", producer.getServiceState()),
+                throw new OMSRuntimeException(FAQ.errorMessage(String.format("Your producer has been shut down, %s", producer.getServiceState()),
                     FAQ.SERVICE_STATE_WRONG));
             case START_FAILED:
-                throw new ONSClientException(FAQ.errorMessage(
+                throw new OMSRuntimeException(FAQ.errorMessage(
                     String.format("When you start your service throws an exception, %s", producer.getServiceState()), FAQ.SERVICE_STATE_WRONG));
             case RUNNING:
                 break;
@@ -240,13 +241,13 @@ public abstract class ONSClientAbstract implements Admin {
         if (this.sessionCredentials.getOnsChannel().equals(ONSChannel.ALIYUN) &&
             (null == credentialProperties.getProperty(SessionCredentials.AccessKey)
                 || "".equals(credentialProperties.getProperty(SessionCredentials.AccessKey)))) {
-            throw new ONSClientException("update credential failed. please set access key.");
+            throw new OMSRuntimeException("update credential failed. please set access key.");
         }
 
         if (this.sessionCredentials.getOnsChannel().equals(ONSChannel.ALIYUN) &&
             (null == credentialProperties.getProperty(SessionCredentials.SecretKey)
                 || "".equals(credentialProperties.getProperty(SessionCredentials.SecretKey)))) {
-            throw new ONSClientException("update credential failed. please set secret key");
+            throw new OMSRuntimeException("update credential failed. please set secret key");
         }
         this.sessionCredentials.updateContent(credentialProperties);
     }
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSConsumerAbstract.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSConsumerAbstract.java
index 5844ebc..f9488d5 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSConsumerAbstract.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSConsumerAbstract.java
@@ -17,22 +17,20 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
+import io.openmessaging.MessageSelector;
+import io.openmessaging.exception.OMSRuntimeException;
 import java.util.Properties;
-
-import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceConstants;
-import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceDispatcherType;
-import org.apache.rocketmq.ons.open.trace.core.dispatch.impl.AsyncArrayDispatcher;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
 import org.apache.rocketmq.client.exception.MQClientException;
 import org.apache.rocketmq.common.UtilAll;
 import org.apache.rocketmq.logging.InternalLogger;
-
-import org.apache.rocketmq.ons.api.MessageSelector;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.api.impl.tracehook.OnsConsumeMessageHookImpl;
 import org.apache.rocketmq.ons.api.impl.util.ClientLoggerUtil;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceConstants;
+import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceDispatcherType;
+import org.apache.rocketmq.ons.open.trace.core.dispatch.impl.AsyncArrayDispatcher;
 import org.apache.rocketmq.remoting.protocol.LanguageCode;
 
 public class ONSConsumerAbstract extends ONSClientAbstract {
@@ -52,7 +50,7 @@ public class ONSConsumerAbstract extends ONSClientAbstract {
 
         String consumerGroup = properties.getProperty(PropertyKeyConst.GROUP_ID, properties.getProperty(PropertyKeyConst.ConsumerId));
         if (StringUtils.isEmpty(consumerGroup)) {
-            throw new ONSClientException("ConsumerId property is null");
+            throw new OMSRuntimeException("ConsumerId property is null");
         }
 
         this.defaultMQPushConsumer =
@@ -146,7 +144,7 @@ public class ONSConsumerAbstract extends ONSClientAbstract {
         try {
             this.defaultMQPushConsumer.subscribe(topic, subExpression);
         } catch (MQClientException e) {
-            throw new ONSClientException("defaultMQPushConsumer subscribe exception", e);
+            throw new OMSRuntimeException("defaultMQPushConsumer subscribe exception", e);
         }
     }
 
@@ -155,7 +153,7 @@ public class ONSConsumerAbstract extends ONSClientAbstract {
         String type = org.apache.rocketmq.common.filter.ExpressionType.TAG;
         if (selector != null) {
             if (selector.getType() == null) {
-                throw new ONSClientException("Expression type is null!");
+                throw new OMSRuntimeException("Expression type is null!");
             }
             subExpression = selector.getSubExpression();
             type = selector.getType().name();
@@ -167,13 +165,13 @@ public class ONSConsumerAbstract extends ONSClientAbstract {
         } else if (org.apache.rocketmq.common.filter.ExpressionType.TAG.equals(type)) {
             messageSelector = org.apache.rocketmq.client.consumer.MessageSelector.byTag(subExpression);
         } else {
-            throw new ONSClientException(String.format("Expression type %s is unknown!", type));
+            throw new OMSRuntimeException(String.format("Expression type %s is unknown!", type));
         }
 
         try {
             this.defaultMQPushConsumer.subscribe(topic, messageSelector);
         } catch (MQClientException e) {
-            throw new ONSClientException("Consumer subscribe exception", e);
+            throw new OMSRuntimeException("Consumer subscribe exception", e);
         }
     }
 
@@ -189,7 +187,7 @@ public class ONSConsumerAbstract extends ONSClientAbstract {
                 super.start();
             }
         } catch (Exception e) {
-            throw new ONSClientException(e.getMessage());
+            throw new OMSRuntimeException(e.getMessage());
         }
     }
 
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSUtil.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSUtil.java
index e6fac51..c90d9c3 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSUtil.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSUtil.java
@@ -17,6 +17,9 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
+import io.openmessaging.Message;
+import io.openmessaging.MessageAccessor;
+import io.openmessaging.exception.OMSRuntimeException;
 import java.lang.reflect.Field;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -24,20 +27,14 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Set;
-
 import org.apache.rocketmq.common.message.MessageConst;
 import org.apache.rocketmq.common.message.MessageExt;
 
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.MessageAccessor;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-
 public class ONSUtil {
     private static final Set<String> RESERVED_KEY_SET_RMQ = new HashSet<String>();
 
     private static final Set<String> RESERVED_KEY_SET_ONS = new HashSet<String>();
 
-
     static {
 
         /**
@@ -68,11 +65,10 @@ public class ONSUtil {
         RESERVED_KEY_SET_ONS.add(Message.SystemPropKey.SHARDINGKEY);
     }
 
-
     public static org.apache.rocketmq.common.message.Message msgConvert(Message message) {
         org.apache.rocketmq.common.message.Message msgRMQ = new org.apache.rocketmq.common.message.Message();
         if (message == null) {
-            throw new ONSClientException("\'message\' is null");
+            throw new OMSRuntimeException("\'message\' is null");
         }
 
         if (message.getTopic() != null) {
@@ -102,7 +98,7 @@ public class ONSUtil {
                 Entry<Object, Object> next = it.next();
                 if (!RESERVED_KEY_SET_ONS.contains(next.getKey().toString())) {
                     org.apache.rocketmq.common.message.MessageAccessor.putProperty(msgRMQ, next.getKey().toString(),
-                            next.getValue().toString());
+                        next.getValue().toString());
                 }
             }
         }
@@ -114,7 +110,7 @@ public class ONSUtil {
                 Entry<Object, Object> next = it.next();
                 if (!RESERVED_KEY_SET_RMQ.contains(next.getKey().toString())) {
                     org.apache.rocketmq.common.message.MessageAccessor.putProperty(msgRMQ, next.getKey().toString(),
-                            next.getValue().toString());
+                        next.getValue().toString());
                 }
             }
         }
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/OrderConsumerImpl.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/OrderConsumerImpl.java
index 4004f3e..d9c9b8a 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/OrderConsumerImpl.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/OrderConsumerImpl.java
@@ -17,6 +17,13 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
+import io.openmessaging.Message;
+import io.openmessaging.MessageSelector;
+import io.openmessaging.exception.OMSRuntimeException;
+import io.openmessaging.order.ConsumeOrderContext;
+import io.openmessaging.order.MessageOrderListener;
+import io.openmessaging.order.OrderAction;
+import io.openmessaging.order.OrderConsumer;
 import java.util.List;
 import java.util.Properties;
 import java.util.concurrent.ConcurrentHashMap;
@@ -26,15 +33,7 @@ import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyStatus;
 import org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly;
 import org.apache.rocketmq.common.UtilAll;
 import org.apache.rocketmq.common.message.MessageExt;
-
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.MessageSelector;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-import org.apache.rocketmq.ons.api.order.ConsumeOrderContext;
-import org.apache.rocketmq.ons.api.order.MessageOrderListener;
-import org.apache.rocketmq.ons.api.order.OrderAction;
-import org.apache.rocketmq.ons.api.order.OrderConsumer;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 
 public class OrderConsumerImpl extends ONSConsumerAbstract implements OrderConsumer {
     private final ConcurrentHashMap<String, MessageOrderListener> subscribeTable = new ConcurrentHashMap<String, MessageOrderListener>();
@@ -59,11 +58,11 @@ public class OrderConsumerImpl extends ONSConsumerAbstract implements OrderConsu
     @Override
     public void subscribe(String topic, String subExpression, MessageOrderListener listener) {
         if (null == topic) {
-            throw new ONSClientException("topic is null");
+            throw new OMSRuntimeException("topic is null");
         }
 
         if (null == listener) {
-            throw new ONSClientException("listener is null");
+            throw new OMSRuntimeException("listener is null");
         }
         this.subscribeTable.put(topic, listener);
         super.subscribe(topic, subExpression);
@@ -72,11 +71,11 @@ public class OrderConsumerImpl extends ONSConsumerAbstract implements OrderConsu
     @Override
     public void subscribe(final String topic, final MessageSelector selector, final MessageOrderListener listener) {
         if (null == topic) {
-            throw new ONSClientException("topic is null");
+            throw new OMSRuntimeException("topic is null");
         }
 
         if (null == listener) {
-            throw new ONSClientException("listener is null");
+            throw new OMSRuntimeException("listener is null");
         }
         this.subscribeTable.put(topic, listener);
         super.subscribe(topic, selector);
@@ -92,7 +91,7 @@ public class OrderConsumerImpl extends ONSConsumerAbstract implements OrderConsu
 
             MessageOrderListener listener = OrderConsumerImpl.this.subscribeTable.get(msg.getTopic());
             if (null == listener) {
-                throw new ONSClientException("MessageOrderListener is null");
+                throw new OMSRuntimeException("MessageOrderListener is null");
             }
 
             final ConsumeOrderContext context = new ConsumeOrderContext();
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/OrderProducerImpl.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/OrderProducerImpl.java
index 651c65b..d46b769 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/OrderProducerImpl.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/OrderProducerImpl.java
@@ -17,25 +17,24 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
+import io.openmessaging.Message;
+import io.openmessaging.SendResult;
+import io.openmessaging.exception.OMSRuntimeException;
+import io.openmessaging.order.OrderProducer;
 import java.util.List;
 import java.util.Properties;
-
-import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceConstants;
-import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceDispatcherType;
-import org.apache.rocketmq.ons.open.trace.core.dispatch.impl.AsyncArrayDispatcher;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.rocketmq.client.producer.DefaultMQProducer;
 import org.apache.rocketmq.common.UtilAll;
 import org.apache.rocketmq.common.message.MessageQueue;
 import org.apache.rocketmq.logging.InternalLogger;
 
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.SendResult;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.api.impl.tracehook.OnsClientSendMessageHookImpl;
 import org.apache.rocketmq.ons.api.impl.util.ClientLoggerUtil;
-import org.apache.rocketmq.ons.api.order.OrderProducer;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceConstants;
+import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceDispatcherType;
+import org.apache.rocketmq.ons.open.trace.core.dispatch.impl.AsyncArrayDispatcher;
 import org.apache.rocketmq.remoting.protocol.LanguageCode;
 
 public class OrderProducerImpl extends ONSClientAbstract implements OrderProducer {
@@ -63,6 +62,7 @@ public class OrderProducerImpl extends ONSClientAbstract implements OrderProduce
 
 //        boolean addExtendUniqInfo = Boolean.parseBoolean(properties.getProperty(PropertyKeyConst.EXACTLYONCE_DELIVERY, "false"));
 //        this.defaultMQProducer.setAddExtendUniqInfo(addExtendUniqInfo);
+
         if (properties.containsKey(PropertyKeyConst.LANGUAGE_IDENTIFIER)) {
             int language = Integer.valueOf(properties.get(PropertyKeyConst.LANGUAGE_IDENTIFIER).toString());
             byte languageByte = (byte) language;
@@ -109,7 +109,7 @@ public class OrderProducerImpl extends ONSClientAbstract implements OrderProduce
                 super.start();
             }
         } catch (Exception e) {
-            throw new ONSClientException(e.getMessage());
+            throw new OMSRuntimeException(e.getMessage());
         }
     }
 
@@ -124,7 +124,7 @@ public class OrderProducerImpl extends ONSClientAbstract implements OrderProduce
     @Override
     public SendResult send(final Message message, final String shardingKey) {
         if (UtilAll.isBlank(shardingKey)) {
-            throw new ONSClientException("\'shardingKey\' is blank.");
+            throw new OMSRuntimeException("\'shardingKey\' is blank.");
         }
         message.setShardingKey(shardingKey);
         this.checkONSProducerServiceState(this.defaultMQProducer.getDefaultMQProducerImpl());
@@ -148,7 +148,7 @@ public class OrderProducerImpl extends ONSClientAbstract implements OrderProduce
             sendResult.setMessageId(sendResultRMQ.getMsgId());
             return sendResult;
         } catch (Exception e) {
-            throw new ONSClientException("defaultMQProducer send order exception", e);
+            throw new OMSRuntimeException("defaultMQProducer send order exception", e);
         }
     }
 }
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ProducerImpl.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ProducerImpl.java
index 08f104d..d40b785 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ProducerImpl.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ProducerImpl.java
@@ -17,9 +17,16 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
+import io.openmessaging.Message;
+import io.openmessaging.OnExceptionContext;
+import io.openmessaging.Producer;
+import io.openmessaging.SendCallback;
+import io.openmessaging.SendResult;
+import io.openmessaging.exception.OMSRuntimeException;
 import java.util.Properties;
 import java.util.concurrent.ExecutorService;
 
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceConstants;
 import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceDispatcherType;
 import org.apache.rocketmq.ons.open.trace.core.dispatch.impl.AsyncArrayDispatcher;
@@ -33,13 +40,7 @@ import org.apache.rocketmq.logging.InternalLogger;
 import org.apache.rocketmq.remoting.exception.RemotingConnectException;
 import org.apache.rocketmq.remoting.exception.RemotingTimeoutException;
 
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.OnExceptionContext;
-import org.apache.rocketmq.ons.api.Producer;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.SendCallback;
-import org.apache.rocketmq.ons.api.SendResult;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
+
 import org.apache.rocketmq.ons.api.impl.tracehook.OnsClientSendMessageHookImpl;
 import org.apache.rocketmq.ons.api.impl.util.ClientLoggerUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -74,6 +75,7 @@ public class ProducerImpl extends ONSClientAbstract implements Producer {
 //        if (properties.containsKey(PropertyKeyConst.EXACTLYONCE_DELIVERY)) {
 //            this.defaultMQProducer.setAddExtendUniqInfo(Boolean.valueOf(properties.get(PropertyKeyConst.EXACTLYONCE_DELIVERY).toString()));
 //        }
+
         if (properties.containsKey(PropertyKeyConst.LANGUAGE_IDENTIFIER)) {
             int language = Integer.valueOf(properties.get(PropertyKeyConst.LANGUAGE_IDENTIFIER).toString());
             byte languageByte = (byte) language;
@@ -121,7 +123,7 @@ public class ProducerImpl extends ONSClientAbstract implements Producer {
                 super.start();
             }
         } catch (Exception e) {
-            throw new ONSClientException(e.getMessage());
+            throw new OMSRuntimeException(e.getMessage());
         }
     }
 
@@ -200,7 +202,7 @@ public class ProducerImpl extends ONSClientAbstract implements Producer {
                 //String topic = new String(message.getTopic());
                 //String msgId = new String(message.getMsgID());
                 LOGGER.error(String.format("Send message async Exception, %s", message), e);
-                ONSClientException onsEx = checkProducerException(message.getTopic(), message.getMsgID(), e);
+                OMSRuntimeException onsEx = checkProducerException(message.getTopic(), message.getMsgID(), e);
                 OnExceptionContext context = new OnExceptionContext();
                 context.setTopic(message.getTopic());
                 context.setMessageId(message.getMsgID());
@@ -219,34 +221,39 @@ public class ProducerImpl extends ONSClientAbstract implements Producer {
         return sendResult;
     }
 
-    private ONSClientException checkProducerException(String topic, String msgId, Throwable e) {
+    @Override
+    public SendResult send(Message message, String shardingKey) {
+        return null;
+    }
+
+    private OMSRuntimeException checkProducerException(String topic, String msgId, Throwable e) {
         if (e instanceof MQClientException) {
             if (e.getCause() != null) {
                 if (e.getCause() instanceof RemotingConnectException) {
-                    return new ONSClientException(
+                    return new OMSRuntimeException(
                         FAQ.errorMessage(String.format("Connect broker failed, Topic=%s, msgId=%s", topic, msgId), FAQ.CONNECT_BROKER_FAILED));
                 } else if (e.getCause() instanceof RemotingTimeoutException) {
-                    return new ONSClientException(FAQ.errorMessage(String.format("Send message to broker timeout, %dms, Topic=%s, msgId=%s",
+                    return new OMSRuntimeException(FAQ.errorMessage(String.format("Send message to broker timeout, %dms, Topic=%s, msgId=%s",
                         this.defaultMQProducer.getSendMsgTimeout(), topic, msgId), FAQ.SEND_MSG_TO_BROKER_TIMEOUT));
                 } else if (e.getCause() instanceof MQBrokerException) {
                     MQBrokerException excep = (MQBrokerException) e.getCause();
-                    return new ONSClientException(FAQ.errorMessage(
+                    return new OMSRuntimeException(FAQ.errorMessage(
                         String.format("Receive a broker exception, Topic=%s, msgId=%s, %s", topic, msgId, excep.getErrorMessage()),
                         FAQ.BROKER_RESPONSE_EXCEPTION));
                 }
             } else {
                 MQClientException excep = (MQClientException) e;
                 if (-1 == excep.getResponseCode()) {
-                    return new ONSClientException(
+                    return new OMSRuntimeException(
                         FAQ.errorMessage(String.format("Topic does not exist, Topic=%s, msgId=%s", topic, msgId), FAQ.TOPIC_ROUTE_NOT_EXIST));
                 } else if (ResponseCode.MESSAGE_ILLEGAL == excep.getResponseCode()) {
-                    return new ONSClientException(
+                    return new OMSRuntimeException(
                         FAQ.errorMessage(String.format("ONS Client check message exception, Topic=%s, msgId=%s", topic, msgId),
                             FAQ.CLIENT_CHECK_MSG_EXCEPTION));
                 }
             }
         }
 
-        return new ONSClientException("defaultMQProducer send exception", e);
+        return new OMSRuntimeException("defaultMQProducer send exception", e);
     }
 }
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/TransactionProducerImpl.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/TransactionProducerImpl.java
index 13ed7e4..3c44f14 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/TransactionProducerImpl.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/TransactionProducerImpl.java
@@ -17,6 +17,12 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
+import io.openmessaging.Constants;
+import io.openmessaging.Message;
+import io.openmessaging.SendResult;
+import io.openmessaging.transaction.LocalTransactionExecutor;
+import io.openmessaging.transaction.TransactionProducer;
+import io.openmessaging.transaction.TransactionStatus;
 import java.util.Properties;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.rocketmq.client.exception.MQClientException;
@@ -25,15 +31,9 @@ import org.apache.rocketmq.client.producer.TransactionCheckListener;
 import org.apache.rocketmq.client.producer.TransactionMQProducer;
 import org.apache.rocketmq.common.UtilAll;
 import org.apache.rocketmq.logging.InternalLogger;
-import org.apache.rocketmq.ons.api.Constants;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.SendResult;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.api.impl.tracehook.OnsClientSendMessageHookImpl;
 import org.apache.rocketmq.ons.api.impl.util.ClientLoggerUtil;
-import org.apache.rocketmq.ons.api.transaction.LocalTransactionExecuter;
-import org.apache.rocketmq.ons.api.transaction.TransactionProducer;
-import org.apache.rocketmq.ons.api.transaction.TransactionStatus;
 import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceConstants;
 import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceDispatcherType;
 import org.apache.rocketmq.ons.open.trace.core.dispatch.impl.AsyncArrayDispatcher;
@@ -123,7 +123,7 @@ public class TransactionProducerImpl extends ONSClientAbstract implements Transa
     }
 
     @Override
-    public SendResult send(final Message message, final LocalTransactionExecuter executer, Object arg) {
+    public SendResult send(final Message message, final LocalTransactionExecutor executer, Object arg) {
         this.checkONSProducerServiceState(this.transactionMQProducer.getDefaultMQProducerImpl());
         org.apache.rocketmq.common.message.Message msgRMQ = ONSUtil.msgConvert(message);
         org.apache.rocketmq.client.producer.TransactionSendResult sendResultRMQ = null;
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/tracehook/OnsClientSendMessageHookImpl.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/tracehook/OnsClientSendMessageHookImpl.java
index c6fbe10..6385ad9 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/tracehook/OnsClientSendMessageHookImpl.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/tracehook/OnsClientSendMessageHookImpl.java
@@ -17,17 +17,16 @@
 package org.apache.rocketmq.ons.api.impl.tracehook;
 
 import java.util.ArrayList;
-
-import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceBean;
-import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceConstants;
-import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceContext;
-import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceType;
-import org.apache.rocketmq.ons.open.trace.core.dispatch.AsyncDispatcher;
 import org.apache.rocketmq.client.hook.SendMessageContext;
 import org.apache.rocketmq.client.hook.SendMessageHook;
 import org.apache.rocketmq.client.producer.SendStatus;
 import org.apache.rocketmq.common.MixAll;
 import org.apache.rocketmq.common.protocol.NamespaceUtil;
+import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceBean;
+import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceConstants;
+import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceContext;
+import org.apache.rocketmq.ons.open.trace.core.common.OnsTraceType;
+import org.apache.rocketmq.ons.open.trace.core.dispatch.AsyncDispatcher;
 
 public class OnsClientSendMessageHookImpl implements SendMessageHook {
 
diff --git a/ons-core/ons-client/src/test/java/org/apache/rocketmq/ons/api/impl/rocketmq/NameServerAutoUpdateTest.java b/ons-core/ons-client/src/test/java/org/apache/rocketmq/ons/api/impl/rocketmq/NameServerAutoUpdateTest.java
index e04d890..52e7d2d 100644
--- a/ons-core/ons-client/src/test/java/org/apache/rocketmq/ons/api/impl/rocketmq/NameServerAutoUpdateTest.java
+++ b/ons-core/ons-client/src/test/java/org/apache/rocketmq/ons/api/impl/rocketmq/NameServerAutoUpdateTest.java
@@ -17,77 +17,83 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
-import org.apache.rocketmq.ons.api.Consumer;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.Producer;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-import org.apache.rocketmq.ons.api.order.OrderProducer;
+import io.openmessaging.Consumer;
+import io.openmessaging.MessagingAccessPoint;
+import io.openmessaging.OMS;
+import io.openmessaging.Producer;
+import io.openmessaging.exception.OMSRuntimeException;
+import io.openmessaging.order.OrderProducer;
+import java.util.Properties;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.rules.ExpectedException;
 
-import java.util.Properties;
-
 public class NameServerAutoUpdateTest {
 
     @Rule
     public ExpectedException expectedException = ExpectedException.none();
 
+    private MessagingAccessPoint messagingAccessPoint;
+
+    @Before
+    public void init() {
+        messagingAccessPoint = OMS.getMessagingAccessPoint("oms:rocketmq://alice@rocketmq.apache.org/us-east");
+    }
+
     @org.junit.Test
     public void testNamesrv_setNsAddr() {
         Properties prop = buildProps();
         prop.setProperty(PropertyKeyConst.NAMESRV_ADDR, "xxx-whatever");
-        Consumer consumer = ONSFactory.createConsumer(prop);
+        Consumer consumer = messagingAccessPoint.createConsumer(prop);
         consumer.start();
     }
 
     @org.junit.Test
     public void testNamesrv_setOnsAddr_invalid() {
-        expectedException.expect(ONSClientException.class);
+        expectedException.expect(OMSRuntimeException.class);
         expectedException.expectMessage("onsAddr " + "xxx");
 
         Properties prop = buildProps();
         prop.setProperty(PropertyKeyConst.ONSAddr, "xxx");
-        Consumer consumer = ONSFactory.createConsumer(prop);
+        Consumer consumer = messagingAccessPoint.createConsumer(prop);
         consumer.start();
     }
 
     @org.junit.Test
     public void testNamesrv_setOnsAddr_valid() throws InterruptedException {
         Properties prop = buildProps();
-        prop.setProperty(PropertyKeyConst.ONSAddr, "http://onsaddr-internet.aliyun.com/rocketmq/nsaddr4client-internet");
-        Consumer consumer = ONSFactory.createConsumer(prop);
+        prop.setProperty(PropertyKeyConst.ONSAddr, "http://xxxx/rocketmq/nsaddr4client-internet");
+        Consumer consumer = messagingAccessPoint.createConsumer(prop);
         consumer.start();
     }
 
     @org.junit.Test
     public void testNamesrv_notSetOnsAddr_useInternet_default() throws InterruptedException {
         Properties prop = buildProps();
-        Consumer consumer = ONSFactory.createConsumer(prop);
+        Consumer consumer = messagingAccessPoint.createConsumer(prop);
         consumer.start();
     }
 
     @org.junit.Test
     public void testNamesrv_notSetOnsAddr_useInternet_default_Producer() throws InterruptedException {
         Properties prop = buildProps();
-        Producer producer = ONSFactory.createProducer(prop);
+        Producer producer = messagingAccessPoint.createProducer(prop);
         producer.start();
     }
 
     @org.junit.Test
     public void testNamesrv_notSetOnsAddr_useInternet_default_OrderProcucer() throws InterruptedException {
         Properties prop = buildProps();
-        OrderProducer producer = ONSFactory.createOrderProducer(prop);
+        OrderProducer producer = messagingAccessPoint.createOrderProducer(prop);
         producer.start();
     }
 
     private static Properties buildProps() {
         Properties properties = new Properties();
 
-        properties.put(PropertyKeyConst.ConsumerId, "metaq-consumer-01_SELF");
-        // 鉴权用 AccessKey,在阿里云服务器管理控制台创建
+        properties.put(PropertyKeyConst.GROUP_ID, "group");
         properties.put(PropertyKeyConst.AccessKey, "XXX");
-        // 鉴权用 SecretKey,在阿里云服务器管理控制台创建
         properties.put(PropertyKeyConst.SecretKey, "XXX");
         return properties;
     }
diff --git a/ons-core/ons-client/src/test/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSClientTokenUpdateTest.java b/ons-core/ons-client/src/test/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSClientTokenUpdateTest.java
index 245fddd..8a7386d 100644
--- a/ons-core/ons-client/src/test/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSClientTokenUpdateTest.java
+++ b/ons-core/ons-client/src/test/java/org/apache/rocketmq/ons/api/impl/rocketmq/ONSClientTokenUpdateTest.java
@@ -17,20 +17,23 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
+import io.openmessaging.Consumer;
+import io.openmessaging.Message;
+import io.openmessaging.MessagingAccessPoint;
+import io.openmessaging.OMS;
+import io.openmessaging.OMSBuiltinKeys;
+import io.openmessaging.Producer;
+import io.openmessaging.SendResult;
+import io.openmessaging.exception.OMSRuntimeException;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
-import org.apache.rocketmq.ons.api.Consumer;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.Producer;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.SendResult;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
 import org.apache.rocketmq.ons.api.impl.authority.SessionCredentials;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.remoting.netty.NettyRemotingClient;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -38,6 +41,14 @@ public class ONSClientTokenUpdateTest {
 
     private static final String TOPIC = "STS_TOPIC_TEST_MOLING";
 
+    private MessagingAccessPoint messagingAccessPoint;
+
+    @Before
+    public void init() {
+        messagingAccessPoint = OMS.getMessagingAccessPoint("oms:rocketmq://alice@rocketmq.apache.org/us-east");
+    }
+
+
     @Ignore
     public void testSend() throws InterruptedException {
 
@@ -62,7 +73,7 @@ public class ONSClientTokenUpdateTest {
             }
         };
 
-        Producer producer = ONSFactory.createProducer(buildProps(
+        Producer producer = messagingAccessPoint.createProducer(buildProps(
             "ak",
             "sk",
             "token",
@@ -88,15 +99,15 @@ public class ONSClientTokenUpdateTest {
 
     @Test
     public void test_ConsumerImpl() throws NoSuchFieldException, IllegalAccessException {
-        Consumer consumer = ONSFactory.createConsumer(buildProps("ak", "sk", "token", ONSChannel.ALIYUN.name()));
+        Consumer consumer = messagingAccessPoint.createConsumer(buildProps("ak", "sk", "token", ONSChannel.ALIYUN.name()));
         ONSConsumerAbstract subImpl = (ONSConsumerAbstract) consumer;
         consumer.start();
 
         Assert.assertTrue(subImpl.defaultMQPushConsumer.getDefaultMQPushConsumerImpl().getmQClientFactory().getMQClientAPIImpl().getRemotingClient() instanceof NettyRemotingClient);
         NettyRemotingClient remotingClient =
             (NettyRemotingClient) subImpl.defaultMQPushConsumer.getDefaultMQPushConsumerImpl().getmQClientFactory().getMQClientAPIImpl().getRemotingClient();
-        Assert.assertTrue(remotingClient.getRPCHooks() instanceof ClientRPCHook);
-        ClientRPCHook clientRPCHook = (ClientRPCHook) remotingClient.getRPCHooks();
+        Assert.assertTrue(remotingClient.getRPCHooks() instanceof List);
+        ClientRPCHook clientRPCHook = (ClientRPCHook) remotingClient.getRPCHooks().get(0);
         Field field = ClientRPCHook.class.getDeclaredField("sessionCredentials");
         field.setAccessible(true);
         SessionCredentials credentials = (SessionCredentials) field.get(clientRPCHook);
@@ -116,15 +127,15 @@ public class ONSClientTokenUpdateTest {
 
     @Test
     public void test_ProducerImpl() throws NoSuchFieldException, IllegalAccessException {
-        Producer producer = ONSFactory.createProducer(buildProps("ak", "sk", "token", ONSChannel.ALIYUN.name()));
+        Producer producer = messagingAccessPoint.createProducer(buildProps("ak", "sk", "token", ONSChannel.ALIYUN.name()));
         ProducerImpl subImpl = (ProducerImpl) producer;
         producer.start();
 
         Assert.assertTrue(subImpl.getDefaultMQProducer().getDefaultMQProducerImpl().getmQClientFactory().getMQClientAPIImpl().getRemotingClient() instanceof NettyRemotingClient);
         NettyRemotingClient remotingClient =
             (NettyRemotingClient) subImpl.getDefaultMQProducer().getDefaultMQProducerImpl().getmQClientFactory().getMQClientAPIImpl().getRemotingClient();
-        Assert.assertTrue(remotingClient.getRPCHooks() instanceof ClientRPCHook);
-        ClientRPCHook clientRPCHook = (ClientRPCHook) remotingClient.getRPCHooks();
+        Assert.assertTrue(remotingClient.getRPCHooks() instanceof List);
+        ClientRPCHook clientRPCHook = (ClientRPCHook) remotingClient.getRPCHooks().get(0);
         Field field = ClientRPCHook.class.getDeclaredField("sessionCredentials");
         field.setAccessible(true);
         SessionCredentials credentials = (SessionCredentials) field.get(clientRPCHook);
@@ -144,15 +155,15 @@ public class ONSClientTokenUpdateTest {
 
     @Test
     public void test_ConsumerImpl_updateNull() throws NoSuchFieldException, IllegalAccessException {
-        Consumer consumer = ONSFactory.createConsumer(buildProps("ak", "sk", "token", ONSChannel.ALIYUN.name()));
+        Consumer consumer = messagingAccessPoint.createConsumer(buildProps("ak", "sk", "token", ONSChannel.ALIYUN.name()));
         ONSConsumerAbstract subImpl = (ONSConsumerAbstract) consumer;
         consumer.start();
 
         Assert.assertTrue(subImpl.defaultMQPushConsumer.getDefaultMQPushConsumerImpl().getmQClientFactory().getMQClientAPIImpl().getRemotingClient() instanceof NettyRemotingClient);
         NettyRemotingClient remotingClient =
             (NettyRemotingClient) subImpl.defaultMQPushConsumer.getDefaultMQPushConsumerImpl().getmQClientFactory().getMQClientAPIImpl().getRemotingClient();
-        Assert.assertTrue(remotingClient.getRPCHooks() instanceof ClientRPCHook);
-        ClientRPCHook clientRPCHook = (ClientRPCHook) remotingClient.getRPCHooks();
+        Assert.assertTrue(remotingClient.getRPCHooks() instanceof List);
+        ClientRPCHook clientRPCHook = (ClientRPCHook) remotingClient.getRPCHooks().get(0);
         Field field = ClientRPCHook.class.getDeclaredField("sessionCredentials");
         field.setAccessible(true);
         SessionCredentials credentials = (SessionCredentials) field.get(clientRPCHook);
@@ -165,7 +176,7 @@ public class ONSClientTokenUpdateTest {
         try {
             consumer.updateCredential(buildProps("nak", "", "ntoken", ONSChannel.CLOUD.name()));
         } catch (Exception e) {
-            Assert.assertTrue(e instanceof ONSClientException);
+            Assert.assertTrue(e instanceof OMSRuntimeException);
         }
 
         Assert.assertEquals("ak", credentials.getAccessKey());
diff --git a/ons-core/pom.xml b/ons-core/pom.xml
index 27e4142..f93ca53 100644
--- a/ons-core/pom.xml
+++ b/ons-core/pom.xml
@@ -30,7 +30,6 @@
     <description>https://github.com/alibaba/RocketMQ/blob/develop/README.md</description>
     <modules>
         <module>ons-client</module>
-        <module>ons-api</module>
         <module>ons-trace-core</module>
         <module>ons-auth4client</module>
     </modules>
@@ -41,11 +40,11 @@
         <maven.jdoc.skip>true</maven.jdoc.skip>
         <downloadSources>true</downloadSources>
         <!-- compiler settings properties -->
-        <java_source_version>1.6</java_source_version>
-        <java_target_version>1.6</java_target_version>
+        <java_source_version>1.8</java_source_version>
+        <java_target_version>1.8</java_target_version>
         <file_encoding>UTF-8</file_encoding>
         <!-- Always use stable version of RocketMQ -->
-        <rocketmq.version>4.5.1</rocketmq.version>
+        <rocketmq.version>4.5.2</rocketmq.version>
         <auth.version>${project.version}</auth.version>
         <spring.version>4.1.2.RELEASE</spring.version>
         <diamond.version>3.7.4</diamond.version>
@@ -218,11 +217,6 @@
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
-                <artifactId>ons-api</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>${project.groupId}</groupId>
                 <artifactId>ons-client</artifactId>
                 <version>${project.version}</version>
             </dependency>
diff --git a/ons-sample/pom.xml b/ons-sample/pom.xml
index 710b0af..7846256 100644
--- a/ons-sample/pom.xml
+++ b/ons-sample/pom.xml
@@ -30,13 +30,13 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.rocketmq</groupId>
-            <artifactId>ons-api</artifactId>
-            <version>1.0.1-SNAPSHOT</version>
+            <artifactId>ons-client</artifactId>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.rocketmq</groupId>
-            <artifactId>ons-client</artifactId>
-            <version>1.0.1-SNAPSHOT</version>
+            <groupId>io.openmessaging</groupId>
+            <artifactId>openmessaging-api</artifactId>
+            <version>1.1.0-SNAPSHOT</version>
         </dependency>
     </dependencies>
 
diff --git a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/MessageListenerImpl.java b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/MessageListenerImpl.java
index 1205ce9..90c3f4b 100644
--- a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/MessageListenerImpl.java
+++ b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/MessageListenerImpl.java
@@ -16,10 +16,10 @@
  */
 package org.apache.rocketmq.ons.sample.consumer;
 
-import org.apache.rocketmq.ons.api.Action;
-import org.apache.rocketmq.ons.api.ConsumeContext;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.MessageListener;
+import io.openmessaging.Action;
+import io.openmessaging.ConsumeContext;
+import io.openmessaging.Message;
+import io.openmessaging.MessageListener;
 
 public class MessageListenerImpl implements MessageListener {
     @Override
diff --git a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/SimpleMQConsumer.java b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/SimpleMQConsumer.java
index df95829..513a67b 100644
--- a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/SimpleMQConsumer.java
+++ b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/SimpleMQConsumer.java
@@ -16,22 +16,24 @@
  */
 package org.apache.rocketmq.ons.sample.consumer;
 
-
+import io.openmessaging.Consumer;
+import io.openmessaging.MessagingAccessPoint;
+import io.openmessaging.OMS;
 import java.util.Properties;
-import org.apache.rocketmq.ons.api.Consumer;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.sample.MQConfig;
 
 public class SimpleMQConsumer {
 
     public static void main(String[] args) {
+        MessagingAccessPoint messagingAccessPoint = OMS.getMessagingAccessPoint("oms:rocketmq://alice@rocketmq.apache.org/us-east");
+
         Properties consumerProperties = new Properties();
         consumerProperties.setProperty(PropertyKeyConst.GROUP_ID, MQConfig.GROUP_ID);
         consumerProperties.setProperty(PropertyKeyConst.AccessKey, MQConfig.ACCESS_KEY);
         consumerProperties.setProperty(PropertyKeyConst.SecretKey, MQConfig.SECRET_KEY);
         consumerProperties.setProperty(PropertyKeyConst.NAMESRV_ADDR, MQConfig.NAMESRV_ADDR);
-        Consumer consumer = ONSFactory.createConsumer(consumerProperties);
+        Consumer consumer = messagingAccessPoint.createConsumer(consumerProperties);
         consumer.subscribe(MQConfig.TOPIC, MQConfig.TAG, new MessageListenerImpl());
         consumer.start();
         System.out.printf("Consumer start success. %n");
diff --git a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/SimpleOrderConsumer.java b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/SimpleOrderConsumer.java
index b51a6a0..35a9458 100644
--- a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/SimpleOrderConsumer.java
+++ b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/consumer/SimpleOrderConsumer.java
@@ -16,25 +16,27 @@
  */
 package org.apache.rocketmq.ons.sample.consumer;
 
+import io.openmessaging.Message;
+import io.openmessaging.MessagingAccessPoint;
+import io.openmessaging.OMS;
+import io.openmessaging.order.ConsumeOrderContext;
+import io.openmessaging.order.MessageOrderListener;
+import io.openmessaging.order.OrderAction;
+import io.openmessaging.order.OrderConsumer;
 import java.util.Properties;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.order.ConsumeOrderContext;
-import org.apache.rocketmq.ons.api.order.MessageOrderListener;
-import org.apache.rocketmq.ons.api.order.OrderAction;
-import org.apache.rocketmq.ons.api.order.OrderConsumer;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.sample.MQConfig;
 
 public class SimpleOrderConsumer {
 
     public static void main(String[] args) {
+        MessagingAccessPoint messagingAccessPoint = OMS.getMessagingAccessPoint("oms:rocketmq://alice@rocketmq.apache.org/us-east");
         Properties consumerProperties = new Properties();
         consumerProperties.setProperty(PropertyKeyConst.GROUP_ID, MQConfig.ORDER_GROUP_ID);
         consumerProperties.setProperty(PropertyKeyConst.AccessKey, MQConfig.ACCESS_KEY);
         consumerProperties.setProperty(PropertyKeyConst.SecretKey, MQConfig.SECRET_KEY);
         consumerProperties.setProperty(PropertyKeyConst.NAMESRV_ADDR, MQConfig.NAMESRV_ADDR);
-        OrderConsumer consumer = ONSFactory.createOrderedConsumer(consumerProperties);
+        OrderConsumer consumer = messagingAccessPoint.createOrderedConsumer(consumerProperties);
         consumer.subscribe(MQConfig.ORDER_TOPIC, MQConfig.TAG, new MessageOrderListener() {
 
             @Override
diff --git a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/LocalTransactionCheckerImpl.java b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/LocalTransactionCheckerImpl.java
index f21db81..1d76cf6 100644
--- a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/LocalTransactionCheckerImpl.java
+++ b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/LocalTransactionCheckerImpl.java
@@ -16,9 +16,9 @@
  */
 package org.apache.rocketmq.ons.sample.producer;
 
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.transaction.LocalTransactionChecker;
-import org.apache.rocketmq.ons.api.transaction.TransactionStatus;
+import io.openmessaging.Message;
+import io.openmessaging.transaction.LocalTransactionChecker;
+import io.openmessaging.transaction.TransactionStatus;
 
 public class LocalTransactionCheckerImpl implements LocalTransactionChecker {
 
diff --git a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/MQTimerProducer.java b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/MQTimerProducer.java
index 26a6bf2..aa9f7f2 100644
--- a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/MQTimerProducer.java
+++ b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/MQTimerProducer.java
@@ -16,23 +16,26 @@
  */
 package org.apache.rocketmq.ons.sample.producer;
 
+import io.openmessaging.Message;
+import io.openmessaging.MessagingAccessPoint;
+import io.openmessaging.OMS;
+import io.openmessaging.Producer;
+import io.openmessaging.SendResult;
+import io.openmessaging.exception.OMSRuntimeException;
 import java.util.Properties;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.Producer;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.SendResult;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.sample.MQConfig;
 
 public class MQTimerProducer {
     public static void main(String[] args) {
+        MessagingAccessPoint messagingAccessPoint = OMS.getMessagingAccessPoint("oms:rocketmq://alice@rocketmq.apache.org/us-east");
+
         Properties producerProperties = new Properties();
         producerProperties.setProperty(PropertyKeyConst.GROUP_ID, MQConfig.GROUP_ID);
         producerProperties.setProperty(PropertyKeyConst.AccessKey, MQConfig.ACCESS_KEY);
         producerProperties.setProperty(PropertyKeyConst.SecretKey, MQConfig.SECRET_KEY);
         producerProperties.setProperty(PropertyKeyConst.NAMESRV_ADDR, MQConfig.NAMESRV_ADDR);
-        Producer producer = ONSFactory.createProducer(producerProperties);
+        Producer producer = messagingAccessPoint.createProducer(producerProperties);
         producer.start();
         System.out.printf("Producer Started. %n");
 
@@ -44,7 +47,7 @@ public class MQTimerProducer {
                 SendResult sendResult = producer.send(message);
                 assert sendResult != null;
                 System.out.printf("Send mq timer message success! Topic is: %s msgId is: %s%n", MQConfig.TOPIC, sendResult.getMessageId());
-            } catch (ONSClientException e) {
+            } catch (OMSRuntimeException e) {
                 System.out.printf("Send mq message failed. Topic is: %s%n", MQConfig.TOPIC);
                 e.printStackTrace();
             }
diff --git a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleMQProducer.java b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleMQProducer.java
index e3cb192..8d25ef4 100644
--- a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleMQProducer.java
+++ b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleMQProducer.java
@@ -16,25 +16,28 @@
  */
 package org.apache.rocketmq.ons.sample.producer;
 
+import io.openmessaging.Message;
+import io.openmessaging.MessagingAccessPoint;
+import io.openmessaging.OMS;
+import io.openmessaging.Producer;
+import io.openmessaging.SendResult;
+import io.openmessaging.exception.OMSRuntimeException;
 import java.util.Properties;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.Producer;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.SendResult;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.sample.MQConfig;
 
 public class SimpleMQProducer {
 
 
     public static void main(String[] args) {
+        MessagingAccessPoint messagingAccessPoint = OMS.getMessagingAccessPoint("oms:rocketmq://alice@rocketmq.apache.org/us-east");
+
         Properties producerProperties = new Properties();
         producerProperties.setProperty(PropertyKeyConst.GROUP_ID, MQConfig.GROUP_ID);
         producerProperties.setProperty(PropertyKeyConst.AccessKey, MQConfig.ACCESS_KEY);
         producerProperties.setProperty(PropertyKeyConst.SecretKey, MQConfig.SECRET_KEY);
         producerProperties.setProperty(PropertyKeyConst.NAMESRV_ADDR, MQConfig.NAMESRV_ADDR);
-        Producer producer = ONSFactory.createProducer(producerProperties);
+        Producer producer = messagingAccessPoint.createProducer(producerProperties);
         producer.start();
         System.out.printf("Producer Started %n");
 
@@ -44,7 +47,7 @@ public class SimpleMQProducer {
                 SendResult sendResult = producer.send(message);
                 assert sendResult != null;
                 System.out.printf("Send mq timer message success! Topic is: %s msgId is: %s%n", MQConfig.TOPIC, sendResult.getMessageId());
-            } catch (ONSClientException e) {
+            } catch (OMSRuntimeException e) {
                 System.out.printf("Send mq message failed. Topic is: %s%n", MQConfig.TOPIC);
                 e.printStackTrace();
             }
diff --git a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleOrderProducer.java b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleOrderProducer.java
index 43ab7f0..82282aa 100644
--- a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleOrderProducer.java
+++ b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleOrderProducer.java
@@ -16,24 +16,27 @@
  */
 package org.apache.rocketmq.ons.sample.producer;
 
+import io.openmessaging.Message;
+import io.openmessaging.MessagingAccessPoint;
+import io.openmessaging.OMS;
+import io.openmessaging.SendResult;
+import io.openmessaging.exception.OMSRuntimeException;
+import io.openmessaging.order.OrderProducer;
 import java.util.Properties;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.SendResult;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-import org.apache.rocketmq.ons.api.order.OrderProducer;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.sample.MQConfig;
 
 public class SimpleOrderProducer {
 
     public static void main(String[] args) {
+        MessagingAccessPoint messagingAccessPoint = OMS.getMessagingAccessPoint("oms:rocketmq://alice@rocketmq.apache.org/us-east");
+
         Properties producerProperties = new Properties();
         producerProperties.setProperty(PropertyKeyConst.GROUP_ID, MQConfig.ORDER_GROUP_ID);
         producerProperties.setProperty(PropertyKeyConst.AccessKey, MQConfig.ACCESS_KEY);
         producerProperties.setProperty(PropertyKeyConst.SecretKey, MQConfig.SECRET_KEY);
         producerProperties.setProperty(PropertyKeyConst.NAMESRV_ADDR, MQConfig.NAMESRV_ADDR);
-        OrderProducer producer = ONSFactory.createOrderProducer(producerProperties);
+        OrderProducer producer = messagingAccessPoint.createOrderProducer(producerProperties);
         producer.start();
         System.out.printf("Producer Started. %n");
 
@@ -46,7 +49,7 @@ public class SimpleOrderProducer {
                 SendResult sendResult = producer.send(msg, shardingKey);
                 assert sendResult != null;
                 System.out.printf("Send mq timer message success! Topic is: %s msgId is: %s%n", MQConfig.TOPIC, sendResult.getMessageId());
-            } catch (ONSClientException e) {
+            } catch (OMSRuntimeException e) {
                 System.out.printf("Send mq message failed. Topic is: %s%n", MQConfig.TOPIC);
                 e.printStackTrace();
             }
diff --git a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleTransactionProducer.java b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleTransactionProducer.java
index 4d16d51..c8790b9 100644
--- a/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleTransactionProducer.java
+++ b/ons-sample/src/main/java/org/apache/rocketmq/ons/sample/producer/SimpleTransactionProducer.java
@@ -16,35 +16,38 @@
  */
 package org.apache.rocketmq.ons.sample.producer;
 
+import io.openmessaging.Message;
+import io.openmessaging.MessagingAccessPoint;
+import io.openmessaging.OMS;
+import io.openmessaging.SendResult;
+import io.openmessaging.exception.OMSRuntimeException;
+import io.openmessaging.transaction.LocalTransactionExecutor;
+import io.openmessaging.transaction.TransactionProducer;
+import io.openmessaging.transaction.TransactionStatus;
 import java.util.Date;
 import java.util.Properties;
-import org.apache.rocketmq.ons.api.Message;
-import org.apache.rocketmq.ons.api.ONSFactory;
-import org.apache.rocketmq.ons.api.PropertyKeyConst;
-import org.apache.rocketmq.ons.api.SendResult;
-import org.apache.rocketmq.ons.api.exception.ONSClientException;
-import org.apache.rocketmq.ons.api.transaction.LocalTransactionExecuter;
-import org.apache.rocketmq.ons.api.transaction.TransactionProducer;
-import org.apache.rocketmq.ons.api.transaction.TransactionStatus;
+import org.apache.rocketmq.ons.api.impl.constant.PropertyKeyConst;
 import org.apache.rocketmq.ons.sample.MQConfig;
 
 public class SimpleTransactionProducer {
 
     public static void main(String[] args) {
+        MessagingAccessPoint messagingAccessPoint = OMS.getMessagingAccessPoint("oms:rocketmq://alice@rocketmq.apache.org/us-east");
+
         Properties tranProducerProperties = new Properties();
         tranProducerProperties.setProperty(PropertyKeyConst.GROUP_ID, MQConfig.GROUP_ID);
         tranProducerProperties.setProperty(PropertyKeyConst.AccessKey, MQConfig.ACCESS_KEY);
         tranProducerProperties.setProperty(PropertyKeyConst.SecretKey, MQConfig.SECRET_KEY);
         tranProducerProperties.setProperty(PropertyKeyConst.NAMESRV_ADDR, MQConfig.NAMESRV_ADDR);
         LocalTransactionCheckerImpl localTransactionChecker = new LocalTransactionCheckerImpl();
-        TransactionProducer transactionProducer = ONSFactory.createTransactionProducer(tranProducerProperties, localTransactionChecker);
+        TransactionProducer transactionProducer = messagingAccessPoint.createTransactionProducer(tranProducerProperties, localTransactionChecker);
         transactionProducer.start();
 
         Message message = new Message(MQConfig.TOPIC, MQConfig.TAG, "MQ send transaction message test".getBytes());
 
         for (int i = 0; i < 10; i++) {
             try {
-                SendResult sendResult = transactionProducer.send(message, new LocalTransactionExecuter() {
+                SendResult sendResult = transactionProducer.send(message, new LocalTransactionExecutor() {
                     @Override
                     public TransactionStatus execute(Message msg, Object arg) {
                         System.out.printf("Execute local transaction and return TransactionStatus. %n");
@@ -52,7 +55,7 @@ public class SimpleTransactionProducer {
                     }
                 }, null);
                 assert sendResult != null;
-            } catch (ONSClientException e) {
+            } catch (OMSRuntimeException e) {
                 System.out.printf(new Date() + " Send mq message failed! Topic is: %s%n", MQConfig.TOPIC);
                 e.printStackTrace();
             }


Mime
View raw message