Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

rabbitmq - Route message to queue based on one of the message's properties as routing key

I have a microservice A that publishes messages to an exchange E. Each one of those messages contain in one of its json-representation fields a property which I want to use as a routing key.

For example, if E has queues Q1 (which receives routing key R1), Q2 (R2) and Q3 (R3) bound to it, and message M was published to exchange E with routing key R2 in one its properties, I would like Q2 to get M.

However, I do not wish to explicitly send the message with a routing key from microservice A but to send it as is.

I was looking into rabbit plugins or exchange to exchange bindings to find a way to do it but couldn't find something of that sort without implementing another microservice that only routes the messages.

I would love to hear suggestions on how to do so based on existing tools.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...