alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
27.95k stars 8.34k forks source link

No retry consumption, no matter whether you set up broker control or client control : rocketmq #256

Closed XCXCXCXCX closed 5 years ago

XCXCXCXCX commented 5 years ago

When used according to the content of the document, the test found that there is no automatic retry. Do I need to implement the retry part of the client on the client side? Or is it only for transactional messages, not automatically retrying?

@StreamListener("input") public void receiveTransactionalMsg(Message message) { RocketMQMessageHeaderAccessor headerAccessor = new RocketMQMessageHeaderAccessor(message); Acknowledgement acknowledgement = headerAccessor.getAcknowledgement(message);

//my logic if(success){ acknowledgement.setConsumeConcurrentlyStatus(ConsumeConcurrentlyStatus.RECONSUME_LATER); }else{ acknowledgement.setConsumeConcurrentlyStatus(ConsumeConcurrentlyStatus.CONSUME_SUCCESS); }

}

fangjian0423 commented 5 years ago

Hi @XCXCXCXCX .

The setting of ConsumeConcurrentlyStatus and ConsumeOrderlyStatus in Acknowledgement is all useful for normal and transactional messages.

It seems your code is right.

Did you configure the orderly of RocketMQConsumerProperties?

Default value is false and using MessageListenerConcurrently to consume messages.

fangjian0423 commented 5 years ago

@XCXCXCXCX Please make sure broker and Name Server are healthy. It works well in my local machine.

XCXCXCXCX commented 5 years ago

@fangjian0423 Thank you for your patience, is the problem of the configuration file, just sent the provider's configuration file, I removed the configuration of orderly=true in the consumer, the program works very well.

fangjian0423 commented 5 years ago

@XCXCXCXCX

RocketMQ Binder just release first version. It is a little simple and maybe exists some small bugs.

We will support more features in the future and integration with rocketmq-spring-boot.

Very pleasure to receive your issue.