CEPM Install and Config Guide
JMS Configuration for PAP-PDP Database Separation

Table Of Contents

JMS Configuration for PAP-PDP Database Separation

PAP-PDP Database Separation

Configuring ActiveMQ Server

Configuring Tibco JMS

Steps to Create JMS Resources in Tibco Server

Configuring WebLogic JMS

Steps to Create JMS Resources in WebLogic Server


JMS Configuration for PAP-PDP Database Separation


PAP-PDP Database Separation

This chapter is intended to provide the user with the information on how to integrate a JMS provider with CEPM. It covers the following issues:

how to integrate JMS provider with CEPM

how to configure pap_config.xml and pdp_config.xml files for to enable the messaging service

how the JMS resources such as connection factories and topics get created in Administration Console of different JMS providers

JMS is a message oriented middleware used for communication in between various business components of a J2EE web application. JMS enables the application components to update each other with the essential events happened in one or the other components in a distributed architecture. In multi-tiered architecture like CEPM, JMS provider plays a significant role while communicating two or more loosely-coupled components (clients) and updating the events by exchanging messages.

In CEPM, a client application can be associated with multiple PDPs which need to interact with the PAP. This is achieved by integrating CEPM with a JMS provider using which the PAP and PDPs communicate with each other in a non-shared mode. CEPM supports the following JMS Server:

ActiveMQ V4.0.2 (prepackaged with the CEPM installer)

Tibco V3.1

WebLogic V9.2

The current version of CEPM does not allow establishing communication between two PAPs (i.e. PAP-PAP communication).

Following diagram shows the Non-Shared Mode of operation between PAP and PDP components:

Figure 11-1 Non-shared Model

In the Non-Shared Mode of deployment, PAP and PDP access separate database instances and interact with each other using Java Messaging System (JMS). CEPM uses publish-subscribe model for the asynchronous communication between PAP and one or more PDPs. Let us assume that the PAP uses a database instance called PAP-DB and the PDP uses PDP-DB. When an event is initiated in PAP, the PAP publishes the information to the Topics within the JMS Server. The Topics send the message to the corresponding subscribed PDP. The PDP after receiving the message updates the PDP-DB with the appropriate topic information.

CEPM recommends creation of the JMS resources such as topics, connection factories, etc. using the internal APIs. A topic can be dynamically created using the internal APIs in two instances such as at the server start-up time and during runtime. In the first case, when you start the CEPM application, it takes the PDP names from the persistence store and creates the corresponding topics in the JMS provider. During runtime, if you associate a new or existing PDP with the client application by updating it in the PAP, then a new topic will be created in the JMS provider immediately after the association.

You can create the topics in the JMS provider server consoles either through GUI (in WebLogic) or through command line (in Tibco). The number of topics to be created is derived from the number of PDPs available in the entitlement repository. Apart from these topics, one more topic called Reply Topic is created which is dedicated to the PAP to communicate the messages regarding failure of any PDPs while synchronizing the messages. For example, if there are five PDPs present in the repository, a total of six topics get created. It is important to note that the reply topic name entered in the provider console should be exactly the same as mentioned in the <jms> tag of pap_config.xml file.

The communication between client and server is established by defining a set of messages. These messages are abstract java objects which contain entity objects and action events. While the entity objects include users, groups, roles, resources, policies, attributes etc., the action events are create, update and delete.

In the above scenarios, if there are multiple PDPs out of which one of the PDPs fails to update the data due to any reason, it would be done once the PDP is up and it gets the messages from JMS. The possible failover instances in case of PDPs are as follows:

any of the PDP servers is down

the database is down

any unknown problem

Configuring ActiveMQ Server

CEPM installer is prepacked with ActiveMQ server configuration as the default messaging provider. The relevent JMS configuration parameters for the default JMS are present in configure.properties file. If you are using the default JMS, JMS resources like connectionfactory, topics etc. are created by utilizing the internal APIs. Hence, you must set the <useJndi> tag to false.

Following steps must be taken to integrate ActiveMQ JMS with CEPM:


Step 1 Open the pap_config.xml file from the .../CEPM-V3.3.0.0/config folder and make the following modification:

Set the <shared-repository> tag to false. This implies the PAP-PDP database separation

Update the <jms> tag as shown below:

<jms>
	<env>
	<url>tcp://localhost:61616</url>
	<connectionFactory>org.apache.activemq.ActiveMQConnectionFactory
	</connectionFactory>
	<username>ActiveMQConnection.DEFAULT_USER</username>
	<password>c6p96kuD91p3==</password>
	<replyTopic>replyTopicName</replyTopic>
</env>
<reconnect_interval>100000</reconnect_interval>
<useJndi>false</useJndi>
<jndi>
	<providerUrl></providerUrl>
	<providerCtxFactory></providerCtxFactory>
	<jndiUserName></jndiUserName>
	<jndiPassword></jndiPassword>
	</jndi>
</jms>

<url>: Set this to the Host and Port of the machine where the JMS Server is running

<connectionFactory> refers to the connection factory package name.

<username> and <password> are optional parameters and refer to the username and password configured for the server instance in the JMS sever. The password must be in encrypted form. Refer to Step 3 of Chapter 3, "Common Installation Steps" to know how to generate encrypted password.

<replyTopic> refers to the name of the topic dedicated to the PAP which communicates all the messages regarding failure of any PDPs while synchronizing the messages.

<reconnect_interval>: Set this to the time interval (in milliseconds) after which the PAP and PDP will try to re-establish the JMS connection, in case the JMS Server is down.

<useJndi> tag must be set to false as all the JMS resources are created using internal APIs and not in the ActiveMQ server console. So there is no need of updating the <jndi> tag.

In the <handlers> tag, edit the <handlerName> as shown here:

<handlers>
      <common-properties>
            <sessionuser>superuser</sessionuser>
            <sessionpassword>admin</sessionpassword>
      </common-properties>
	<handler name="JMSPAPSYNCHandler" enabled="true" type="*.*">
      <impl>com.cisco.epm.jms.PAPHandler</impl>
	</handler>
 </handlers>

Step 2 Open the pdp_config.xml file from ../CEPM-V3.3.0.0/config/pdp folder and make the following modifications:

Set the <shared-repository> tag to false. This implies the PAP-PDP database separation.

Enter the PDP name in the <pdpName> tag. It is important to note that the provider will consider this value as PDP name if <useJndi> tag is set to false

In the <jms> tag, set the JMS URL host and port to the machine IP where the JMS Server is running.

Step 3 Start the JMS server by running activemq.bat file from.../incubator-activemq-4.0.2/bin folder

Step 4 Start the PAP server and the PDP server.

Step 5 To test the JMS configuration, go to the PAP console and create a resource under the said application. Check whether the event has been synchronized in the PAP and PDP databases.


Note If JMS is enabled, data imported into PAP DB through PAP UI or by using API will not be synchronized with the PDP DB. To make this happen, update the imported application in the PAP console by adding a PDP to it. When you click the update button, synchronization will be done.


This completes the JMS configuration process in ActiveMQ server.


Configuring Tibco JMS

As mentioned earlier, you can create the JMS resources either by using the internal APIs or in the server console of the JMS provider. In the later case, the server administration console provides the platform to create variety of JMS resources. In Tibco, it is done in the JMS Administration Tool. Click this link for more information on how to create JMS resources in the Tibco Administration Tool.

Following steps must be taken to integrate Tibco JMS with CEPM:


Step 1 Open the pap_config.xml file from .../CEPM-V3.3.0.0/config folder and make the following modification:

Set the <shared-repository> tag to false. This implies the PAP-PDP database separation

Update the <jms> tag as shown here:

<jms>
      <env>
            <url>tcp://localhost:61616</url>
            <connectionFactory>TopicConnectionFactory</connectionFactory>
            <username>Tibco_User</username>
            <password>c6p96kuD91p3Gwazl0w==</password>
            <replyTopic>replyTopicName99</replyTopic>
      </env>
      <reconnect_interval>100000</reconnect_interval>
      <useJndi>true</useJndi>
      <jndi>
            <providerUrl>tcp://localhost:7222</providerUrl>
	
<providerCtxFactory>com.tibco.tibjms.naming.TibjmsInitialContextFactory</providerCtxFa
ctory>
            <jndiUserName></jndiUserName>
            <jndiPassword></jndiPassword>
      </jndi>
</jms>

<url>: Set this to the Host and Port of the machine where the Tibco Server is running

<connectionFactory> refers to the connection factory package name.


Note If you are using JNDI, the connection factory name must be the same as created in the JMS Provider console. For example, if you create a connection factory called ConnFact1 then you must set the value of <connectionFactory> tag to ConnFact1.Click this link to know Steps to Create JMS Resources in Tibco Server.


<username> and <password> are optional parameters and refer to the username and password configured for the server instance in the JMS sever. The password must be in encrypted form. Refer to Step 3 of Chapter 3, "Common Installation Steps" to know how to generate encrypted password.

<replyTopic> refers to the name of the topic dedicated to the PAP which communicates all the messages regarding failure of any PDPs while synchronizing the messages.

<reconnect_interval>: Set this to the time interval (in milliseconds) after which the PAP and PDP will try to re-establish the JMS connection, in case the JMS Server is down.

<useJndi> tag is set to true if you create the JMS resources using in the Tibco server administration console. If set to false these resources are created using the internal APIs.

<providerUrl> refers to the URL where Tibco server is running.

<providerCtxtFactory> refers to the Context Factory class name.

<jndiUsename> and <jndiPassword> are optional parameters and must be mentioned in these fields if exist.

In the <handlers> tag, edit the <handlerName> as shown here:

<handlers>
      <common-properties>
            <sessionuser>superuser</sessionuser>
            <sessionpassword>admin</sessionpassword>
      </common-properties>
		<handler name="JMSPAPSYNCHandler" enabled="true" type="*.*">
      <impl>com.cisco.epm.jms.PAPHandler</impl>
		</handler>
</handlers>

This handler is a predefined handler which is employed for JMS sync.

Step 2 Open the pdp_config.xml file from ../CEPM-V3.3.0.0/config/pdp folder and make the following modifications:

Set the <shared-repository> tag to false. This implies the PAP-PDP database separation.

Enter the PDP name in the <pdpName> tag.

Set <useJndi> tag to true if you create the JMS resources in the Tibco server administration console. If the value is set to false, these resources are created using the internal APIs.

Update the <jms> tag as shown below:

<jms>
		<env>
			<url>tcp://localhost:61616</url>
			<connectionFactory>
				TopicConnectionFactory
			</connectionFactory>
			<username>ActiveMQConnection.DEFAULT_USER</username>
			<password>		c6p96kuD91p3==			</password>
		</env>
		<reconnect_interval>100000</reconnect_interval>
		<useJndi>true</useJndi>
		<jndi>
			<jndiName>jndiName</jndiName>
			<providerUrl>tcp://64.103.172.251:61616</providerUrl>
			<providerCtxFactory>
				com.tibco.tibjms.naming.TibjmsInitialContextFactory
			</providerCtxFactory>
			<jndiUserName></jndiUserName>
			<jndiPassword></jndiPassword>
		</jndi>
	</jms>

The JMS parameters such as URL, connection factory, user ID and password must contain the same field values as in case of pap_config.xml file.

Updat e the following JNDI parameters:

<jndiName> refers to the JNDI Name using which the topics are created.

<providerUrl> refers to the URL where Tibco server is running.

<providerCtxtFactory> refers to the Context Factory class name.

<jndiUsename> and <jndiPassword> are optional parameters and must be mentioned in these fields if exist.

Step 3 Start the Tibco server.

Step 4 Start the PAP server and the PDP server.

Step 5 To test the JMS configuration, go to the PAP console and create a resource under the said application. Check whether the event has been synchronized in the PAP and PDP databases.


Note If JMS is enabled, data imported into PAP DB through PAP UI or by using API will not be synchronized with the PDP DB. To make this happen, update the imported application in the PAP console by adding a PDP to it. When you click the update button, synchronization will be done.


This completes the JMS configuration process in Tibco server.


Steps to Create JMS Resources in Tibco Server

You can create Connection Factory and Topics in Tibco server in the following manner:


Step 1 Open the Tibco Administration tool in the command prompt.

Step 2 Create a connection factory by running the following command:

create factory <name> <type>

where <name> refers to the new connection factory name

<type> must be set to `topic'

For example, to create a connection factory named ConnFact1, run the following command:

create factory connFact1 topic

Step 3 Create a topic using the following command:

create topic <name>

where <name> refers to the new topic name.

Topic name should be For example, to create a topic named Topic1, run the following command:

create topic Topic1

Configuring WebLogic JMS

Following steps must be taken to integrate WebLogic JMS with CEPM:


Step 1 Open the pap_config.xml file from .../CEPM-V3.3.0.0/config folder and make the following modification:

Set the <shared-repository> tag to false. This implies the PAP-PDP database separation

Update the <jms> tag as shown here:

<jms>
      <env>
             <url>tcp://localhost:7222</url>
             <connectionFactory>weblogic.jms.ConnectionFactory
             </connectionFactory>
             <username></username>
             <password></password>
             <replyTopic>replyTopicName99</replyTopic>
       </env>
       <reconnect_interval>100000</reconnect_interval>
       <useJndi>true</useJndi>
       <jndi>
	<providerUrl>t3://localhost:7011</providerUrl>
       <providerCtxFactory>weblogic.jndi.WLInitialContextFactory
       </providerCtxFactory>
	<jndiUserName></jndiUserName>
	<jndiPassword></jndiPassword>
       </jndi>
</jms>

<url>: Set this to the Host and Port of the machine where the Tibco Server is running

<connectionFactory> refers to the connection factory package name.


Note If you are using JNDI, the connection factory name must be the same as created in the JMS Provider console. For example, if you create a connection factory called ConnFact1 then you must set the value of <connectionFactory> tag to ConnFact1.Click this link to know Steps to Create JMS Resources in WebLogic Server.


<username> and <password> are optional parameters and refer to the username and password configured for the server instance in the JMS sever. The password must be in encrypted form. Refer to Step 3 of Chapter 3, "Common Installation Steps" to know how to generate encrypted password.

<replyTopic> refers to the name of the topic dedicated to the PAP which communicates all the messages regarding failure of any PDPs while synchronizing the messages.

<reconnect_interval>: Set this to the time interval (in milliseconds) after which the PAP and PDP will try to re-establish the JMS connection, in case the JMS Server is down.

<useJndi> tag is set to true if you create the JMS resources using in the WebLogic server administration console. If set to false these resources are created using the internal APIs.

<providerUrl> refers to the URL where WebLogic server is running.

<providerCtxtFactory> refers to the Context Factory class name.

<jndiUsename> and <jndiPassword> are optional parameters and must be mentioned in these fields if exist.

In the <handlers> tag, edit the <handlerName> to JMSSYNCHandler as shown here:

<handlers>
      <common-properties>
            <sessionuser>superuser</sessionuser>
            <sessionpassword>admin</sessionpassword>
      </common-properties>
		<handler name="JMSPAPSYNCHandler" enabled="true" type="*.*">
      <impl>com.cisco.epm.jms.PAPHandler</impl>
		</handler>
</handlers>

This handler is a predefined handler which is employed for JMS sync.

Step 2 Open the pdp_config.xml file from ../CEPM-V3.3.0.0/config/pdp folder and make the following modifications:

Set the <shared-repository> tag to false. This implies the PAP-PDP database separation.

Enter the PDP name in the <pdpName> tag.

Set <useJndi> tag to true if you create the JMS resources in the WebLogic server administration console. If the value is set to false, these resources are created using the internal APIs.

Update the <jms> tag as shown below:

<jms>
		<env>
			<url>tcp://localhost:72222</url>
			<connectionFactory>
				weblogic.jms.ConnectionFactory
			</connectionFactory>
			<username>ActiveMQConnection.DEFAULT_USER</username>
			<password>		c6p96kuD91p3==			</password>
		</env>
		<reconnect_interval>100000</reconnect_interval>
		<useJndi>true</useJndi>
		<jndi>
			<jndiName>jndiName</jndiName>
			<providerUrl>tcp://64.103.172.251:61616</providerUrl>
			<providerCtxFactory>
				org.apache.activemq.jndi.ActiveMQInitialContextFactory
			</providerCtxFactory>
			<jndiUserName></jndiUserName>
			<jndiPassword></jndiPassword>
		</jndi>
	</jms>

The JMS parameters such as URL, connection factory, user ID and password must contain the same field values as in case of pap_config.xml file.

Updat e the following JNDI parameters:

<jndiName> refers to the JNDI Name using which the topics are created.

<providerUrl> refers to the URL where WebLogic server is running.

<providerCtxtFactory> refers to the Context Factory class name.

<jndiUsename> and <jndiPassword> are optional parameters and must be mentioned in these fields if exist.

Step 3 Start the WebLogic server.

Step 4 Start the PAP server and the PDP server.

Step 5 To test the JMS configuration, go to the PAP console and create a resource under the said application. Check whether the event has been synchronized in the PAP and PDP databases.


Note If JMS is enabled, data imported into PAP DB through PAP UI or by using API will not be synchronized with the PDP DB. To make this happen, update the imported application in the PAP console by adding a PDP to it. When you click the update button, synchronization will be done.



Note If JMS is enabled, data imported into PAP DB through PAP UI or by using API will not be synchronized with the PDP DB. To make this happen, update the imported application in the PAP console by adding a PDP to it. When you click the update button, synchronization will be done.


This completes the JMS configuration process in Tibco server.


Steps to Create JMS Resources in WebLogic Server

You can create Connection Factory and Topics in Tibco server in the following manner:


Step 1 Create JMS Server:

You must create JMS server instance keeping the Admin Server as the target in the WebLogic Server Domain. To do this:

Login to the WebLogic Administration Console.

In the left navigation pane, go to Services > Messaging > JMS Servers. The Summary of JMS Servers page appears which enlists the existing JMS Servers already created in the current WebLogic domain.

Click New to create a new JMS server.

Enter the JMS properties such as name and persistence store details. The persistence store is used to store the message objects. Click Next.


Note You can create a persistence store in this page by clicking Create New Store button, which will prompt you to enter the store details such as name of the new store, type of the store and directory path of the store.


Select the store type as File Store. Click Next.

Enter the file store properties like file store name, target and directory path. Click Finish. This gets you back to the Summary of JMS Servers page where you can find the newly created server in the list of JMS Servers.

Step 2 Create JMS modules:

JMS modules are created to store the JMS resources like connection factories and topics. To create the JMS Modules:

Go to Services > Messaging > JMS Modules in the left navigation pane of the WebLogic Server Administration Console. The JMS Module page appears. Click New.

Enter the module properties such as name, descriptor file name and location in domain. Click Next.

Select the target for the module by checking the Admin Server. On this target (JMS Server) wherein the newly created module would be deployed. Click Next.

This page asks you whether you want to continue with the current process to create JMS resources under the newly created module. If so, check `Would you like to add resources to this JMS System Module?' check box. Click Finish. This will create the new JMS module wherein you can include as many JMS resources.


Note Note: You can also add resources to any existing modules by left this option unchecked. Go to the Summary of JMS Modules page, select the appropriate module and add resources to that module.


Step 3 Create Connection factory:

You can create JMS resources such as connection factories and topics in a selected JMS System Module. To create a Connection factory:

After the JMS System module is created in step 4-iv above and you have opted for adding resource to the selected module, the Settings for selected module page appears. This page contains a table which summarizes the JMS resources created in the module. Click New.

Chose the type of JMS resource to be created. Select Connection Factory. Click Next.

Enter the factory details such as name and JNDI name. This JMDI name will do the look up any changes done to the new connection factory. Click Next.

Select the target (JMS Server) wherein the newly created factory would be deployed. Click Next.

You can associate a group of resource to a subdeployment target. It can be done in this step or later at any point of time. If you assign the subdeployment to a resource and click Finish, the new connection factory is created.


Note Note: To create a subdeployment, click Create a new SubDeployment button in this page. Enter the subdeployment name and click OK. This prompts you to assign the targeted admin server and JMS server to this subdeployment. Click Finish.


Step 4 Create Topic:

To create a topic in the JMS module:

Select Topic from the list of available JMS resources in the Create a new JMS system module resource page. Click Next.

Enter the JMS destination properties such as topic name and JNDI name. Click Next.

Assign the appropriate Subdeployment to the topic. Click Finish. This creates the required topic.