-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use filters dynamically ? #406
Comments
The filters are actually handled by the broker. The client merely passes them through. The specification allows for use of other message properties as well as application properties. The filter can only be set on opening a receiver. If you need to change it you will need to close the original receiver and create a new one. |
Thank you grs for guiding me on this line. |
One more question, How to pass multiple filters ? to selector function any sample snippet ? |
Whether a broker supports multiple filters on the same link will be a question for the particular broker. However the selector can combine multiple terms, so that may be sufficient. As to the mechanism in the client, you just need to pass a map as the value for filters and that can contain multiple entries if supported by the broker. |
Thank grs for your quick turnaround. have spent some time to configure filters from map way
const filtersMap = {}; now, am passing message that has cluster_version value as 9.13.0 to my topic. am expecting my questions,
|
The return value of filters.selector() is a map. You can add other filters into that map (as long as they are correctly formatted according o the specification of the filter. Obviously you can't set multiple different selector filters on the same receiver, though the single selector can have multiple terms. |
Thank you grs, if my message from amqp topic, which am listening to. Message { either this works but if when use but when i used selector values with comma or space separated fails... Two use case not able make it work, is
any inputs for multiple filters and non application_properties filters |
For message properties, you need to prefix them with To combine terms, use |
let me try appending amqp then will update you. |
using filter like amqp.first_acquirer is not helping us. |
I would suggest asking the support for the broker you are using what they recommend for your use case. |
sure, let me reach up with my backend team and collect data on broker side. thanks a lot for your support. |
Hello Team,
We are using the rhea client to monitor topic say "data".
and am using filters
var receiver_opts = {
source: {
filter:filter.selector("x=100'") //-- Filter is applied on application_properties’s attributes
}
}
connection.open_receiver(receiver_opts);
My Question is :
Can see that filter works only with attributes of application_properties ? correct me.
from this example : https://github.com/amqp/rhea/blob/bc63ef3527a42167822a2507574eaa1bc5e57958/examples/selector/send.js
is there way to configure filters dynamically ? say initially, when i start my application, i want to filter X data
then user is also interested in Y data and Z data.. so on so for.
how to configure filters dynamically on open_receiver method ? do i need to create every time open_receiver object ?
The text was updated successfully, but these errors were encountered: