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

淮安做网站需要多少钱现在最火的发帖平台

淮安做网站需要多少钱,现在最火的发帖平台,互联网动态网站,事务所网站建设1)问题,Class MessageA 基类,Class MessageB继承自MessageA; 用bus.Publish方法本想把有些消息只发给B队列,结果由于其继承关系A队列也获得了消息; 解决方法用send, Uri uri new Uri(RabbitM…

1)问题,Class MessageA 基类,Class MessageB继承自MessageA;

用bus.Publish方法本想把有些消息只发给B队列,结果由于其继承关系A队列也获得了消息;

解决方法用send,

 Uri uri = new Uri(RabbitMqUriQueueB);var endPoint = await _bus.GetSendEndpoint(uri);await endPoint.Send(MessageB);

2)在rabbitmq中设置

把B类型unbind掉,应该就可以了;

 

3)可能的其他方式

Message Topology · MassTransit

 

Message Topology

Message types are extensively leveraged in MassTransit, so making it easy to configure how those message types are used by topology seemed obvious.

Entity Name Formatters

Message Type

MassTransit 的exchanges,topics名称默认是消息名称,可以通过如下改为别名.

Bus.Factory.CreateUsingRabbitMq(cfg =>{    cfg.Message<OrderSubmitted>(x => {        x.SetEntityName("omg-we-got-one");    });
});

It's also possible to create a message-specific entity name formatter, by implementing IMessageEntityNameFormatter<T> and specifying it during configuration.

class FancyNameFormatter<T> :IMessageEntityNameFormatter<T>
{public string FormatEntityName(){// seriously, please don't do this, like, ever.return type(T).Name.ToString();}
}Bus.Factory.CreateUsingRabbitMq(cfg =>
{cfg.Message<OrderSubmitted>(x =>{x.SetEntityNameFormatter(new FancyNameFormatter<OrderSubmitted>());});
});

It's also possible to replace the entity name formatter for the entire topology.

class FancyNameFormatter<T> :IMessageEntityNameFormatter<T>
{public string FormatEntityName(){// seriously, please don't do this, like, ever.return type(T).Name.ToString();}
}class FancyNameFormatter :IEntityNameFormatter
{public FancyNameFormatter(IEntityNameFormatter original){_original = original;}public string FormatEntityName<T>(){if(T is OrderSubmitted)return "we-got-one";return _original.FormatEntityName<T>();}
}Bus.Factory.CreateUsingRabbitMq(cfg =>
{cfg.Message<OrderSubmitted>(x =>{x.SetEntityNameFormatter(new FancyNameFormatter(cfg.MessageTopology.EntityNameFormatter));;});
});

Attributes

EntityName

通过EntityName 熟悉修改消息名称

[EntityName("order-submitted")]
public record LegacyOrderSubmittedEvent{}

ConfigureConsumeTopology

ConfigureConsumeTopology 可选属性,设置后决定这个消息类型对应的topic或exchange是否应该被创建并订阅到这个队列。

[ConfigureConsumeTopology(false)]
public record DeleteRecord{}

ExcludeFromTopology

ExcludeFromTopology 可选属性,决定这个消息类型实例发布时,这个消息的 topic 或 exchange 是否被创建。

如下例子中发布 ReformatHardDrive 命令不会在broker上创建 ICommand topic or exchange。

[ExcludeFromTopology]
public interface ICommand{}public record ReformatHardDrive : ICommand{}

不使用属性,可以在配置时设置:

...UsingRabbitMq((context,cfg) =>
{cfg.Publish<ICommand>(p => p.Exclude = true);
});
http://www.hkea.cn/news/90765/

相关文章:

  • 电力建设网站网络推广网站的方法
  • 如何做网站窗口网站优化网络推广seo
  • 营销型网站建设效果网络营销策划推广方案
  • 专业的网站搭建多少钱网站seo优化价格
  • 广州公司网站设计制作win10优化大师官网
  • 做调查哪个网站比较可靠百度指数查询
  • 怎么在建设厅网站报名广州网站优化服务
  • 怎么用dw做静态网站b站好看的纪录片免费
  • 济南网站建设那家好网站制作公司有哪些
  • 域名和网站名不一样营销公司
  • discuz做电影网站免费网站seo
  • 惠民建设局网站明年2024年有疫情吗
  • 卫龙的网站是谁做的今日的新闻
  • 厚街找人做网站动态网站设计
  • 永春县住房和城乡规划建设局网站太原seo排名优化软件
  • 怎么上网站后台爱站小工具计算器
  • 网页编辑岗位职责seo上海优化
  • 网站做二维码吗做网站的外包公司
  • 郑州市中原区疫情最新消息上海网站营销seo方案
  • 狂人站群系统中国最权威的网站排名
  • 简单网站开发实例网站运营工作的基本内容
  • 飞机免费代理ip爱站网seo综合查询工具
  • 河南焦作有做网站开发的公司吗巩义网络推广公司
  • 邓州做网站网络广告有哪些形式
  • 爬闪数媒 网站建设网站建站流程
  • 网站建设广州白云百度统计app下载
  • 惠州短视频seoseowhy论坛
  • 肇庆网站快速排名优化温州seo排名公司
  • 北京疫情死亡人数最新消息王通seo赚钱培训
  • 北京做网站的外包公司营销策划方案案例范文