Create and Configure CYCLE
Using a web browser, connect to the Administrative Console using the appropriate server name and 9080 as the default port (Ex: server_name:9080/adminCenter" class="external-link" rel="nofollow") http://server_name:9080/adminCenter).
Create the CYCLE Application Server
-
Navigate to /path/to/ibm-liberty/IBM/WebSphere/Liberty/bin
-
Execute ./server create CYCLE.
-
It will create a directory named 'CYCLE' under /path/to/ibm-liberty/IBM/WebSphere/Liberty/usr/servers and the directory has a file called 'server.xml' which contains all the configurations.
-
Edit this 'server.xml' file to configure ListenAddress, ListenPorts, Application Library Path, Configuration File Path, JMS, and Data Sources, etc.
Refer to the below 'server.xml' file for the sample configurations for the CYCLE.
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.3</feature>
<feature>adminCenter-1.0</feature>
<feature>websocket-1.1</feature>
<feature>jdbc-4.1</feature>
<feature>jaxrs-2.0</feature>
<feature>jaxws-2.2</feature>
<feature>appSecurity-2.0</feature>
<feature>restConnector-2.0</feature>
<feature>jndi-1.0</feature>
<feature>appClientSupport-1.0</feature>
<feature>distributedMap-1.0</feature>
<feature>el-3.0</feature>
<feature>jaxb-2.2</feature>
<feature>wasJmsServer-1.0</feature>
<feature>wasJmsClient-2.0</feature>
<feature>jaxrsClient-2.0</feature>
<feature>json-1.0</feature>
<feature>servlet-3.1</feature>
<feature>ssl-1.0</feature>
<feature>concurrent-1.0</feature>
<feature>jms-2.0</feature>
</featureManager>
<variable name="defaultHostName" value="localhost" />
<basicRegistry id="basic">
<user name="admin" password="Welcome1" />
<user name="nonadmin" password="Welcome1" />
</basicRegistry>
<administrator-role>
<user>admin</user>
</administrator-role>
<remoteFileAccess>
<writeDir>${server.config.dir}</writeDir>
</remoteFileAccess>
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9081" httpsPort="9044" />
<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>
<!-- PASJava application section -->
<webApplication contextRoot="OIPACycle" location="OIPACycle.war">
<classloader delegation="parentFirst" >
<commonLibrary>
<fileset includes="*" dir="/scratch/oipa/IBM/OIPA/CYCLESIT1/lib/"/>
<fileset includes="*" dir="/scratch/oipa/IBM/OIPA/CYCLESIT1/conf/"/>
<folder dir="/scratch/oipa/IBM/OIPA/CYCLESIT1/conf"/>
<file name="/scratch/oipa/IBM/OIPA/CYCLESIT1/conf/Cycle.properties"/>
<!-- <file name="/scratch/oipa/externallibs/conf/paletteconfig/conf/PaletteWebApplication.properties"/> -->
</commonLibrary>
</classloader>
</webApplication>
<dataSource id="ADMINSERVERDS" jndiName="ADMINSERVERDS" transactional="false" type="javax.sql.XADataSource">
<jdbcDriver libraryRef="OracleLib"/>
<properties.oracle driverType="thin" serverName="db-host" portNumber="db-port" databaseName="db-SID" password="db-password" user="db-user"/>
</dataSource>
<dataSource id="ADMINSERVERSEARCHDS" jndiName="ADMINSERVERSEARCHDS" transactional="false" type="javax.sql.XADataSource">
<jdbcDriver libraryRef="OracleLib"/>
<properties.oracle driverType="thin" serverName="db-host" portNumber="db-port" databaseName="db-SID" password="db-password" user="db-user" />
</dataSource>
<dataSource id="ADMINSERVERREADONLYDS" jndiName="ADMINSERVERREADONLYDS" transactional="false" type="javax.sql.XADataSource">
<jdbcDriver libraryRef="OracleLib"/>
<properties.oracle driverType="thin" serverName="db-host" portNumber="db-port" databaseName="db-SID" password="db-password" user="db-user" />
</dataSource>
<dataSource id="ADMINSERVERRESOURCEDS" jndiName="ADMINSERVERRESOURCEDS" transactional="false" type="javax.sql.XADataSource">
<jdbcDriver libraryRef="OracleLib"/>
<properties.oracle driverType="thin" serverName="db-host" portNumber="db-port" databaseName="db-SID" password="db-password" user="db-user" />
</dataSource>
<!-- JMS configurations -->
<messagingEngine>
<alias id="DMPJMSServer"/>
<queue id="DownstreamMessagePushQueue"
forceReliability="ReliablePersistent"
maxMessageDepth="5000">
</queue>
<fileStore id="fileStore" logFileSize="20" fileStoreSize="400"/>
</messagingEngine>
<jmsQueueConnectionFactory jndiName="DownstreamMessagePushConnectionFactory" connectionManagerRef="ConnectionManager">
<properties.wasJms
busName="DMPJMSServer"
nonPersistentMapping="ExpressNonPersistent"
persistentMapping="ReliablePersistent"
readAhead="Default"/>
</jmsQueueConnectionFactory>
<connectionManager id="ConnectionManager" maxPoolSize="50"/>
<jmsQueue jndiName="DownstreamMessagePushQueue">
<properties.wasJms queueName="DownstreamMessagePushQueue"
deliveryMode="Application"
timeToLive="500000"
priority="1"
readAhead="AsConnection" />
</jmsQueue>
<!-- JMS configurations -->
<!-- <messagingEngine>
<alias id="DataIntakeJMSServer"/>
<queue id="DIQueue"
forceReliability="ReliablePersistent"
maxMessageDepth="5000">
</queue>
<fileStore id="fileStore" logFileSize="20" fileStoreSize="400"/>
</messagingEngine>
<jmsQueueConnectionFactory jndiName="IntakeConnectionFactory" connectionManagerRef="ConnectionManager">
<properties.wasJms
busName="DataIntakeJMSServer"
nonPersistentMapping="ExpressNonPersistent"
persistentMapping="ReliablePersistent"
readAhead="Default"/>
</jmsQueueConnectionFactory>
<connectionManager id="ConnectionManager" maxPoolSize="50"/>
<jmsQueue jndiName="DIQueue">
<properties.wasJms queueName="DIQueue"
deliveryMode="Application"
timeToLive="500000"
priority="1"
readAhead="AsConnection" />
</jmsQueue> -->
<resourceAdapter id="activemq" location="${shared.resource.dir}/activemq-rar-5.16.3.rar">
<properties.activemq BrokerXmlConfig="broker:(tcp://localhost:portNumber)" />
</resourceAdapter>
<jmsActivationSpec id="ConnectionSpec">
<properties.activemq destinationRef="DIQueue" destinationType="javax.jms.Queue" />
</jmsActivationSpec>
<jmsQueueConnectionFactory jndiName="IntakeConnectionFactory" />
<jmsQueue id="DIQueue" jndiName="CycleDIQueue">
<properties.activemq PhysicalName="DIQueue" />
</jmsQueue>
<library id="OracleLib">
<file name="/scratch/oipa/IBM/OIPA/ADMINCONSOLE/lib/ojdbc11-21.3.0.0.jar"/>
</library>
<!--logging hideMessage="SRVE9967W" -->
</server>
Note: Use the above 'server.xml' file for your reference purpose only. Rename the filename to 'server.xml' before using it.
Note: These instructions assume that a fresh installation of the application server was performed. All configuration settings must use the default settings unless otherwise noted. If the application server has been used for previous deployments, you may want to create a new application server specifically for the deployment of the CYCLE environment.
JVM Settings
-
Navigate to /path/to/ibm-liberty/IBM/WebSphere/Liberty/usr/servers/CYCLE
-
Create a filename with 'jvm.options' and append the below content.
Note: Copy the text below to a text editor and make the necessary changes there, then copy and paste it into the file above.
-javaagent:/path/to/the/externallibs/spring-instrument-5.3.30.jar
-Dtangosol.coherence.override=/path/to/the/externallibs/conf/cycle/cycle-coherence-config.xml
-Dtangosol.coherence.cacheconfig=/path/to/the/externallibs/conf/cycle/cycle-coherence-cache-config.xml
-Dtangosol.pof.config=com-adminserver-pas-web-pof-config.xml
-Dtangosol.coherence.mode=prod
-Djava.util.logging.config.file="/path/to/the/externallibs/conf/cycle/logging.properties"
-Dtangosol.coherence.distributed.localstorage=true
-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=8866
#-agentlib:jdwp=transport=dt_socket,server=y,address=<FQDN>:5188
Note: In case of server debug, uncomment the "-agentlib:jdwp" parameter from the jvm.properties file.
Configure the Listening Port
Refer to the above-attached CYCLE's 'server.xml' file for the ListenPort configurations under the 'httpEndpoint' section.
Configure the Data Sources
Refer to the above-attached CYCLE's 'server.xml' file for the Datasource configurations under the 'datasource' section.
Configure JMS Connection Queue Factory
Refer to the above-attached CYCLE's 'server.xml' file for the JMS configurations under the 'jmsQueueConnectionFactory' section.
Configure JMS Queue
-
Refer to the above-attached CYCLE's 'server.xml' file for the JMS configurations under the 'jmsQueue' section.
-
JMS queues can be accessed with in the context only hence for external commnunication need to have some 3rd party Message Broker i.e. ActiveMQ.
Follow the steps to set-up ActiveMQ:
-
Download ActiveMQ rar file version (5.16.3) from https://repo1.maven.org/maven2/org/apache/activemq/activemq-rar/5.16.3/activemq-rar-5.16.3.rar
-
Keep this downloaded rar file at shared resource directory of liberty server.
-
Shared Lib directory location for Liberty is ${liberty_HOME}/usr/shared/resources For example: /IBM/WebSphere/Liberty/usr/shared/resources
-
Download commons-pool2 jar (version 2.6.1) from https://repo1.maven.org/maven2/org/apache/commons/commons-pool2/2.6.1/commons-pool2-2.6.1.jar
-
Keep the jar in global directory ${Liberty_home}/usr/shared/config/lib/global. For example: /scratch/oipa/IBM/WebSphere/Liberty/usr/shared/config/lib/global
-
Add new feature to the existing server.xml: <feature>jms-2.0</feature>
-
Change the classloader delegation from "parentLast" to "ParentFirst"
-
Add resource adaptor in server.xml as below:
<resourceAdapter id="activemq" location="${shared.resource.dir}/activemq-rar-5.16.3.rar">
<properties.activemq BrokerXmlConfig="broker:(tcp://<Machine_Host_Name>:<PORT>)" />
</resourceAdapter>
-
Configure queue for communication as below:
<jmsActivationSpec id="ConnectionSpec">
<properties.activemq destinationRef="DIQueue" destinationType="javax.jms.Queue" />
</jmsActivationSpec>
<jmsQueueConnectionFactory jndiName="IntakeConnectionFactory" />
<jmsQueue id="DIQueue" jndiName="CycleDIQueue">
<properties.activemq PhysicalName="DIQueue" />
</jmsQueue>
Note: DI will be able to communicate on the mentioned port, default port to communicate is 61616.
Change in Data Intake client utility (pas.di.testclient)
-
Modify conf/CycleClient.properties file in pas.di.testclient with following changes
-
Uncomment context factory and comment other context factories
-
contextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory
-
-
provider.url=tcp://localhost:61616(provide appropriate url ex: Cycle url)
Note: If JMeter is used for testing the DI, then the parameters like Queue name must be appended with 'dynamicQueues/'
For example:Destination in JMeter should be "dynamicQueues/DIQueue"
The below mentioned jars should be provided on the client side lib directory.
-
activemq-client.jar (5.16.3)
-
And dependent jars (geronimo-j2ee-management_1.1_spec-1.0.1.jar , geronimo-jms_1.1_spec-1.1.1.jar, hawtbuf-1.11.jar, slf4j-api-1.7.31.jar).