odbozhou commented on a change in pull request #1240: [ISSUE #1199] Implement 
the 1.0.0 openmessaging new consumer API for rocketmq oms module
URL: https://github.com/apache/rocketmq/pull/1240#discussion_r293641062
 
 

 ##########
 File path: 
example/src/main/java/org/apache/rocketmq/example/openmessaging/SimplePushConsumer.java
 ##########
 @@ -16,41 +16,44 @@
  */
 package org.apache.rocketmq.example.openmessaging;
 
-import io.openmessaging.Message;
 import io.openmessaging.MessagingAccessPoint;
 import io.openmessaging.OMS;
-import io.openmessaging.OMSBuiltinKeys;
 import io.openmessaging.consumer.MessageListener;
 import io.openmessaging.consumer.PushConsumer;
+import io.openmessaging.message.Message;
+import io.openmessaging.rocketmq.domain.NonStandardKeys;
+import java.util.HashSet;
+import java.util.Set;
 
 public class SimplePushConsumer {
     public static void main(String[] args) {
         final MessagingAccessPoint messagingAccessPoint = OMS
             
.getMessagingAccessPoint("oms:rocketmq://localhost:9876/default:default");
 
         final PushConsumer consumer = messagingAccessPoint.
-            
createPushConsumer(OMS.newKeyValue().put(OMSBuiltinKeys.CONSUMER_ID, 
"OMS_CONSUMER"));
-
-        messagingAccessPoint.startup();
-        System.out.printf("MessagingAccessPoint startup OK%n");
+            
createPushConsumer(OMS.newKeyValue().put(NonStandardKeys.CONSUMER_ID, 
"OMS_CONSUMER"));
 
         Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
             @Override
             public void run() {
-                consumer.shutdown();
-                messagingAccessPoint.shutdown();
+                consumer.stop();
 
 Review comment:
   There are startup and shutdown methods in oms-java-0.3.1 alpha 
MessagingAccessPoint, but there is no content in old rocketmq-open messaging 
implementation. In openmessaging-java-1.0.0, the MessagingAccessPoint lifecycle 
API has been removed, not in the new rocketmq-openmessaging implementation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to