Prerequisites for Multicasting Step 1: Set Up the JMS Application, Multicast Session and Topic Subscriber

8-2 Programming JMS for Oracle WebLogic Server JMS topics configured for multicasting can access WebLogic clusters configured for unicast because a JMS topic publishes messages on its own multicast address that is independent of the cluster address. However, the following considerations apply: ■ The router hardware configurations that allow unicast clusters may not allow JMS multicast subscribers to work. ■ JMS multicast subscribers need to be in a network hardware configuration that allows multicast accessibility. For more details, see Communications In a Cluster in Using Clusters for Oracle WebLogic Server.

8.4 Configuring Multicasting for WebLogic Server

The following figure illustrates the steps required to set up multicasting. Figure 8–1 Setting Up Multicasting

8.4.1 Prerequisites for Multicasting

Before setting up multicasting, the connection factory and destination must be configured to support multicasting, as follows: ■ For each connection factory, the system administrator configures the maximum number of outstanding messages that can exist on a multicast session and whether the most recent or oldest messages are discarded in the event the maximum is reached. If the message maximum is reached, a DataOverrunException is thrown, and messages are automatically discarded. These attributes are also dynamically configurable, as described in Section 8.4.4, Dynamically Configuring Multicasting Configuration Attributes. ■ For each destination, the Multicast Address IP, Port, and TTL Time-To-Live attributes are specified. To better understand the TTL attribute setting, see Section 8.4.5, Example: Multicast TTL. Note: Multicasting is only supported for the PubSub messaging model, and only for non-durable subscribers. Monitoring statistics are not provided for multicast sessions or consumers. Note: It is strongly recommended that you seek the advice of your network administrator when configuring the multicast IP address, port, and time-to-live attributes to ensure that the appropriate values are set. Using Multicasting with WebLogic JMS 8-3 For more information, see Configure topic multicast parameters in the Oracle WebLogic Server Administration Console Help.

8.4.2 Step 1: Set Up the JMS Application, Multicast Session and Topic Subscriber

Set up the JMS application as described in Section 5.2, Setting Up a JMS Application. However, when creating sessions, as described in Section 5.2.3, Step 3: Create a Session Using the Connection, specify that the session would like to receive multicast messages by setting the acknowledgeMode value to MULTICAST_NO_ACKNOWLEDGE. For example, the following method illustrates how to create a multicast session for the PubSub messaging model. JMSModuleHelper.createPermanentQueueAsyncctx, domain, jmsServerName, queueName, jndiName; Queue queue = findQueueqsess, jmsServerName, queueName, retry_count, retry_interval; In addition, create a topic subscriber, as described in Section 5.2.5.2, Create TopicPublishers and TopicSubscribers. For example, the following code illustrates how to create a topic subscriber: tsubscriber = tsession.createSubscribermyTopic;

8.4.3 Step 2: Set Up the Message Listener