Skip to main content
Mitratech Success Center

Client Support Center

Need help? Click a product group below to select your application and get access to knowledge articles, webinars, training content, and release notes or to contact our support team.

Authorized users - log in to create a ticket, view tickets status and check your success plan details.

 

JMS Documentation

Overview

This document provides instructions on how to use JMS to assist with multi-casting in an Oracle environment.

https://docs.oracle.com/cd/E11035_01/wls100/jms/multicast.html

What is JMS?

The Java Message Service (JMS) API is a messaging standard that allows application components based on the Java Platform Enterprise Edition (Java EE) to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous.

What is Multi-casting?

Multi-casting enables the delivery of messages to a select group of hosts that subsequently forward the messages to subscribers in a cluster.

How to Set Up Multi-casting in Weblogic

One Managed Server, Multiple Deployments

Log into the weblogic console.

Create the JMS Server

  • Go to Services > Messaging > JMS Servers, click New.
  • Enter a name, click Next.
  • Click Create a New Store for the dropdown.
  • For the type, select File Store, click Next.
  • Enter a name, click Next.
  • Select the managed server as the target.
  • Click Finish.
  • Back in the JMS Server creation wizard, select this new Store from the dropdown.
  • Click Next.
  • Select the managed server as the target.
  • Click Finish.

Create the JMS Module

  • Navigate to Services > Messaging > JMS Modules, click New.
  • Enter a name, click Next.
  • Select the managed server as the target.
  • Click Finish.
  • For adding resources, check Yes.
  • Click Next.

Create the Connection Factory

To create the Connection Factory:

  • On the Configuration page of the new module, Click New.
  • Select Connection Factory, click Next.
  • The name and JNDI name should match what is provided for sync.jms.connection.factory.name in teamconnect.properties (as described below. We used EclipseLinkTopicConnectionFactory)
  • Click Next.
  • Select Advanced Targeting.
  • Create a new subdeployment and give a new name.
  • Select the JMS server (created above) as the target.
  • Click Finish.

Create a Topic

To create a Topic, 

  • Click New.
  • Select a Topic.
  • Enter Next.
  • The name and JNDI name should match what is provided for sync.jms.topic.name in teamconnect.properties (as described below. We used EclipseLinkTopic).
  • Click Next.
  • Select the subdeployment (created above).
  • Ensure the JMS server is selected.
  • Click Finish.

Update teamconnect.properties

Supply the following values to teamconnect.properties for all deployments on the managed server:

  • sync.enabled=yes
  • sync.jms.connection.factory.name=<value provided above in the connection factory section>
  • sync.jms.topic.name=<value provided above in the topic section>
  • sync.topic.host=t3://localhost:<managed server port number>

Note: I believe the JMS server runs on the same machine as the managed server, so even if this is a different machine than the weblogic console, localhost should be fine. If I'm wrong and it does run on the weblogic console's machine, it may need to be updated to the weblogic console's machine's address relative to the managed server's machine.

Multiple Managed Servers with One Deployment

  • The JMS Server and Topic each select one (the same one) of the managed servers as a target
  • One Connection Factory is created for each managed server, with that managed server and the JMS server as a target (or one Connection Factory with each managed server and the JMS server as targets, currently unsure). This also means all the Connection Factories (or just the one, depending on the approach) can't share a subdeployment with the Topic, since they need to also select managed servers as targets, so create separate subdeployments for each one
  • In teamconnect.properties, the value of sync.topic.host should contain the port number of the managed server which is set as the JMS server's target, and the IP of that managed server relative to the other managed servers (if on the same machine, localhost, if on separate machines, the appropriate address)

However, we kept running into an error mentioning "Connection refused: no router to destination" which we have yet to figure out how to resolve. This seems like more of a connection error than a configuration error so I'm fairly confident our configuration is correct and maybe there is some weblogic setting we are missing or something network related that is tripping us up, but we aren't certain either way.

How to Set Up Multi-casting in Tomcat

Tomcat Configuration

  1. All Tomcat side changes need to be made on all nodes of the cluster.
  2. All cluster nodes will be pointing at the same jms server.

STEP 1

  • Download apache-activemq-5.16.0
  • to start, run from apache-activemq-5.16.0\bin\activemq start
  • From console output of JMS you should see something like this
    • INFO | Apache ActiveMQ 5.16.0 (localhost, ID:{---(YOUR HOST ID)--) is starting
    • INFO | Listening for connections at: tcp://{hostname}:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600
    • INFO | Connector openwire started
    • INFO | Listening for connections at: amqp://{hostname}:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600
    • INFO | Connector amqp started
    • INFO | Listening for connections at: stomp://{hostname}:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600
    • INFO | Connector stomp started
    • INFO | Listening for connections at: mqtt://{hostname}:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600
  • Take note of the url used for listening to TCP connections as it will be the basis for properties elsewhere in these instructions

STEP 2
Change the below 2 files to in Tomcat:

  • in conf/server.xml
  • next to the other resources tag, we need to add

<Resource auth="Container" brokerURL="tcp://{hostname}:61616"
description="JMS Connection Factory for cache coordination"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
name="jms/EclipseLinkTopicConnectionFactory"
type="org.apache.activemq.ActiveMQConnectionFactory"/>


<Resource auth="Container" description="Cache coordination Topic"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
name="jms/EclipseLinkTopic" physicalName="OssCacheTopic"
type="org.apache.activemq.command.ActiveMQTopic"/>

  • the Url is based on where you're running the activemq server from but should just be the hostname:port (the other properties should not be included)

in conf/context.xml:
again next to other ResourceLink tags:

<ResourceLink global="jms/EclipseLinkTopicConnectionFactory"
name="jms/EclipseLinkTopicConnectionFactory"
type="org.apache.activemq.ActiveMQConnectionFactory"/>


<ResourceLink global="jms/EclipseLinkTopic"
name="jms/EclipseLinkTopic"
type="org.apache.activemq.command.ActiveMQTopic"/>

STEP 3

  • Add activemq-all-5.16.0.jar to Tomcat lib folder for each node

STEP 4

  • add JVM arg -Dorg.apache.activemq.SERIALIZABLE_PACKAGES=* to all JVMs in the cluster

STEP 5

  • update to teamconnect.properties (located in war file on each node)
  • sync.jms.topic.host=tcp://{hostname}:61616
  • again url is based off of where you are running jms from

Step 6

  • Start TeamConnect cluster and verify that each node is able to see the other nodes (verifying the logging dropdown all show the correct number of nodes is the easiest way to do this)