This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to implement multicasting in java?

 
Kavita Shivani
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I am supposed to create a small multicast application. Multicasting is a new topic for me.
The requirement is that, I have a multicast server, few clients connected to it who are interested in some of the topics that the server multicasts. Each one of this client can register themselves to get information on each of the topics, using the topic ID. So I wanted to know if I can group these clients into one multicast address group and send the packets. If I do this, I will have to use a few InetAddresses, each representing a group address to which subset of the clients will register to. But this will increase as the number of topics increase. So my question is am I doing it the right way? Or is it that my multicast server will always have one multicast group address and I need to have a proper logic to seggregate the clients that wants to receive the information on topics they are interested in. I am not sure how do I design this.

Thank you,
Kavitha.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12081
29
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
search around for the Publish/Subscribe design pattern. it may help guide you in your design.
 
Rok Ć telcer
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:search around for the Publish/Subscribe design pattern. it may help guide you in your design.

Or in other words: Observer pattern.

Regards,
Rok
 
Jelle Klap
Bartender
Posts: 1951
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at JMS yet? Seems to me that a standard multicast JMS solution using topics would suit your needs pretty well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic