[jira] [Commented] (ROCKETMQ-233) Apply pull interval when pull result contains no new matched msg

2017-07-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-233:
-

Github user coveralls commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/127
  

[![Coverage 
Status](https://coveralls.io/builds/12592396/badge)](https://coveralls.io/builds/12592396)

Coverage increased (+0.2%) to 38.906% when pulling 
**9b082648b80f489b70fda7e4472619fa1adbe81d on lizhanhui:ROCKETMQ-233** into 
**118bdec96005ce695295bcf0d9082e0230e69bf7 on apache:develop**.



> Apply pull interval when pull result contains no new matched msg
> 
>
> Key: ROCKETMQ-233
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-233
> Project: Apache RocketMQ
>  Issue Type: Bug
>Reporter: Zhanhui Li
>Assignee: Zhanhui Li
> Fix For: 4.2.0-incubating
>
>




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


[jira] [Commented] (ROCKETMQ-233) Apply pull interval when pull result contains no new matched msg

2017-07-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-233:
-

Github user coveralls commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/127
  

[![Coverage 
Status](https://coveralls.io/builds/12592396/badge)](https://coveralls.io/builds/12592396)

Coverage increased (+0.2%) to 38.906% when pulling 
**9b082648b80f489b70fda7e4472619fa1adbe81d on lizhanhui:ROCKETMQ-233** into 
**118bdec96005ce695295bcf0d9082e0230e69bf7 on apache:develop**.



> Apply pull interval when pull result contains no new matched msg
> 
>
> Key: ROCKETMQ-233
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-233
> Project: Apache RocketMQ
>  Issue Type: Bug
>Reporter: Zhanhui Li
>Assignee: Zhanhui Li
> Fix For: 4.2.0-incubating
>
>




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


[jira] [Commented] (ROCKETMQ-224) Client log4j2 logging

2017-07-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-224:
-

Github user coveralls commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/120
  

[![Coverage 
Status](https://coveralls.io/builds/12590707/badge)](https://coveralls.io/builds/12590707)

Coverage increased (+0.6%) to 39.21% when pulling 
**04e5a1e030c82e4c9175ed544a8d059eecbd6a72 on lindzh:fix_client_logger** into 
**0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> Client log4j2 logging
> -
>
> Key: ROCKETMQ-224
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-224
> Project: Apache RocketMQ
>  Issue Type: New Feature
>  Components: rocketmq-client
>Affects Versions: 4.1.0-incubating
> Environment: Jdk 1.7
>Reporter: lindzh
>Assignee: Xiaorui Wang
> Fix For: 4.2.0-incubating
>
>
> When using RocketMQ client,we can only using logback or log4j for logging. If 
> we using log4j2,there is no client log.



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


[jira] [Commented] (ROCKETMQ-224) Client log4j2 logging

2017-07-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-224:
-

Github user coveralls commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/120
  

[![Coverage 
Status](https://coveralls.io/builds/12590707/badge)](https://coveralls.io/builds/12590707)

Coverage increased (+0.6%) to 39.21% when pulling 
**04e5a1e030c82e4c9175ed544a8d059eecbd6a72 on lindzh:fix_client_logger** into 
**0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> Client log4j2 logging
> -
>
> Key: ROCKETMQ-224
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-224
> Project: Apache RocketMQ
>  Issue Type: New Feature
>  Components: rocketmq-client
>Affects Versions: 4.1.0-incubating
> Environment: Jdk 1.7
>Reporter: lindzh
>Assignee: Xiaorui Wang
> Fix For: 4.2.0-incubating
>
>
> When using RocketMQ client,we can only using logback or log4j for logging. If 
> we using log4j2,there is no client log.



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


[jira] [Commented] (ROCKETMQ-224) Client log4j2 logging

2017-07-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-224:
-

Github user coveralls commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/120
  

[![Coverage 
Status](https://coveralls.io/builds/12590707/badge)](https://coveralls.io/builds/12590707)

Coverage increased (+0.6%) to 39.21% when pulling 
**04e5a1e030c82e4c9175ed544a8d059eecbd6a72 on lindzh:fix_client_logger** into 
**0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> Client log4j2 logging
> -
>
> Key: ROCKETMQ-224
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-224
> Project: Apache RocketMQ
>  Issue Type: New Feature
>  Components: rocketmq-client
>Affects Versions: 4.1.0-incubating
> Environment: Jdk 1.7
>Reporter: lindzh
>Assignee: Xiaorui Wang
> Fix For: 4.2.0-incubating
>
>
> When using RocketMQ client,we can only using logback or log4j for logging. If 
> we using log4j2,there is no client log.



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


[jira] [Commented] (ROCKETMQ-233) Apply pull interval when pull result contains no new matched msg

2017-07-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-233:
-

Github user coveralls commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/127
  

[![Coverage 
Status](https://coveralls.io/builds/12590821/badge)](https://coveralls.io/builds/12590821)

Coverage increased (+0.005%) to 38.724% when pulling 
**d7ccb71c2e97c53d1406f847e8c95d6e25ad0513 on lizhanhui:ROCKETMQ-233** into 
**118bdec96005ce695295bcf0d9082e0230e69bf7 on apache:develop**.



> Apply pull interval when pull result contains no new matched msg
> 
>
> Key: ROCKETMQ-233
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-233
> Project: Apache RocketMQ
>  Issue Type: Bug
>Reporter: Zhanhui Li
>Assignee: Zhanhui Li
> Fix For: 4.2.0-incubating
>
>




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


[jira] [Commented] (ROCKETMQ-233) Apply pull interval when pull result contains no new matched msg

2017-07-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-233:
-

Github user coveralls commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/127
  

[![Coverage 
Status](https://coveralls.io/builds/12590821/badge)](https://coveralls.io/builds/12590821)

Coverage increased (+0.005%) to 38.724% when pulling 
**d7ccb71c2e97c53d1406f847e8c95d6e25ad0513 on lizhanhui:ROCKETMQ-233** into 
**118bdec96005ce695295bcf0d9082e0230e69bf7 on apache:develop**.



> Apply pull interval when pull result contains no new matched msg
> 
>
> Key: ROCKETMQ-233
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-233
> Project: Apache RocketMQ
>  Issue Type: Bug
>Reporter: Zhanhui Li
>Assignee: Zhanhui Li
> Fix For: 4.2.0-incubating
>
>




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


[jira] [Commented] (ROCKETMQ-28) Transportation Layer Security

2017-07-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-28:


Github user coveralls commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/118
  

[![Coverage 
Status](https://coveralls.io/builds/12590728/badge)](https://coveralls.io/builds/12590728)

Coverage increased (+0.5%) to 39.174% when pulling 
**0f98b9e7ab63a362aca9ecd4d652269983a017d1 on lizhanhui:tls** into 
**118bdec96005ce695295bcf0d9082e0230e69bf7 on apache:develop**.



> Transportation Layer Security
> -
>
> Key: ROCKETMQ-28
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-28
> Project: Apache RocketMQ
>  Issue Type: New Feature
>  Components: rocketmq-remoting
>Reporter: Zhanhui Li
>Assignee: Zhanhui Li
> Fix For: 4.2.0-incubating
>
>
> RocketMQ delivers data in clear text for now, which requires internal network 
> environment. As use scenarios expand, end-to-end security is in bad need. 
> This issue is to introduce features making RocketMQ security for various use 
> cases and sacrificing as few as possible.



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


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

2017-07-28 Thread laiyiyu (JIRA)
laiyiyu created ROCKETMQ-251:


 Summary: 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
 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-07-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-242:
-

Github user qqeasonchen commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/139
  
@Jaskey @shroman @zhouxinyu 
create a pull request again due to previous wrong commit ,pls help to 
review, thx.


> 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] [Updated] (ROCKETMQ-242) mqclient can not fetch nameSrvAddr periodly

2017-07-28 Thread Eason Chen (JIRA)

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

Eason Chen updated ROCKETMQ-242:

Description: 
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=

{panel:title=My title}
Some text with a title
{panel}


  was:
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}




> 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=
> {panel:title=My title}
> Some text with a title
> {panel}



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


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

2017-07-28 Thread Eason Chen (JIRA)

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

Eason Chen updated ROCKETMQ-242:

Description: 
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}



  was:
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=

{panel:title=My title}
Some text with a title
{panel}



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

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

2017-07-28 Thread Eason Chen (JIRA)

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

Eason Chen updated ROCKETMQ-242:

Description: 
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}



  was:


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() {

   

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

2017-07-28 Thread Eason Chen (JIRA)

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

Eason Chen updated ROCKETMQ-242:

Description: 


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}

  was:
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}
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() {


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

2017-07-28 Thread Eason Chen (JIRA)

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

Eason Chen updated ROCKETMQ-242:

Description: 
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}
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}

  was:
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=

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() {