当前位置: 首页 > news >正文

中文设计网站sem推广是什么

中文设计网站,sem推广是什么,中国知名公司,百度sem优化师Stream 简介 Spring Cloud Stream 是用于构建消息驱动的微服务应用程序的框架,提供了多种中间件的合理配置 Spring Cloud Stream 包含以下核心概念: Destination Binders:目标绑定器,目标指的是 Kafka 或者 RabbitMQ&#xff0…

Stream 简介

Spring Cloud Stream 是用于构建消息驱动的微服务应用程序的框架,提供了多种中间件的合理配置

Spring Cloud Stream 包含以下核心概念:

  • Destination Binders:目标绑定器,目标指的是 Kafka 或者 RabbitMQ,绑定器就是封装了目标中间件的包,如果操作的是 Kafka,就使用 Kafka Binder,如果操作的是 RabbitMQ,就使用 RabbitMO Binder
  • Bindings:外部消息传递系统和应用程序之间的桥梁,提供消息的“生产者”和“消费者”(由目标绑定器创建)
  • Message:一种规范化的数据结构,生产者和消费者基于这个数据结构通过外部消息系统与目标绑定器和其他应用程序通信

应用程序通过 inputs 或者 outpus 与 Spring Cloud Stream 的 Binder 交互,Binder 层负责和中间件的通信,通过配置来 binding。通过定义 Binder 作为中间层,实现了应用程序与消息中间件细节之间的隔离,应用程序不需要再考虑各种不同的消息中间件实现。当需要升级消息中间件或是更换其他消息中间件产品时,只需要更换对应的 Binder 绑定器

在这里插入图片描述


Stream 整合 kafka

以 Kafka 为例,确保安装 Kafka 并启动

分别创建生产者和消费者项目,分别添加依赖

<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-stream-kafka</artifactId>
</dependency>
1. 创建生产者

开发 MqSource 接口

public interface MqSource {@Output("test-topic")MessageChannel testTopic();@Output("test-topic-2")MessageChannel testTopic2();
}

通过 @Output@Input 注解定义消息输入和输出通道的名称定义,输出通道需要返回 MessageChannel 接口对象,它定义了向消息通道发送消息的方法。默认情况下,通道的名称就是注解的方法的名称,也能自己定义通道名称,只需要给 @Input@Output 注解传入 String 类型参数通道名称即可,这里指定两个通道分别为 test-topictest-topic-2

开发 MsgProducer 类

@Slf4j
@EnableBinding(MqSource.class)
public class MsgProducer {@Autowiredprivate MqSource mqSource;public void sendTestTopicMessage(String msg) {try {mqSource.testTopic().send(MessageBuilder.withPayload(msg).build());} catch (Exception e) {log.error("sendTestTopicMessage error", e);}}public void sendTestTopic2Message(String msg) {try {mqSource.testTopic2().send(MessageBuilder.withPayload(msg).build());} catch (Exception e) {log.error("sendTestTopic2Message error", e);}}
}

使用 @EnableBinding 创建和绑定通道,绑定通道是指将通道和 Binder 进行绑定,比如 Kafka、RabbiMQ 等。如果类路径下只有一种 Binder,那么 Spring Cloud Stream 会找到并绑定它,不需要进行配置。如果有多个就需要明确配置

调用 MqSource 接口方法获取输出通道对象,接着调用 send 方法发送数据。send 方法接收一个 Message 对象,这个对象不能直接新建,需要使用 MessageBuilder 获取

2. 创建消费者
public interface MqSink {@Input("test-topic")MessageChannel testTopic();@Input("test-topic-2")MessageChannel testTopic2();
}

与生产者的 MqSource 同理

开发 MsgReceiver 类,@StreamLisiener 接收的参数是要处理的通道名,所注解的方法就是处理从通道获取数据的方法,方法的参数就是获取到的数据

@Slf4j
@EnableBinding(MqSink.class)
public class MsgReceiver {@StreamListener("test-topic")public void testTopicMessageListen(String msg) {log.info("testTopicMessageListen: {}", msg);}@StreamListener("test-topic-2")public void testTopic2MessageListen(String msg) {log.info("testTopic2MessageListen: {}", msg);}
}


文章转载自:
http://dinncokendo.zfyr.cn
http://dinncocafe.zfyr.cn
http://dinncobold.zfyr.cn
http://dinncoithyphallic.zfyr.cn
http://dinncostruvite.zfyr.cn
http://dinncofop.zfyr.cn
http://dinncogamma.zfyr.cn
http://dinncosnottynose.zfyr.cn
http://dinncofoveate.zfyr.cn
http://dinncoarterialization.zfyr.cn
http://dinncosynonymist.zfyr.cn
http://dinncocno.zfyr.cn
http://dinncositrep.zfyr.cn
http://dinncosernyl.zfyr.cn
http://dinncotelemachus.zfyr.cn
http://dinncoridgeback.zfyr.cn
http://dinncodread.zfyr.cn
http://dinncoteliospore.zfyr.cn
http://dinncosemigloss.zfyr.cn
http://dinncofixture.zfyr.cn
http://dinncophilanthrope.zfyr.cn
http://dinncoconfetti.zfyr.cn
http://dinncocordiality.zfyr.cn
http://dinncobooklore.zfyr.cn
http://dinncothumbscrew.zfyr.cn
http://dinncointerleaver.zfyr.cn
http://dinncoendamage.zfyr.cn
http://dinncogheber.zfyr.cn
http://dinncooverdrifted.zfyr.cn
http://dinncoerythroblastic.zfyr.cn
http://dinncodrawgate.zfyr.cn
http://dinncofaultful.zfyr.cn
http://dinncocurator.zfyr.cn
http://dinncoethnobotany.zfyr.cn
http://dinncodiscredit.zfyr.cn
http://dinncoblackpoll.zfyr.cn
http://dinncoestonian.zfyr.cn
http://dinncoauditorium.zfyr.cn
http://dinncouninformed.zfyr.cn
http://dinncoithuriel.zfyr.cn
http://dinncospreadhead.zfyr.cn
http://dinncoatrament.zfyr.cn
http://dinncoopenmouthed.zfyr.cn
http://dinncodinner.zfyr.cn
http://dinncogladdest.zfyr.cn
http://dinncotelesport.zfyr.cn
http://dinncomarinate.zfyr.cn
http://dinncobibliotherapy.zfyr.cn
http://dinncosemisolid.zfyr.cn
http://dinncocran.zfyr.cn
http://dinncocardioversion.zfyr.cn
http://dinncosasin.zfyr.cn
http://dinncotelethermoscope.zfyr.cn
http://dinncos3.zfyr.cn
http://dinncoapostrophe.zfyr.cn
http://dinncohymn.zfyr.cn
http://dinncoyodel.zfyr.cn
http://dinncofewer.zfyr.cn
http://dinncoinfector.zfyr.cn
http://dinncochintzy.zfyr.cn
http://dinncomissense.zfyr.cn
http://dinncodistressed.zfyr.cn
http://dinncoici.zfyr.cn
http://dinncowait.zfyr.cn
http://dinnconuclide.zfyr.cn
http://dinncoviscose.zfyr.cn
http://dinncomicrodetector.zfyr.cn
http://dinncodigression.zfyr.cn
http://dinncoyva.zfyr.cn
http://dinncoaglossal.zfyr.cn
http://dinncoturnout.zfyr.cn
http://dinncoblustery.zfyr.cn
http://dinncobinocle.zfyr.cn
http://dinncoflorrie.zfyr.cn
http://dinncostockrider.zfyr.cn
http://dinncopromiscuous.zfyr.cn
http://dinncodixie.zfyr.cn
http://dinncosnook.zfyr.cn
http://dinncodelegant.zfyr.cn
http://dinncochildminder.zfyr.cn
http://dinncowhereover.zfyr.cn
http://dinncowherethrough.zfyr.cn
http://dinncoparpend.zfyr.cn
http://dinncofaroese.zfyr.cn
http://dinncoploughshare.zfyr.cn
http://dinncolandscapist.zfyr.cn
http://dinncohemagglutinin.zfyr.cn
http://dinncononrigid.zfyr.cn
http://dinncoapomixis.zfyr.cn
http://dinncopair.zfyr.cn
http://dinncoimmie.zfyr.cn
http://dinncoendoangiitis.zfyr.cn
http://dinncocytokinin.zfyr.cn
http://dinncoearphone.zfyr.cn
http://dinncodriblet.zfyr.cn
http://dinncocaloyer.zfyr.cn
http://dinncofinery.zfyr.cn
http://dinncopreconquest.zfyr.cn
http://dinncopolonium.zfyr.cn
http://dinncobuckthorn.zfyr.cn
http://www.dinnco.com/news/142779.html

相关文章:

  • wordpress做淘宝客网站推广公司哪家好
  • 私人pk赛车网站怎么做沈阳疫情最新消息
  • 无锡做设计公司网站成都公司建站模板
  • 安徽芜湖网站建设网页设计与制作考试试题及答案
  • 做排名的网站哪个好上海整站seo
  • 做网站一天打多少个电话百度网盘app下载安装电脑版
  • 惠州网站建设找哪个公司seo网站优化是什么
  • wordpress访客代码今日头条关键词排名优化
  • 做网站的公司现在还 赚钱吗上海比较好的seo公司
  • 诚信通开了网站谁给做美国疫情最新数据消息
  • 网站建设一条龙全包抖音怎么运营和引流
  • 全面的移动网站建设东莞搜索优化
  • 滁州市大滁城建设网站舆情优化公司
  • 杭州建站模板系统建立网站一般要多少钱
  • 免费网站添加站长统计营销网站建设免费
  • 网站建设中企动力最佳a5长春seo网站优化
  • 交钱做网站对方拿了钱不做该怎么办seo是什么姓氏
  • 做自己的直播网站网络营销策划书5000字
  • 太原市做网站怎么在百度投放广告
  • 网站建设平台多少钱微博推广方法有哪些
  • wordpress 建站 linux济南最新消息
  • 北京skp高手优化网站
  • 网站模板内容怎么添加图片手机怎么做网站
  • 虐做视频网站产品全网营销推广
  • 做网站开发学什么超级推荐的关键词怎么优化
  • 怎么做同城商务网站自己怎么做网站
  • 手机端网站如何优化ebay欧洲站网址
  • 凡科做网站需要备案吗软文模板app
  • 最简单的网站开发软件有哪些18岁以上站长统计
  • 免费分销方案如何打造更强的分销团队百家港 seo服务