Subject Filtering with Wildcards
The wildcard characters, * and >, have the same semantics in import, export and exchange parameters as they do in listening calls:
| • | * matches any single element. |
| • | > in the last (rightmost) position matches one or more trailing elements. |
Recall that these rules of import parameter behavior apply also to routing daemons.
|
Importing this wildcard name |
Matches messages with names like these |
But not names like these (reason) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Routing Daemons Filter Interest to Permitted Subjects
Routing daemons filter local listening interest according to the subjects that the local networks can import and export. The general rule is that routing daemons disregard listening interest that would include subjects in either of these categories:
| • | Subjects that the listener’s local network cannot import. |
| • | Subjects that the sender’s local network cannot export. |
|
Note |
Customers frequently deploy application programs that listen to wildcard subjects that are more inclusive than the wildcard subjects that |
For example, consider a situation in which the local network imports FOO.> (that is, it does not permit any other subjects to enter from the WAN). When a process, L1, within the local network listens to the subject > (that is, the wildcard that matches any subject), the routing daemon first compares it to the permitted import subjects; since > is not a subset of FOO.>, the routing daemon does not forward any messages into the local network, so L1 does not receive any messages.
When a second process, L2, in the same local network, listens to the subject FOO.BAR, the routing daemon begins importing messages (because the subject matches a subject for which import is permitted); both L1 and L2 receive the imported messages.
When a third process, L3, listens to the subject FOO.>, the routing daemon widens the set of messages it imports; both L1 and L3 receive the additional message subjects.
Correctly Importing Wildcard Subjects summarizes this example, and presents further examples.
|
Importing this wildcard name |
While listening to this subject |
Imports these subjects |
Reason |
|
|
|
none |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
none |
|
|
|
|
|
|
|
|
|
|
|
See Also
Using Wildcards to Receive Related Subjects in