forked from 2227324689/Spring-Cloud-Alibaba-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
26 changed files
with
103 additions
and
1,946 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>spring-cloud-rocketmq</artifactId> | ||
<groupId>com.gupaoedu.book.rocketmq</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>stream-rocketmq-binder</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
|
||
<!--<dependency>--> | ||
<!--<groupId>com.alibaba.cloud</groupId>--> | ||
<!--<artifactId>spring-cloud-starter-stream-rocketmq</artifactId>--> | ||
<!--</dependency>--> | ||
|
||
<dependency> | ||
<groupId>com.alibaba.cloud</groupId> | ||
<artifactId>spring-cloud-stream-binder-rocketmq</artifactId> | ||
</dependency> | ||
|
||
</dependencies> | ||
</project> |
19 changes: 19 additions & 0 deletions
19
...q/stream-rocketmq-binder/src/main/java/com/gupaoedu/book/stream/rocketmq/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.gupaoedu.book.stream.rocketmq; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.stream.annotation.EnableBinding; | ||
import org.springframework.cloud.stream.messaging.Sink; | ||
import org.springframework.cloud.stream.messaging.Source; | ||
|
||
/** | ||
* @author juede.tcever | ||
*/ | ||
@SpringBootApplication | ||
@EnableBinding({ Source.class, Sink.class }) | ||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...etmq-binder/src/main/java/com/gupaoedu/book/stream/rocketmq/stream/ProduceController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.gupaoedu.book.stream.rocketmq.stream; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.cloud.stream.messaging.Source; | ||
import org.springframework.messaging.Message; | ||
import org.springframework.messaging.support.MessageBuilder; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.annotation.PostConstruct; | ||
|
||
/** | ||
* @author juede.tcever | ||
*/ | ||
//@RestController | ||
|
||
@Component | ||
public class ProduceController { | ||
// | ||
// @Autowired | ||
// private StreamClient source; | ||
|
||
@Autowired | ||
private Source source; | ||
|
||
// @StreamListener("input1") | ||
// public void test(String message){ | ||
// System.out.println(message); | ||
// } | ||
|
||
@PostConstruct | ||
private void init() throws InterruptedException { | ||
MessageBuilder builder = MessageBuilder.withPayload("init..."); | ||
Message message = builder.build(); | ||
source.output().send(message); | ||
System.out.println("init..."); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
spring-cloud-rocketmq/stream-rocketmq-binder/src/main/resources/application.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
spring: | ||
cloud: | ||
stream: | ||
rocketmq: | ||
binder: | ||
name-server: 127.0.0.1:9876 | ||
bindings: | ||
output: | ||
destination: TopicTest | ||
group: PRODUCER_GROUP_TOPIC_TEST | ||
server: | ||
port: 8081 |