Uploaded image for project: 'Apache RocketMQ'
  1. Apache RocketMQ
  2. ROCKETMQ-383

spring cloud stream binder form rocketmq

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.2.0, 4.3.0
    • None
    • rocketmq-externals
    • 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

      { String INPUT_CHANNEL = "input_channel"; String OUTPUT = "output_channel"; @Input(Barista.INPUT_CHANNEL) SubscribableChannel logInput(); @Output(Barista.OUTPUT) MessageChannel logOutPut(); }

      producer:
      private Barista source;
      source.logOutPut().send(MessageBuilder.withPayload(msg).build());

      consumer:
      @StreamListener(Barista.INPUT_CHANNEL)
      public void receiver(Message<Object> message)

      { Object obj = message.getPayload(); }

      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.

      Attachments

        Activity

          People

            zander dongeforever
            masen miao sen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 50h
                50h
                Remaining:
                Remaining Estimate - 50h
                50h
                Logged:
                Time Spent - Not Specified
                Not Specified