In this example, you will enable multicast in the EMS server and configure a multicast channel, over which the server can broadcast multicast messages. You will also create a multicast-enabled topic named multicastTopic and associate it with the multicast channel, allowing subscribers to receive messages published to multicastTopic over multicast.Multicast channels can only be configured statically by modifying the configuration files. There are no commands in the administration tool to configure multicast channels.Stop the server by using the shutdown command in the administration tool:To enable multicast in the server, set the multicast property to enabled in the tibemsd.conf configuration file:The EMS server broadcasts messages to consumers over multicast channels. Each channel has a defined multicast address and port. Messages published to a multicast-enabled topic are sent by the server and received by the subscribers on these multicast channels.To create a multicast channel, add the following definition to the multicast channels configuration file, channels.conf:
On a computer running a UNIX system, the EMS server (as well as the multicast daemon) must have root privileges. This can be done either by running the EMS server from a root user account, or the EMS server can be setuid (set user ID) root, allowing any user to run tibemsd with the required root privileges. Root privileges are required because multicast uses raw sockets. On a computer running Windows, you can also start the EMS server from the Start menu, following the path Programs > TIBCO > TIBCO EMS 5.1 > Start EMS server.In the administration tool, use the show topics command to confirm that multicastTopic is multicast-enabled as indicated by a ‘+’ in the M column:In order to make a topic multicast-enabled it must be associated with a multicast channel through its channel property.> create topic multicastTopic channel=multicast-1Creating a multicast subscriber follows the same steps as creating a non-multicast subscriber, except that a multicast subscriber requires a session acknowledgment mode of com.tibco.tibjms.Tibjms.NO_ACKNOWLEDGE.To start user1 as a multicast subscriber:
1.
2. Enter setup to set the environment and classpath:
3. Execute the tibjmsMsgConsumer client to assign user1 as a subscriber to the multicastTopic topic with a Session acknowledgment mode of NO_ACKNOWLEDGE:
4. In the administration tool, use the show consumers command to confirm that user1 is a multicast subscriber to multicastTopic as indicated by a + in the M column:
Pend Msgs Pend Size Setting up a client to publish multicast message is no different from setting up a client to send publish and subscribe messages. Because the topic is enabled for multicast in the EMS server, the message producer does not need to follow any additional steps.
1.
2. Enter setup to set the environment and classpath:
3. Execute the tibjmsMsgProducer client to direct user1 to publish some messages to the multicastTopic topic:
In this example, user1 is both a publisher and subscriber.
Copyright © TIBCO Software Inc. All Rights Reserved.