Configuring Subject Mapping
Configuring subject mapping
Static authentication
mappings = {
# Simple direct mapping. Messages published to foo are mapped to bar.
foo: bar
# remapping tokens can be done with $<N> representing token position.
# In this example bar.a.b would be mapped to baz.b.a.
bar.*.*: baz.$2.$1
# You can scope mappings to a particular cluster
foo.cluster.scoped : [
{ destination: bar.cluster.scoped, weight:100%, cluster: us-west-1 }
]
# Use weighted mapping for canary testing or A/B testing. Change dynamically
# at any time with a server reload.
myservice.request: [
{ destination: myservice.request.v1, weight: 90% },
{ destination: myservice.request.v2, weight: 10% }
]
# A testing example of wildcard mapping balanced across two subjects.
# 20% of the traffic is mapped to a service in QA coded to fail.
myservice.test.*: [
{ destination: myservice.test.$1, weight: 80% },
{ destination: myservice.test.fail.$1, weight: 20% }
]
# A chaos testing trick that introduces 50% artificial message loss of
# messages published to foo.loss
foo.loss.>: [ { destination: foo.loss.>, weight: 50% } ]
}JWT authentication
Simple Mapping
Subject Token Reordering
Weighted Mappings for A/B Testing or Canary Releases
Traffic Shaping in Testing
Artificial Loss
Last updated
Was this helpful?