Details
-
New Feature
-
Status: Open
-
Major
-
Resolution: Unresolved
-
4.2.0, 4.3.0
-
None
-
None
-
jdk 1.8
Description
Now rocketmq-externals have rocketmq-spring-boot-starter module to provide RocketMQTemplate class that use spring abstract interface base on rocketmq and Integrate with Springboot.
So , we can take out a module in rocketmq-externals to integrate with spring cloud stream , the module like spring cloud/spring-cloud-stream-binder-kafka , spring-cloud-stream-binder-rabbit module. Use Spring cloud stream abstract to realize rocketmq binder module. Then, this new binder can use spring cloud stream annotation to use rocketmq. As follows:
Unified definition channel abstract for topic config:
public interface Barista
producer:
private Barista source;
source.logOutPut().send(MessageBuilder.withPayload(msg).build());
consumer:
@StreamListener(Barista.INPUT_CHANNEL)
public void receiver(Message<Object> message)
In the end, it needs to be add config "spring application.yml" for stream bindings information ,producer: like:
cloud:
stream:
bindings:
output:
destination: xxx
output_channel:
destination: xxx
consumer like : "input" config.