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 2020/04/21 04:33:21 UTC
[GitHub] [rocketmq-spring] gagado opened a new issue #253: @RocketMQTransactionListener can definition multiple implement class?
gagado opened a new issue #253:
URL: https://github.com/apache/rocketmq-spring/issues/253
In my project, have multiple transaction message.
so, i definition multiple RocketMQLocalTransactionListener implement class;
one:
@Component
@RocketMQTransactionListener
public class OneMesssageListener implements RocketMQLocalTransactionListener {
@Override
public RocketMQLocalTransactionState executeLocalTransaction(Message msg, Object arg) {
}
}
two:
@Component
@RocketMQTransactionListener
public class TwoMesssageListener implements RocketMQLocalTransactionListener {
@Override
public RocketMQLocalTransactionState executeLocalTransaction(Message msg, Object arg) {
}
}
but,have a error:
rocketMQTemplate already exists RocketMQLocalTransactionListener;
i want know, if In one project, i have multiple transaction message.
What should i do?
thanks...
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [rocketmq-spring] diwayou commented on issue #253: @RocketMQTransactionListener can definition multiple implement class?
Posted by GitBox <gi...@apache.org>.
diwayou commented on issue #253:
URL: https://github.com/apache/rocketmq-spring/issues/253#issuecomment-645267056
same problem, this is caused by rocketmq new client, merge local transaction execute and check listener, but it make code too difficult, i like the old callback way, how to solve this problem, i think you can route the message by type/key or else in the RocketMQLocalTransactionListener implementation, any one have a better solution?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [rocketmq-spring] gagado commented on issue #253: @RocketMQTransactionListener can definition multiple implement class?
Posted by GitBox <gi...@apache.org>.
gagado commented on issue #253:
URL: https://github.com/apache/rocketmq-spring/issues/253#issuecomment-616975007
@RongtongJin Thanks your answer, But in my project, only one RocketMQTemplate is defined and only one data source is used. ExtRocketMQTemplate should represent the situation of multiple data sources. When I use multiple rocketmq clusters in a project, it is my understanding. is it wrong? Thank you.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [rocketmq-spring] RongtongJin commented on issue #253: @RocketMQTransactionListener can definition multiple implement class?
Posted by GitBox <gi...@apache.org>.
RongtongJin commented on issue #253:
URL: https://github.com/apache/rocketmq-spring/issues/253#issuecomment-616969667
You can use ExtRocketMQTemplate and specify the bean name in RocketMQTransactionListener annotation.
You can refer to
https://github.com/apache/rocketmq-spring/blob/1464698a8b03d5700d41efe9258c33acf14b8e81/rocketmq-spring-boot-samples/rocketmq-produce-demo/src/main/java/org/apache/rocketmq/samples/springboot/ProducerApplication.java#L277-L291
----------------------------------------------------------------
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:
users@infra.apache.org