Reputation: 1059
I want to build a publish/subscribe program to compute matrix manipulation on a cluster.
When a publisher send a message to a topic, message copies to all subscribers.
I want a copy of message send to one subscriber and the message deletes and not send to other subscribers.
Upvotes: 5
Views: 1792
Reputation: 11
Use a queue, not a topic. Topics are designed for one-to-many publication, queues allow multiple listeners but each message is delivered to only one listener.
Upvotes: 0
Reputation: 31852
There are two ways to do this.
Note that in both of these cases, all subscribers are connected to the same queue manager. Although Pub/Sub creates a single logical message, when it is broadcast to other queue managers it becomes multiple physical messages and their consumption by subscribers is not coordinated across the network.
Upvotes: 3