Skip to content
Discussion options

You must be logged in to vote

You can indeed use the {{partition()}} function in a subject mapping transform to insert a partition number token in the subject of the message being published. In this case you can use Core NATS subject transformation (which is part of the NATS account's settings) to have the NATS server(s) automatically insert that token in the subject as the message is being published, and before that message is captured (by the stream listening on that particular partition number).

In your example some applications publish messages on foo.<id> and you have a subject mapping defined in your account's settings with source: foo.* and destination foo.{{partition(5,1)}}.{{wildcard(1)}} and then create 5 st…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jnmoyne
Comment options

jnmoyne Feb 12, 2025
Collaborator

Comment options

You must be logged in to vote
0 replies
Answer selected by YashasAnand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants