aeron

How to setup Aeron Cluster UDP multicast


I have tried to run the cluster auction sample and do the auction's exercise

Use multicast for the egress channel so that customers can see the other's prices and make better bids.

What I have done is change the egress channel from .egressChannel("aeron:udp?endpoint=localhost:0") to .egressChannel("aeron:udp?endpoint=239.255.255.1:4300|interface=192.168.10.137")

But I don't see any difference from the client's perspective. Because the client will only receive messages when BasicAuctionClusterService replies to the client session on onSessionMessage { ... session.offer(...); }

So I don't understand how to use multicast for the egress channel so that customers can see the other's price meaning...

Because if you want other clients to see others' messages, you have to store the client sessions into a list, so whenever the cluster service has a new message, we shall loop through this session list and reply back? Is it correct approaching?


Solution

  • To do this a new channel needs to be created to represent generic egress. This would not be specific to any session and only non-private data should be published on this multicast channel.