You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/12/29 07:35:28 UTC

[GitHub] [rocketmq-spring] ahaha-vip opened a new issue #414: Some questions about RocketMQLocalTransactionListener.

ahaha-vip opened a new issue #414:
URL: https://github.com/apache/rocketmq-spring/issues/414


   **FEATURE REQUEST**
   
   1. Please describe the feature you are requesting.
   
   The question is deserialization of `Message` in `RocketMQLocalTransactionListener#executeLocalTransaction` and `RocketMQLocalTransactionListener#checkLocalTransaction`, I want to get the same data structure as I set, but not so, we have to resolve it ourselves. I think `RocketMQUtil#convertToSpringMessage(org.apache.rocketmq.common.message.Message)`should do this, not the user. This logic already exists `org.apache.rocketmq.spring.support.DefaultRocketMQListenerContainer#doConvertMessage`.
   
   ```
       public void testSendMessageInTransaction() {
           String destination = "test-topic:test-tag";
           List<String> payload = CollUtil.newArrayList("1", "2");
           Message<List<String>> message = MessageBuilder.withPayload(payload).build();
           rocketMQTemplate.sendMessageInTransaction(destination, message, payload);
       }
   
       public void testRocketMqLocalTransactionListener() {
           new RocketMQLocalTransactionListener() {
   
               @Override
               public RocketMQLocalTransactionState executeLocalTransaction(Message msg, Object arg) {
                   // Custom parameters.
                   // No problem at this step.
                   @SuppressWarnings("unchecked")
                   List<String> customParams = (List<String>) arg;
   
                   // Message payload.
                   //The problem is at this step, I want to get the same data structure as I set, but not so, we have to resolve it ourselves.
                   @SuppressWarnings("unchecked")
                   List<String> payload = (List<String>)msg.getPayload();
   
                   // Execute something.
                   return null;
               }
   
               @Override
               public RocketMQLocalTransactionState checkLocalTransaction(Message msg) {
                   // Check something.
                   return null;
               }
           };
       }
   ```
   
   2. Provide any additional detail on your proposed use case for this feature.
   
   3. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?
   


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

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq-spring] ahaha-vip closed issue #414: Some questions about RocketMQLocalTransactionListener.

Posted by GitBox <gi...@apache.org>.
ahaha-vip closed issue #414:
URL: https://github.com/apache/rocketmq-spring/issues/414


   


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

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org