This article documents required changes to Tomcat's server.xml file as part of the meshIQ platform configuration update.
Datasource Renaming
Two existing JDBC datasource entries must be renamed to align with the new meshIQ naming convention.
| Datasource | Previous Name | New Name |
|---|---|---|
| Permits datasource | jdbc/nastel_permv3_db_ds | jdbc/meshiq_manage_db |
| Apwmq datasource | jdbc/nastel_apwmq_db_ds | jdbc/meshiq_wgs_db |
ActiveMQ Configuration Added to GlobalNamingResources
Running ActiveMQ configuration is now required directly in server.xml. The following resources must be added inside the <GlobalNamingResources> tag:
<!-- ActiveMQ connection factory -->
<Resource name="jms/FPConnectionFactory"
auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="failover:(tcp://localhost:61616?useKeepAlive=true&connectionTimeout=10000&wireFormat.maxInactivityDuration=60000&wireFormat.maxInactivityDurationInitalDelay=15000)?jms.prefetchPolicy.all=200&initialReconnectDelay=1000&maxReconnectAttempts=-1&useExponentialBackOff=true&maxReconnectDelay=30000&startupMaxReconnectAttempts=10&timeout=60000"/>
<!-- queues -->
<Resource name="jms/queue/client-requests"
auth="Container"
type="org.apache.activemq.command.ActiveMQQueue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="jkool.service.requests"/>
<Resource name="jms/queue/admin-requests"
auth="Container"
type="org.apache.activemq.command.ActiveMQQueue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="jkool.service.admin.requests"/>
<Resource name="jms/queue/update-requests"
auth="Container"
type="org.apache.activemq.command.ActiveMQQueue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="jkool.service.update.requests"/>
New Datasource Added: jdbc/meshiq_track_db
A new datasource resource has been added for the Track service. This should be added alongside the other datasource <Resource> entries in server.xml.
<Resource name="jdbc/meshiq_track_db"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/nastel_track?currentSchema=nastel_track"
username="postgres"
password="nastel"
maxActive="20"
minIdle="5"
maxIdle="10"
initialSize="5"
maxWait="10000"
testOnBorrow="true"
validationQuery="SELECT 1"
validationQueryTimeout="5"
timeBetweenEvictionRunsMillis="30000"
minEvictableIdleTimeMillis="60000"
maxAge="1800000"/>
JDBC URL Parameter Change
Updated the JDBC connection URL for the track database.
| Value | |
|---|---|
| Previous | url="jdbc:postgresql://localhost:5432/nastel_track?searchpath=nastel_track" |
| Updated | url="jdbc:postgresql://localhost:5432/nastel_track?currentSchema=nastel_track" |
Removed: Per-<Context> ActiveMQ Resources
Since ActiveMQ connection and queue resources are now defined once at the global level (GlobalNamingResources), the duplicate per-application <Resource> definitions inside individual <Context> blocks are no longer needed and should be removed.
Remove the following resource definitions from each affected <Context> block, including but not limited to /track and /ds-api:
<Context path="/track"
reloadable="true"
docBase="track.war">
<!-- Client is using ActiveMQ to communicate w/ meshIQ Data Services -->
<!-- The brokerURL host name or IP address should be that of the meshIQ Data Services (which is hosting ActiveMQ broker) -->
<Resource name="jms/FPConnectionFactory"
auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="tcp://localhost:61616?connectionTimeout=120000&wireFormat.maxInactivityDuration=300000&wireFormat.maxInactivityDurationInitalDelay=60000"/>
<!-- ActiveMQ queue on which to send requests - physicalName must match definition on meshIQ Data Services -->
<Resource name="jms/queue/client-requests"
auth="Container"
type="org.apache.activemq.command.ActiveMQQueue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="jkool.service.requests"/>
<!-- ActiveMQ queue on which to send admin requests - physicalName must match definition on meshIQ Data Services -->
<Resource name="jms/queue/admin-requests"
auth="Container"
type="org.apache.activemq.command.ActiveMQQueue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="jkool.service.admin.requests"/>
<!-- ActiveMQ queue on which to send update requests - physicalName must match definition on meshIQ Data Services -->
<Resource name="jms/queue/update-requests"
auth="Container"
type="org.apache.activemq.command.ActiveMQQueue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="jkool.service.update.requests"/>
</Context>
<Context path="/ds-api"
reloadable="true"
docBase="ds-api.war">
<!-- Client is using ActiveMQ to communicate w/ meshIQ Data Services -->
<!-- The brokerURL host name or IP address should be that of the meshIQ Data Services (which is hosting ActiveMQ broker) -->
<Resource name="jms/FPConnectionFactory"
auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="tcp://localhost:61616?connectionTimeout=120000&wireFormat.maxInactivityDuration=300000&wireFormat.maxInactivityDurationInitalDelay=60000"/>
Remove only the <Resource> elements listed above. Do not remove
the surrounding <Context> tags. The
<Context> definitions for the track.war and
ds-api.war applications are still required. Remove only the local
ActiveMQ resource override entries from these <Context> sections.