haoforliu commented on issue #403: ACL feature request
URL: https://github.com/apache/rocketmq/issues/403#issuecomment-472677500
 
 
   @duhengforever 
   我的写法就是参照AclClient demo的,而且我刚刚修改demo里的参数,运行还是报同样的错啊。
   以下是代码:
   public static void producer() throws MQClientException {
           DefaultMQProducer producer = new 
DefaultMQProducer("ProducerGroupName", getAclRPCHook());
           producer.setNamesrvAddr(ADDR);
           producer.start();
   
           for (int i = 0; i < 128; i++)
               try {
                   {
                       Message msg = new Message("TopicTest",
                           "TagA",
                           "OrderID188",
                           "Hello 
world".getBytes(RemotingHelper.DEFAULT_CHARSET));
                       SendResult sendResult = producer.send(msg);
                       System.out.printf("%s%n", sendResult);
                   }
   
               } catch (Exception e) {
                   e.printStackTrace();
               }
   
           producer.shutdown();
   }
   
   static RPCHook getAclRPCHook() {
           return new AclClientRPCHook(new 
SessionCredentials(ACL_ACCESS_KEY,ACL_SECRET_KEY));
       }
   

----------------------------------------------------------------
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