Open gustavo-armenta opened 6 years ago
Every spring bus client already has code to filter by destination service. Why do you need to add code?
My application is in dotnet core. Steeltoe does not provide the SpringCloudBus client
Ack. :+1:
@olegz or @sobychacko I think the question here is: is there a way to dynamically set the RoutingKey
using spring cloud stream abstractions?
@spencergibb I think routingKeyExpression
producer property is what you're looking for.
A SpEL expression to determine the routing key to use when publishing messages. For a fixed routing key, use a literal expression, such as routingKeyExpression='my.routingKey' in a properties file or routingKeyExpression: '''my.routingKey''' in a YAML file.
Interesting. What object is available as context for the expression? OP wants something dynamic.
It's extended Rabbit producer properties: spring.cloud.stream.rabbit.bindings.<channelName>.producer.routing-key-expression=blah
Question or Enhancement
I deployed ConfigServer as a PCF webapp
I am using one instance of ConfigServer to handle configuration changes for many applications (multitenant). The message written to SpringCloudBus has RoutingKey=”springCloudBus” and Payload contains “destinationService”:”{application}:**”. My problem is the message is received by clients from all applications and every app has to add code to filter by destinationService. I want the message to be received only by the {application} clients and it can be accomplished by setting RoutingKey={application}. Is there any way to do it today? Is it in the backlog?