[jira] [Commented] (ROCKETMQ-138) Add AuthenticationException class to remove hard coded Aliyun authentication class

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16112133#comment-16112133
 ] 

ASF GitHub Bot commented on ROCKETMQ-138:
-

Github user lyy4j commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/138
  
I have look at the class which has a good abstract of Consistent Hash ,but 
I think the class SelectMessageQueueByConsistentHash  is more simple and have 
the unified style with the original code


> Add AuthenticationException class to remove hard coded Aliyun authentication 
> class
> --
>
> Key: ROCKETMQ-138
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-138
> Project: Apache RocketMQ
>  Issue Type: Improvement
>  Components: rocketmq-remoting
>Reporter: Jaskey Lam
>Assignee: Jaskey Lam
>Priority: Minor
> Fix For: 4.1.0-incubating
>
>
> in NettyRemotingAbstract.java
> a hard coded aliyun class is used 
> {code}
> catch (Throwable e) {
> if 
> (!"com.aliyun.openservices.ons.api.impl.authority.exception.AuthenticationException"
> .equals(e.getClass().getCanonicalName())) {
> PLOG.error("process request exception", e);
> PLOG.error(cmd.toString());
> }
> {code}
> A common AuthenticationException should be added to identify Authentication 
> failure.  Developers can throw this exception so that remoting component can 
> ignore it



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (ROCKETMQ-251) add an implemets of MessageQueueSelector with consistent hash

2017-08-02 Thread laiyiyu (JIRA)

 [ 
https://issues.apache.org/jira/browse/ROCKETMQ-251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

laiyiyu updated ROCKETMQ-251:
-
External issue URL: https://github.com/apache/incubator-rocketmq/pull/138

> add an implemets of MessageQueueSelector   with consistent hash
> ---
>
> Key: ROCKETMQ-251
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-251
> Project: Apache RocketMQ
>  Issue Type: New Feature
>  Components: rocketmq-client
>Affects Versions: 4.1.0-incubating
> Environment: jdk 1.6-1.8
>Reporter: laiyiyu
>Assignee: Xiaorui Wang
>  Labels: features
> Fix For: 4.1.0-incubating
>
>
> wanting to send a message with the same key combine with orderly consumer, 
> user can use the implements of the MessageQueueSelector, which has one 
> optimization compared with SelectMessageQueueByHash when a broker crash , it 
> can reduce the message Arriving out of the order



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ROCKETMQ-242) mqclient can not fetch nameSrvAddr periodly

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16112088#comment-16112088
 ] 

ASF GitHub Bot commented on ROCKETMQ-242:
-

Github user Jaskey commented on a diff in the pull request:

https://github.com/apache/incubator-rocketmq/pull/139#discussion_r131043088
  
--- Diff: 
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
 ---
@@ -255,19 +255,17 @@ public void start() throws MQClientException {
 }
 
 private void startScheduledTask() {
-if (null == this.clientConfig.getNamesrvAddr()) {
--- End diff --

@shroman  

Whether It has a  problem or not which depends on how user understand its 
purpose. In my point of view, my understanding would be:  user specified is 
always prior to dymatically fetched, which means if I specify, JUST DO NOT 
change it anymore since I have totolly understand the which nameserver I am 
using, I don't want to risk of changing my nameservers without my notice.

Sure, somebody's understanding would be: user specified is prior to 
dymatically fetch, however, this only happens when my specified nameserver 
address is available. 

I would say it is also reasonable. Maybe we can provide a policy for them 
to choose.


> mqclient can not fetch nameSrvAddr periodly
> ---
>
> Key: ROCKETMQ-242
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-242
> Project: Apache RocketMQ
>  Issue Type: Bug
>  Components: rocketmq-client
>Affects Versions: 4.0.0-incubating, 4.1.0-incubating
> Environment: test and production
>Reporter: Eason Chen
>Assignee: Xiaorui Wang
> Fix For: 4.2.0-incubating
>
>
> when mqclientinstance start, it getNameSrvAddr once by bellow code:
>  if (null == this.clientConfig.getNamesrvAddr()) {
> 
> this.clientConfig.setNamesrvAddr(this.mQClientAPIImpl.fetchNameServerAddr());
> }
> but in startScheduledTask(),it will not start the schedule task if 
> namesrvAddr is not null
> code=
> {code:java}
> public void start() throws MQClientException {
> synchronized (this) {
> switch (this.serviceState) {
> case CREATE_JUST:
> this.serviceState = ServiceState.START_FAILED;
> // If not specified,looking address from name server
>*{color:red} if (null == 
> this.clientConfig.getNamesrvAddr()) {
> 
> this.clientConfig.setNamesrvAddr(this.mQClientAPIImpl.fetchNameServerAddr());
> }{color}*
> // Start request-response channel
> this.mQClientAPIImpl.start();
> // Start various schedule tasks
> this.startScheduledTask();
> // Start pull service
> this.pullMessageService.start();
> // Start rebalance service
> this.rebalanceService.start();
> // Start push service
> 
> this.defaultMQProducer.getDefaultMQProducerImpl().start(false);
> log.info("the client factory [{}] start OK", 
> this.clientId);
> this.serviceState = ServiceState.RUNNING;
> break;
> case RUNNING:
> break;
> case SHUTDOWN_ALREADY:
> break;
> case START_FAILED:
> throw new MQClientException("The Factory object[" + 
> this.getClientId() + "] has been created before, and failed.", null);
> default:
> break;
> }
> }
> }
> private void startScheduledTask() {
>   *{color:red} if (null == this.clientConfig.getNamesrvAddr()) {{color}*
> this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
> @Override
> public void run() {
> try {
> 
> MQClientInstance.this.mQClientAPIImpl.fetchNameServerAddr();
> } catch (Exception e) {
> log.error("ScheduledTask fetchNameServerAddr 
> exception", e);
> }
> }
> }, 1000 * 10, 1000 * 60 * 2, TimeUnit.MILLISECONDS);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ROCKETMQ-249) Attempt to clear disk even if disk store path is found

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16111995#comment-16111995
 ] 

ASF GitHub Bot commented on ROCKETMQ-249:
-

Github user shroman commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/133
  
@vongosling @zhouxinyu @lizhanhui @vsair Anyone's willing to review the PR?


> Attempt to clear disk even if disk store path is found
> --
>
> Key: ROCKETMQ-249
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-249
> Project: Apache RocketMQ
>  Issue Type: Bug
>Reporter: Roman Shtykh
>Assignee: Roman Shtykh
>
> If disk usage estimates fail because the disk store path is not found 
> (doesn't exist), message store falsely decides the disk is full and tries to 
> delete.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ROCKETMQ-242) mqclient can not fetch nameSrvAddr periodly

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16111978#comment-16111978
 ] 

ASF GitHub Bot commented on ROCKETMQ-242:
-

Github user shroman commented on a diff in the pull request:

https://github.com/apache/incubator-rocketmq/pull/139#discussion_r131030593
  
--- Diff: 
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
 ---
@@ -255,19 +255,17 @@ public void start() throws MQClientException {
 }
 
 private void startScheduledTask() {
-if (null == this.clientConfig.getNamesrvAddr()) {
--- End diff --

@qqeasonchen If you agree with @Jaskey, then the current implementation is 
correct, isn't it? :)


> mqclient can not fetch nameSrvAddr periodly
> ---
>
> Key: ROCKETMQ-242
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-242
> Project: Apache RocketMQ
>  Issue Type: Bug
>  Components: rocketmq-client
>Affects Versions: 4.0.0-incubating, 4.1.0-incubating
> Environment: test and production
>Reporter: Eason Chen
>Assignee: Xiaorui Wang
> Fix For: 4.2.0-incubating
>
>
> when mqclientinstance start, it getNameSrvAddr once by bellow code:
>  if (null == this.clientConfig.getNamesrvAddr()) {
> 
> this.clientConfig.setNamesrvAddr(this.mQClientAPIImpl.fetchNameServerAddr());
> }
> but in startScheduledTask(),it will not start the schedule task if 
> namesrvAddr is not null
> code=
> {code:java}
> public void start() throws MQClientException {
> synchronized (this) {
> switch (this.serviceState) {
> case CREATE_JUST:
> this.serviceState = ServiceState.START_FAILED;
> // If not specified,looking address from name server
>*{color:red} if (null == 
> this.clientConfig.getNamesrvAddr()) {
> 
> this.clientConfig.setNamesrvAddr(this.mQClientAPIImpl.fetchNameServerAddr());
> }{color}*
> // Start request-response channel
> this.mQClientAPIImpl.start();
> // Start various schedule tasks
> this.startScheduledTask();
> // Start pull service
> this.pullMessageService.start();
> // Start rebalance service
> this.rebalanceService.start();
> // Start push service
> 
> this.defaultMQProducer.getDefaultMQProducerImpl().start(false);
> log.info("the client factory [{}] start OK", 
> this.clientId);
> this.serviceState = ServiceState.RUNNING;
> break;
> case RUNNING:
> break;
> case SHUTDOWN_ALREADY:
> break;
> case START_FAILED:
> throw new MQClientException("The Factory object[" + 
> this.getClientId() + "] has been created before, and failed.", null);
> default:
> break;
> }
> }
> }
> private void startScheduledTask() {
>   *{color:red} if (null == this.clientConfig.getNamesrvAddr()) {{color}*
> this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
> @Override
> public void run() {
> try {
> 
> MQClientInstance.this.mQClientAPIImpl.fetchNameServerAddr();
> } catch (Exception e) {
> log.error("ScheduledTask fetchNameServerAddr 
> exception", e);
> }
> }
> }, 1000 * 10, 1000 * 60 * 2, TimeUnit.MILLISECONDS);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ROCKETMQ-242) mqclient can not fetch nameSrvAddr periodly

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16110832#comment-16110832
 ] 

ASF GitHub Bot commented on ROCKETMQ-242:
-

Github user qqeasonchen commented on a diff in the pull request:

https://github.com/apache/incubator-rocketmq/pull/139#discussion_r130866438
  
--- Diff: 
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
 ---
@@ -255,19 +255,17 @@ public void start() throws MQClientException {
 }
 
 private void startScheduledTask() {
-if (null == this.clientConfig.getNamesrvAddr()) {
--- End diff --

@Jaskey agree with you , and my question is if user does not specify an 
namesrv and its purpose is fetch from wsAddr , but client can not fetch 
namesrvs dymatically , see 

// If not specified,looking address from name server 
if (null == this.clientConfig.getNamesrvAddr()) { 
this.mQClientAPIImpl.fetchNameServerAddr(); }
 
private void startScheduledTask() {
  if (null == this.clientConfig.getNamesrvAddr()) {...}


> mqclient can not fetch nameSrvAddr periodly
> ---
>
> Key: ROCKETMQ-242
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-242
> Project: Apache RocketMQ
>  Issue Type: Bug
>  Components: rocketmq-client
>Affects Versions: 4.0.0-incubating, 4.1.0-incubating
> Environment: test and production
>Reporter: Eason Chen
>Assignee: Xiaorui Wang
> Fix For: 4.2.0-incubating
>
>
> when mqclientinstance start, it getNameSrvAddr once by bellow code:
>  if (null == this.clientConfig.getNamesrvAddr()) {
> 
> this.clientConfig.setNamesrvAddr(this.mQClientAPIImpl.fetchNameServerAddr());
> }
> but in startScheduledTask(),it will not start the schedule task if 
> namesrvAddr is not null
> code=
> {code:java}
> public void start() throws MQClientException {
> synchronized (this) {
> switch (this.serviceState) {
> case CREATE_JUST:
> this.serviceState = ServiceState.START_FAILED;
> // If not specified,looking address from name server
>*{color:red} if (null == 
> this.clientConfig.getNamesrvAddr()) {
> 
> this.clientConfig.setNamesrvAddr(this.mQClientAPIImpl.fetchNameServerAddr());
> }{color}*
> // Start request-response channel
> this.mQClientAPIImpl.start();
> // Start various schedule tasks
> this.startScheduledTask();
> // Start pull service
> this.pullMessageService.start();
> // Start rebalance service
> this.rebalanceService.start();
> // Start push service
> 
> this.defaultMQProducer.getDefaultMQProducerImpl().start(false);
> log.info("the client factory [{}] start OK", 
> this.clientId);
> this.serviceState = ServiceState.RUNNING;
> break;
> case RUNNING:
> break;
> case SHUTDOWN_ALREADY:
> break;
> case START_FAILED:
> throw new MQClientException("The Factory object[" + 
> this.getClientId() + "] has been created before, and failed.", null);
> default:
> break;
> }
> }
> }
> private void startScheduledTask() {
>   *{color:red} if (null == this.clientConfig.getNamesrvAddr()) {{color}*
> this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
> @Override
> public void run() {
> try {
> 
> MQClientInstance.this.mQClientAPIImpl.fetchNameServerAddr();
> } catch (Exception e) {
> log.error("ScheduledTask fetchNameServerAddr 
> exception", e);
> }
> }
> }, 1000 * 10, 1000 * 60 * 2, TimeUnit.MILLISECONDS);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ROCKETMQ-242) mqclient can not fetch nameSrvAddr periodly

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16110468#comment-16110468
 ] 

ASF GitHub Bot commented on ROCKETMQ-242:
-

Github user qqeasonchen commented on a diff in the pull request:

https://github.com/apache/incubator-rocketmq/pull/139#discussion_r130805162
  
--- Diff: 
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
 ---
@@ -255,19 +255,17 @@ public void start() throws MQClientException {
 }
 
 private void startScheduledTask() {
-if (null == this.clientConfig.getNamesrvAddr()) {
--- End diff --

@shroman fetch name servers task must be running when client started so 
that client can update the failed namesrv by itself, we can  make some 
conditions to trigger it such as if wsAddr is not default


> mqclient can not fetch nameSrvAddr periodly
> ---
>
> Key: ROCKETMQ-242
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-242
> Project: Apache RocketMQ
>  Issue Type: Bug
>  Components: rocketmq-client
>Affects Versions: 4.0.0-incubating, 4.1.0-incubating
> Environment: test and production
>Reporter: Eason Chen
>Assignee: Xiaorui Wang
> Fix For: 4.2.0-incubating
>
>
> when mqclientinstance start, it getNameSrvAddr once by bellow code:
>  if (null == this.clientConfig.getNamesrvAddr()) {
> 
> this.clientConfig.setNamesrvAddr(this.mQClientAPIImpl.fetchNameServerAddr());
> }
> but in startScheduledTask(),it will not start the schedule task if 
> namesrvAddr is not null
> code=
> {code:java}
> public void start() throws MQClientException {
> synchronized (this) {
> switch (this.serviceState) {
> case CREATE_JUST:
> this.serviceState = ServiceState.START_FAILED;
> // If not specified,looking address from name server
>*{color:red} if (null == 
> this.clientConfig.getNamesrvAddr()) {
> 
> this.clientConfig.setNamesrvAddr(this.mQClientAPIImpl.fetchNameServerAddr());
> }{color}*
> // Start request-response channel
> this.mQClientAPIImpl.start();
> // Start various schedule tasks
> this.startScheduledTask();
> // Start pull service
> this.pullMessageService.start();
> // Start rebalance service
> this.rebalanceService.start();
> // Start push service
> 
> this.defaultMQProducer.getDefaultMQProducerImpl().start(false);
> log.info("the client factory [{}] start OK", 
> this.clientId);
> this.serviceState = ServiceState.RUNNING;
> break;
> case RUNNING:
> break;
> case SHUTDOWN_ALREADY:
> break;
> case START_FAILED:
> throw new MQClientException("The Factory object[" + 
> this.getClientId() + "] has been created before, and failed.", null);
> default:
> break;
> }
> }
> }
> private void startScheduledTask() {
>   *{color:red} if (null == this.clientConfig.getNamesrvAddr()) {{color}*
> this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
> @Override
> public void run() {
> try {
> 
> MQClientInstance.this.mQClientAPIImpl.fetchNameServerAddr();
> } catch (Exception e) {
> log.error("ScheduledTask fetchNameServerAddr 
> exception", e);
> }
> }
> }, 1000 * 10, 1000 * 60 * 2, TimeUnit.MILLISECONDS);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)