1、使用默认的AmqpTemplate生产消费pojo时,pojo需要implement Serializable,否则会抛出org.springframework.amqp.AmqpException: No method found for class [B。

2、当需要使用其他package或者其他module的@Component时,可以在SpringApplication类的注解加入@ComponentScan("com.xxxx.xxx");

3、spring boot主动执行的方法可以通过

@Component
public class SenderApp implements ApplicationRunner{
@Autowired
private Sender sender; @Override
public void run(ApplicationArguments args) throws Exception {
OrderEntrust orderEntrust = JSON.parseObject("{\n" +
" \"id\":1,\n" +
" \"orderdate\":20180706,\n" +
" \"fundid\":1,\n" +
" \"assetid\":4,\n" +
" \"combiid\":6,\n" +
" \"operatorno\":1,\n" +
" \"marketclassify\":\"上交所\",\n" +
" \"securityinternalcode\":\"601318\",\n" +
" \"buysell\":\"买\",\n" +
" \"openclose\":\"\",\n" +
" \"orderprop\":\"限价指令\",\n" +
" \"entrustprice\":56.94,\n" +
" \"entrustvolume\":200\n" +
"}".trim(), OrderEntrust.class);
sender.sendOrderEntrust(orderEntrust);
}

这种方式载入。

spring boot 集成 rabbitmq的更多相关文章

  1. Spring Boot 集成 RabbitMQ 实战

    Spring Boot 集成 RabbitMQ 实战 特别说明: 本文主要参考了程序员 DD 的博客文章<Spring Boot中使用RabbitMQ>,在此向原作者表示感谢. Mac 上 ...

  2. Spring boot集成RabbitMQ(山东数漫江湖)

    RabbitMQ简介 RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统 MQ全称为Message Queue, 消息队列(MQ)是一种应用程序对应用程序的通信方法.应用程序通过读写出 ...

  3. 85. Spring Boot集成RabbitMQ【从零开始学Spring Boot】

    这一节我们介绍下Spring Boot整合RabbitMQ,对于RabbitMQ这里不过多的介绍,大家可以参考网络上的资源进行安装配置,本节重点是告诉大家如何在Spring Boot中使用Rabbit ...

  4. RabbitMQ(3) Spring boot集成RabbitMQ

    springboot集成RabbitMQ非常简单,如果只是简单的使用配置非常少,springboot提供了spring-boot-starter-amqp项目对消息各种支持. 资源代码:练习用的代码. ...

  5. spring boot集成RabbitMQ

    原文:https://www.jianshu.com/p/e1258c004314 RabbitMQ作为AMQP的代表性产品,在项目中大量使用.结合现在主流的spring boot,极大简化了开发过程 ...

  6. Spring Boot 集成RabbitMQ

    在Spring Boot中整合RabbitMQ是非常容易的,通过在Spring Boot应用中整合RabbitMQ,实现一个简单的发送.接收消息的例子. 首先需要启动RabbitMQ服务,并且add一 ...

  7. spring boot 集成 rabbitmq 指南

    先决条件 rabbitmq server 安装参考 一个添加了 web 依赖的 spring boot 项目 我的版本是 2.5.2 添加 maven 依赖 <dependency> &l ...

  8. spring boot 集成RabbitMQ的异常

    com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.clos ...

  9. Spring boot集成Rabbit MQ使用初体验

    Spring boot集成Rabbit MQ使用初体验 1.rabbit mq基本特性 首先介绍一下rabbitMQ的几个特性 Asynchronous Messaging Supports mult ...

随机推荐

  1. js进阶---12-11、jquery如何给动态创建出来的元素绑定事件

    js进阶---12-11.jquery如何给动态创建出来的元素绑定事件 一.总结 一句话总结:通过事件委托的方式,通过on方法 1.on方法在事件绑定的时候,data方式带额外参数时,字符串参数和其它 ...

  2. MVC3;0问题与知识点

        1.    代码中@Html.BeginForm不对,应 @using(Html.BeginForm){}   2.   不设置 注解 required属性中的 errormessage,则错 ...

  3. 六 web爬虫讲解2—urllib库爬虫—基础使用—超时设置—自动模拟http请求

    利用python系统自带的urllib库写简单爬虫 urlopen()获取一个URL的html源码read()读出html源码内容decode("utf-8")将字节转化成字符串 ...

  4. 【scala】可变与不可变的理解

    我们定义变量的时候分为var可变变量和val不可变变量. 我们使用容器的时候也分为可变容器和不可变容器. List和Tuple本身就是不可变的,set和map分为可变和不可变的,默认为不可变. 我们看 ...

  5. 【第13届景驰-埃森哲杯广东工业大学ACM程序设计大赛-L】用来作弊的药水

    链接:https://www.nowcoder.com/acm/contest/90/L来源:牛客网 输入x,a,y,b,(1<=x,a,y,b<=10^9)判断x^a是否等于y^b 前面 ...

  6. hdu4619

    题解: 最大独立集问题 显然对于每一对交叉的建边 然后求出最大独立集 最大独立集=n-最大匹配 代码: #include<cstdio> #include<cmath> #in ...

  7. CSS:Tutorial two

    1.CSS Text text color, text align... Text Decoration The text-decoration property is used to set or ...

  8. H264提供了哪些帧内预测?

    H.264/AVC 提供了四种帧内预测方式:4x4 亮度块的帧内预测(Intra_4x4).16x16 亮度块的帧内预测(Intra_16x16).8x8 色度块的帧内预测(Intra_chroma) ...

  9. [转载] 视音频数据处理入门:RGB、YUV像素数据处理

    ===================================================== 视音频数据处理入门系列文章: 视音频数据处理入门:RGB.YUV像素数据处理 视音频数据处理 ...

  10. Jetty服务怎么配置,如何发布项目

    Jetty相对于Tomcat来时相对较轻,适合多并发且有较多实时通讯的系统,能够稳定的保持连接且占用资源相对较少.今天就简单介绍一下Jetty的配置及项目部署. 工具/原料 Jetty 电脑 Jett ...