Core does not distinguish between publish subscribe and point to point messaging, since, in effect, point to point is just a special case of pub sub where there's only one subscriber.
With core, if a message is sent to an address, then all queues bound to that address will receive that message. That gives you pub-sub. This is discussed a bit in the user manual, section on messaging concepts.
Tim, thank you for that pointer. I am clearer now on how to create a producer that sends to a specific address, but I am having trouble creating consumers that use a specific address.
I want to be able to send messages on arbitrary addresses that appear out of thin air, with a hierarchical structure such as:
And then I'd want to create consumers that could receive messages on any number of or just one of those. I can't find a method in the ClientSession that lets me specify an address 'pattern' using wild-cards (or not, as the case may be). I see the filter expression parameter, but that doesn't seem to do what I want.
Can you point me to that part of the API or an example?
You don't create a consumer on the address, you create it on a queue (see the ClientSession api).
When you create a queue on an address, you can specify a wildcard for the adress and the queue will retain any messages sent to any matching addresses.
It's like this
address --------0..* queues ----- 0..* consumers
I.e. an address can have zero or more queues.
A queue can have zero or more consumers