首页 \ 问答 \ 在RabbitMQ主题交换中路由与模式不匹配的消息(Routing messages in RabbitMQ topic exchange that do NOT match a pattern)

在RabbitMQ主题交换中路由与模式不匹配的消息(Routing messages in RabbitMQ topic exchange that do NOT match a pattern)

使用以下路由密钥将两个队列绑定到主题交换:

队列A,与路由键模式匹配*.foo绑定
队列B,与路由键模式匹配*.bar绑定

我想在这个交换中添加第三个队列,它接收既不是foo消息也不是bar消息的消息。 如果我用#routing键绑定这个队列,我自然会得到我需要的所有消息,但包括我不想要的foobar

任何方式来路由邮件修补模式NOT *.foo AND NOT *.bar


Two queues are bound to a topic exchange with the following routing keys:

Queue A, bound with routing key pattern match *.foo
Queue B, bound with routing key pattern match *.bar

I'd like to add a third queue to this exchange that receives messages that are neither foo messages nor bar messages. If I bind this queue with a # routing key, I naturally get all messages I need, but including foo's and bar's which I don't want.

Any way to route messages patching a pattern NOT *.foo AND NOT *.bar ?


原文:https://stackoverflow.com/questions/28351469
更新时间:2024-05-02 11:05

最满意答案

它可以通过简单的UPDATE查询来完成:

update sample_table set amount = total_amount * percentage/100;

但是如果你需要PLSQL循环,你可以使用Cursor FOR LOOP:

for x in (select distinct percentage from sample_table) loop
  update sample_table set AMOUNT = total_amount * x.percentage/100 
  where percentage = x.percentage;
  dbms_output.put_line(x.percentage || ': ' || total_amount * x.percentage/100);
end loop;

It can be done by the simple UPDATE query:

update sample_table set amount = total_amount * percentage/100;

But if you need PLSQL loops you can use Cursor FOR LOOP :

for x in (select distinct percentage from sample_table) loop
  update sample_table set AMOUNT = total_amount * x.percentage/100 
  where percentage = x.percentage;
  dbms_output.put_line(x.percentage || ': ' || total_amount * x.percentage/100);
end loop;

相关问答

更多
  • oracle安装客户端工具pl/sql的目的是方便数据库的管理。 mysql也是一样的道理。安装phpMyAdmin或者Navicat,也是方便数据库的管理。
  • PLSQL developer是编写SQL的工具 ORACLE是数据库软件
  • 1、在Oracle的安装目录下找到tnsnames.ora。 2、在这个文件中填写连接数据库的配置信息。 DEMO = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.110)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = DEMO) ) )
  • 左外连接用left join,右外连接用right join语句。 比如 Oracle: select * from a, b where a.id=b.id(+) SQL: select * from a left join b on a.id=b.id 反过来a.id(+)=b.id 就是right join
  • 在这种情况下 ORA-00942表或视图不存在 首先要做的事情 检查表是否具有同义词(Oracle表名在系统视图中区分大小写): SELECT * from all_synonyms where table_name='LESSON'; 如果没有,您可以指定表所在的架构,也可以为其创建同义词。 我的架构在哪个表上? SELECT owner from all_tables where table_name='LESSON'; =>这使您可以在其他命令中使用 在hibernate ...
  • set feedback off 应该压制消息 set feedback off should suppress the message
  • 它可以通过简单的UPDATE查询来完成: update sample_table set amount = total_amount * percentage/100; 但是如果你需要PLSQL循环,你可以使用Cursor FOR LOOP: for x in (select distinct percentage from sample_table) loop update sample_table set AMOUNT = total_amount * x.percentage/100 wh ...
  • 你可以使用对象: CREATE OR REPLACE TYPE timer AS OBJECT ( start_time DATE , end_time DATE , CONSTRUCTOR FUNCTION timer RETURN SELF AS RESULT , MEMBER FUNCTION get_duration RETURN NUMBER ) ; / CREATE OR REPLACE TYPE BODY timer IS CONSTRUCTOR FUNCTI ...
  • SQL - 结构化查询语言 - 是查询关系数据库的“标准”语言。 大多数(如果不是全部)RDBMS供应商都支持SQL,或者确切地说是他们自己的SQL 版本 。 即使从80年代开始按ANSI标准化,也很少达到100%的合规性。 许多RDBMS接受特定于供应商的SQL扩展。 换句话说,Oracle的SQL和SQLite的实现并不完全相同。 但核心语言是一样的。 这就是为什么你经常/有时为这两种产品编写相同的查询。 另一方面, PL / SQL是Oracle 专有的程序语言。 它由Oracle Corporati ...
  • 假设您只想让光标工作: DECLARE C INTEGER := 0; TYPE MyCurTyp IS REF CURSOR; v_my_cursor MyCurTyp; v_col1 varchar2(20); -- replace varchar2(20) with correct data type v_col2 varchar2(20); -- replace varchar2(20) with correct data type BEGIN SE ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。