Skip to content

Commit

Permalink
RocketMQ demo代码
Browse files Browse the repository at this point in the history
  • Loading branch information
tangchen.tangchen committed Feb 15, 2020
1 parent a1ced7f commit d4627f5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
/**
* @author juede.tcever
*/
@EnableBinding({ Sink.class})
@EnableBinding({ Sink.class, InputChannel.class})
@SpringBootApplication
public class Application {

@StreamListener(value = Sink.INPUT)
@StreamListener(value = InputChannel.ORDER_INPUT)
public void receive(String receiveMsg) {
System.out.println("TopicTest2 receive: " + receiveMsg);
System.out.println("receive: " + receiveMsg);
}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.gupaoedu.book.rocketmq.consumer;

import org.springframework.cloud.stream.annotation.Input;
import org.springframework.messaging.SubscribableChannel;

/**
* @author juede.tcever
*/
public interface InputChannel {

String USER_INPUT = "userInput";

String ORDER_INPUT = "orderInput";

@Input(InputChannel.USER_INPUT)
SubscribableChannel userInput();

@Input(InputChannel.ORDER_INPUT)
SubscribableChannel orderInput();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.gupaoedu.book.rocketmq.consumer;

import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;

/**
* @author juede.tcever
*/
public interface OrderSource {

String OUTPUT = "orderOutput";

@Output(OrderSource.OUTPUT)
MessageChannel output();
}

This file was deleted.

0 comments on commit d4627f5

Please sign in to comment.