package com.init.springCloud;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.Message;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ProviderController {
@Autowired
private SendMessageService sendMessageService;
@RequestMapping(value = "/send", method = RequestMethod.GET)
@ResponseBody
public String sendMessage(){
Message<byte[]> message = MessageBuilder.withPayload("Hello World".getBytes()).build();
sendMessageService.myOutput().send(message);
return "success";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
22.Spring Cloud整合RabbitMQ或Kafka消息驱动.zip (38个子文件)
euraka-server
.project 771B
src
test
resources
java
main
resources
application.yml 216B
java
com
init
springCloud
ServerApp.java 443B
target
classes
com
init
springCloud
ServerApp.class 900B
application.yml 216B
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 122B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 430B
pom.xml 1024B
.classpath 1KB
eureka-provider
.project 773B
src
test
resources
java
main
resources
application.yml 236B
java
com
init
springCloud
ProviderController.java 862B
ProviderApp.java 511B
SendMessageService.java 265B
target
classes
com
init
springCloud
ProviderApp.class 894B
ProviderController.class 2KB
SendMessageService.class 334B
application.yml 236B
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 122B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 430B
pom.xml 2KB
.classpath 1KB
eureka-consumer
.project 773B
src
test
resources
java
main
resources
application.yml 164B
java
com
init
springCloud
ConsumerController.java 818B
ConsumerApp.java 725B
ReceiveMessageService.java 267B
target
classes
com
init
springCloud
ConsumerApp.class 1KB
ConsumerController.class 1KB
ReceiveMessageService.class 338B
application.yml 164B
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 122B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 736B
pom.xml 1KB
.classpath 1KB
共 38 条
- 1
资源评论
- lzq2004a2019-02-12很不错,学习学习MrSpirit2019-02-13谢谢夸奖
MrSpirit
- 粉丝: 154
- 资源: 30
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功