399 lines
18 KiB
XML
399 lines
18 KiB
XML
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xmlns:util="http://www.springframework.org/schema/util"
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
|
http://camel.apache.org/schema/spring
|
|
http://camel.apache.org/schema/spring/camel-spring.xsd
|
|
http://www.springframework.org/schema/util
|
|
http://www.springframework.org/schema/util/spring-util.xsd">
|
|
|
|
<bean id="jmsClientId" class="com.raytheon.uf.common.util.SystemUtil" factory-method="getClientID">
|
|
<constructor-arg value="${edex.run.mode}" />
|
|
</bean>
|
|
|
|
<bean id="jmsConnectionInfo"
|
|
class="com.raytheon.uf.common.jms.JMSConnectionInfo">
|
|
<constructor-arg value="${BROKER_HOST}"/>
|
|
<constructor-arg value="${BROKER_PORT}"/>
|
|
<constructor-arg value="${JMS_VIRTUALHOST}"/>
|
|
<constructor-arg value="${BROKER_HTTP}"/>
|
|
<constructor-arg>
|
|
<map>
|
|
<entry key="jms.prefetchPolicy.all" value="0"/>
|
|
<entry key="provider.futureType" value="balanced"/>
|
|
<entry key="jms.clientID" value-ref="jmsClientId"/>
|
|
</map>
|
|
</constructor-arg>
|
|
</bean>
|
|
|
|
<bean id="qpidUfConnectionFactory" class="com.raytheon.uf.common.jms.qpid.QpidUFConnectionFactory">
|
|
<constructor-arg ref="jmsConnectionInfo"/>
|
|
</bean>
|
|
|
|
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
|
<constructor-arg ref="qpidUfConnectionFactory"/>
|
|
<!-- The value of 50 is arbitrary. Can be tweaked later based on
|
|
observed frequency of session creation -->
|
|
<property name="sessionCacheSize" value="50"/>
|
|
</bean>
|
|
|
|
<bean id="genericThreadPool"
|
|
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
<property name="corePoolSize" value="0" />
|
|
<property name="maxPoolSize" value="1" />
|
|
<property name="queueCapacity" value="0" />
|
|
</bean>
|
|
|
|
<bean id="jms-generic" class="com.raytheon.uf.edex.esb.camel.jms.DedicatedThreadJmsComponent">
|
|
<constructor-arg ref="jmsGenericConfig" />
|
|
<property name="taskExecutor" ref="genericThreadPool" />
|
|
</bean>
|
|
|
|
<bean id="jms-durable" class="com.raytheon.uf.edex.esb.camel.jms.DedicatedThreadJmsComponent">
|
|
<constructor-arg ref="jmsDurableConfig" />
|
|
<property name="taskExecutor" ref="genericThreadPool" />
|
|
</bean>
|
|
|
|
<bean id="jmsGenericConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
factory-bean="jmsConfig" factory-method="copy">
|
|
</bean>
|
|
|
|
<bean id="jmsDurableConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
factory-bean="jmsConfig" factory-method="copy">
|
|
<property name="deliveryPersistent" value="true"/>
|
|
</bean>
|
|
|
|
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
|
|
<property name="cacheLevelName" value="CACHE_CONSUMER"/>
|
|
<property name="recoveryInterval" value="10000"/>
|
|
<property name="requestTimeout" value="5000"/>
|
|
<!-- If this is false, while stopping we will reject messages that have already been pulled from qpid, essentially losing the message -->
|
|
<property name="acceptMessagesWhileStopping" value="true"/>
|
|
|
|
<!-- receiveTimeout is amount of time thread waits to receive a message before recycling -->
|
|
<!-- receiveTimeout also affects how fast a JMSConsumer will shut down, because the
|
|
thread may be stuck polling for the duration of receiveTimeout before shutting down -->
|
|
<property name="receiveTimeout" value="5000"/>
|
|
<property name="transacted" value="false"/>
|
|
|
|
<!-- force maxMessagesPerTask so that the threads don't keep disconnecting and reconnecting.
|
|
This will keep a data-type attached to the initial thread it starts on -->
|
|
<property name="maxMessagesPerTask" value="-1"/>
|
|
<property name="listenerConnectionFactory" ref="jmsConnectionFactory" />
|
|
<property name="templateConnectionFactory" ref="jmsConnectionFactory" />
|
|
<property name="disableReplyTo" value="true" />
|
|
<property name="deliveryPersistent" value="false"/>
|
|
|
|
<!--
|
|
<property name="transacted" value="true" />
|
|
<property name="acknowledgementModeName" value="TRANSACTED"/>
|
|
<property name="transactionManager" ref="jmsReceiveTransactionManager" />
|
|
-->
|
|
</bean>
|
|
|
|
<!--
|
|
<bean id="jmsReceiveTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
|
|
<property name="connectionFactory" ref="amqConnectionFactory" />
|
|
</bean>
|
|
|
|
<bean id="PROPAGATION_REQUIRED" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
|
|
<property name="transactionManager" ref="jmsReceiveTransactionManager" />
|
|
<property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/>
|
|
</bean>
|
|
-->
|
|
|
|
|
|
<bean id="appInfo" class="com.raytheon.uf.common.util.app.AppInfo" factory-method="initialize">
|
|
<constructor-arg value="EDEX"/>
|
|
<constructor-arg value="${EDEX_VERSION}"/>
|
|
<constructor-arg value="${edex.run.mode}"/>
|
|
</bean>
|
|
|
|
<bean id="httpClientConfigBuilder" class="com.raytheon.uf.common.comm.HttpClientConfigBuilder">
|
|
<property name="maxConnections" value="${PYPIES_MAX_CONN}"/>
|
|
<!-- value in milliseconds to allow socket to timeout, don't allow this to be zero, bad things could happen -->
|
|
<property name="socketTimeout" value="180000"/>
|
|
</bean>
|
|
|
|
<bean id="httpClientConfig" factory-bean="httpClientConfigBuilder" factory-method="build"/>
|
|
|
|
<bean id="httpClient" class="com.raytheon.uf.common.comm.HttpClient" factory-method="configureGlobalInstance" depends-on="appInfo">
|
|
<constructor-arg ref="httpClientConfig"/>
|
|
</bean>
|
|
|
|
<bean id="initialcorePropertyConfigurer"
|
|
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
|
<property name="systemPropertiesModeName">
|
|
<value>SYSTEM_PROPERTIES_MODE_OVERRIDE</value>
|
|
</property>
|
|
<property name="searchSystemEnvironment">
|
|
<value type="boolean">true</value>
|
|
</property>
|
|
<property name="ignoreUnresolvablePlaceholders" value="true">
|
|
</property>
|
|
</bean>
|
|
|
|
<bean id="fileToString" class="com.raytheon.uf.edex.esb.camel.FileToString"/>
|
|
<bean id="processUtil" class="com.raytheon.uf.edex.esb.camel.ProcessUtil"/>
|
|
<bean id="setIngestHeaderFields" class="com.raytheon.uf.edex.esb.camel.SetIngestHeaderFields"/>
|
|
<bean id="messageProducer" class="com.raytheon.uf.edex.esb.camel.MessageProducer" />
|
|
<bean id="camelContextAdmin" class="com.raytheon.uf.edex.esb.camel.CamelContextAdmin" />
|
|
|
|
<!-- ContextManager to manage dependencies so routes startup in right order.
|
|
Clustered routes will start on a box if there has not been a lock for that route in the last 60 seconds.
|
|
Anyone using the clustered routes should ensure that timeToLive on jms messages are at least 1 minute-->
|
|
<bean id="contextManager"
|
|
class="com.raytheon.uf.edex.esb.camel.context.ContextManager"
|
|
factory-method="getInstance">
|
|
<property name="timeOutMillis" value="60000"/>
|
|
</bean>
|
|
|
|
<bean id="util" class="com.raytheon.uf.edex.core.EDEXUtil">
|
|
<property name="messageProducer" ref="messageProducer" />
|
|
<property name="contextAdmin" ref="camelContextAdmin" />
|
|
</bean>
|
|
|
|
<bean id="defaultPathProvider" class="com.raytheon.uf.common.dataplugin.persist.DefaultPathProvider"/>
|
|
|
|
<bean id="commonDbPluginProperties" class="com.raytheon.uf.edex.database.DatabasePluginProperties">
|
|
<property name="pluginFQN" value="com.raytheon.uf.edex.database" />
|
|
<property name="database" value="metadata" />
|
|
<property name="forceCheck" value="true" />
|
|
</bean>
|
|
|
|
<bean id="mapsDbPluginProperties" class="com.raytheon.uf.edex.database.DatabasePluginProperties">
|
|
<property name="pluginFQN" value="com.raytheon.uf.edex.database" />
|
|
<property name="database" value="maps" />
|
|
<property name="forceCheck" value="true" />
|
|
</bean>
|
|
|
|
<!--
|
|
The DatabasePluginRegistry is used to create tables in
|
|
a database beyond the auto-detected table for each dataplugin.
|
|
|
|
It needs to depend on a few transaction managers and util because some
|
|
EDEX code uses EdexUtil to get a database session factory. The
|
|
database session factory should not be used before the corresponding
|
|
database transaction manager is initialized, but we cannot explicitly
|
|
make a session factory depend on its transaction manager as that would
|
|
cause a circular dependency. Long story short, the depends-on here
|
|
ensures the metadata and maps database session factories cannot be
|
|
used before their transaction managers are ready.
|
|
-->
|
|
<bean
|
|
id="dbPluginRegistry"
|
|
class="com.raytheon.uf.edex.database.DatabasePluginRegistry"
|
|
factory-method="getInstance"
|
|
init-method="init"
|
|
depends-on="metadataTxManager,admin_metadataTxManager,mapsTxManager,admin_mapsTxManager,util">
|
|
<property name="initialListeners">
|
|
<list>
|
|
<!-- This causes database tables to be initialized when a db plugin is registered -->
|
|
<bean class="com.raytheon.uf.edex.database.plugin.SchemaManager" factory-method="getInstance"/>
|
|
</list>
|
|
</property>
|
|
<property name="initialProperties">
|
|
<list>
|
|
<!-- Creates the initial tables so other plugins can be loaded -->
|
|
<ref bean="commonDbPluginProperties"/>
|
|
</list>
|
|
</property>
|
|
</bean>
|
|
|
|
<bean id="mapsDbRegistered" factory-bean="dbPluginRegistry" factory-method="register">
|
|
<constructor-arg value="com.raytheon.uf.edex.database.maps" />
|
|
<constructor-arg ref="mapsDbPluginProperties" />
|
|
</bean>
|
|
|
|
<!-- The pluginDefaults are the values that a data plugin will use for
|
|
some plugin properties if they are not specified in the individual
|
|
plugin's Spring XML configuration -->
|
|
<bean id="pluginDefaults" class="com.raytheon.uf.common.dataplugin.PluginProperties">
|
|
<property name="database" value="metadata" />
|
|
<property name="initializer" value="com.raytheon.edex.plugin.DefaultPluginInitializer" />
|
|
<property name="dao" value="com.raytheon.edex.db.dao.DefaultPluginDao" />
|
|
<property name="initialRetentionTime" value="24" />
|
|
<property name="pathProvider" ref="defaultPathProvider"/>
|
|
</bean>
|
|
|
|
<bean
|
|
id="pluginRegistry"
|
|
class="com.raytheon.uf.edex.core.dataplugin.PluginRegistry"
|
|
factory-method="getInstance"
|
|
depends-on="util, dataStoreFactory">
|
|
<property name="defaultPluginProperties" ref="pluginDefaults"/>
|
|
<property name="initialListeners">
|
|
<list>
|
|
<!-- This causes the data plugin's database tables to be created when a plugin is registered -->
|
|
<ref bean="dbPluginRegistry"/>
|
|
<!-- This causes the data plugin's initializer to get called when a plugin is registered -->
|
|
<bean class="com.raytheon.edex.plugin.PluginInitialSetup"/>
|
|
</list>
|
|
</property>
|
|
</bean>
|
|
|
|
<bean id="stringToFile" class="com.raytheon.uf.edex.esb.camel.StringToFile"/>
|
|
<bean id="dataUnzipper" class="com.raytheon.uf.common.util.DataUnzipper"/>
|
|
|
|
<bean id="errorHandlerRedeliveryPolicy" class="org.apache.camel.processor.errorhandler.RedeliveryPolicy">
|
|
<!-- This policy matches that of the old LoggingErrorHandlerBuilder
|
|
class we used to use. (That class is gone now that we have moved
|
|
to Camel 3.) -->
|
|
<property name="logRetryAttempted" value="false" />
|
|
</bean>
|
|
|
|
<bean id="errorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
|
|
<property name="deadLetterUri" value="log:edex?level=ERROR" />
|
|
<property name="redeliveryPolicy" ref="errorHandlerRedeliveryPolicy" />
|
|
</bean>
|
|
|
|
<!-- sets default settings of log component across all of edex -->
|
|
<!-- if log component beans are created and the exchangeFormatter property is set, they can't process URI parameters -->
|
|
<!-- this bean needs to be named 'logFormatter' for the log component to find it in the context -->
|
|
<bean id="logFormatter" class="org.apache.camel.support.processor.DefaultExchangeFormatter" scope="prototype">
|
|
<property name="maxChars" value="0" />
|
|
<property name="showBody" value="false" />
|
|
<property name="showCaughtException" value="true" />
|
|
<property name="showStackTrace" value="true" />
|
|
</bean>
|
|
|
|
<bean id="serializationUtil" class="com.raytheon.uf.common.serialization.SerializationUtil" />
|
|
|
|
<bean id="CamelBeanParameterMappingStrategy"
|
|
class="com.raytheon.uf.edex.esb.camel.EDEXParameterMappingStrategy" />
|
|
|
|
<!-- Serialization Pool -->
|
|
<bean id="baosPool" class="com.raytheon.uf.common.util.ByteArrayOutputStreamPool" factory-method="getInstance">
|
|
<property name="maxPoolSize" value="${SERIALIZE_POOL_MAX_SIZE}"/>
|
|
<property name="initStreamSize" value="${SERIALIZE_STREAM_INIT_SIZE_MB}"/>
|
|
<property name="maxStreamSize" value="${SERIALIZE_STREAM_MAX_SIZE_MB}"/>
|
|
</bean>
|
|
|
|
<bean id="edexLocalizationObserver" class="com.raytheon.edex.utility.EDEXLocalizationNotificationObserver" factory-method="getInstance"/>
|
|
|
|
<bean id="clusterLockManager" class="com.raytheon.uf.edex.database.cluster.lock.EdexClusterDbLockMgr"
|
|
depends-on="metadataTxManager">
|
|
<constructor-arg ref="appInfo" />
|
|
<constructor-arg value="metadata" />
|
|
<constructor-arg value="100" />
|
|
<constructor-arg value="30000" />
|
|
</bean>
|
|
|
|
<!--
|
|
** Lets deploy some Enterprise Integration Patterns inside Camel
|
|
** For more details see
|
|
**
|
|
** http://camel.apache.org/enterprise-integration-patterns.html
|
|
-->
|
|
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
|
|
|
|
<!-- Route for edex to listen for utility updates -->
|
|
<route id="edexUtilityNotify">
|
|
<from uri="jms-generic:topic:edex.alerts.utility" />
|
|
<bean ref="edexLocalizationObserver" method="fileUpdated"/>
|
|
</route>
|
|
|
|
<!-- Route to send alerts to alertviz -->
|
|
<route id="alertVizNotify">
|
|
<from uri="vm:edex.alertVizNotification" />
|
|
<bean ref="serializationUtil" method="transformToThrift" />
|
|
<to uri="jms-generic:topic:edex.alerts.msg" />
|
|
</route>
|
|
|
|
<!-- Route to send text products to alarm/alert -->
|
|
<route id="alarmAlertNotify">
|
|
<from uri="vm:edex.alarmAlertNotification" />
|
|
<bean ref="serializationUtil" method="transformToThrift" />
|
|
<to uri="jms-generic:topic:edex.alarms.msg" />
|
|
</route>
|
|
|
|
</camelContext>
|
|
<camelContext
|
|
id="clusteredCamel"
|
|
xmlns="http://camel.apache.org/schema/spring"
|
|
errorHandlerRef="errorHandler">
|
|
<route id="monitorClusteredContexts">
|
|
<from uri="timer://monitorClusterContexts?fixedRate=true&period=20000"/>
|
|
<doTry>
|
|
<bean ref="contextManager" method="checkClusteredContexts" />
|
|
<doCatch>
|
|
<exception>java.lang.Throwable</exception>
|
|
<to uri="log:monitorClusteredContexts?level=ERROR"/>
|
|
</doCatch>
|
|
</doTry>
|
|
</route>
|
|
</camelContext>
|
|
|
|
<!-- Redirect geotools log -->
|
|
<bean class="com.raytheon.uf.common.geospatial.LogRedirector" factory-method="setGeotoolsLogFactory">
|
|
<constructor-arg value="org.geotools.util.logging.Log4JLoggerFactory" />
|
|
</bean>
|
|
|
|
<bean id="spatialQueryFactory" class="com.raytheon.uf.common.geospatial.SpatialQueryFactory"
|
|
factory-method="setImplementation">
|
|
<constructor-arg value="com.raytheon.edex.common.SpatialDbQuery"/>
|
|
</bean>
|
|
|
|
<!-- Holds the registry of IServerRequest classnames to IRequestHandlers -->
|
|
<bean id="handlerRegistry" class="com.raytheon.uf.edex.requestsrv.HandlerRegistry"
|
|
factory-method="getInstance" />
|
|
|
|
<!-- Auto detect entries for the handlerRegistry -->
|
|
<bean class="com.raytheon.uf.edex.requestsrv.RequestHandlerAutoDetector">
|
|
<constructor-arg ref="handlerRegistry" />
|
|
</bean>
|
|
|
|
|
|
<!-- Holds the registry of request routers by server key -->
|
|
<bean id="requestRouterRegistry"
|
|
class="com.raytheon.uf.common.serialization.comm.RequestRouter"
|
|
factory-method="getRouterRegistry" />
|
|
|
|
<!-- Server Request routers -->
|
|
<bean id="serverPrivilegedRequestHandler"
|
|
class="com.raytheon.uf.edex.requestsrv.request.ServerPrivilegedRequestHandler">
|
|
<constructor-arg ref="handlerRegistry" />
|
|
</bean>
|
|
|
|
<bean factory-bean="handlerRegistry" factory-method="register">
|
|
<constructor-arg
|
|
value="com.raytheon.uf.edex.requestsrv.request.ServerPrivilegedRequestHandler.ServerPrivilegedRequest" />
|
|
<constructor-arg ref="serverPrivilegedRequestHandler" />
|
|
</bean>
|
|
|
|
<util:constant id="requestServerKey"
|
|
static-field="com.raytheon.uf.common.auth.RequestConstants.REQUEST_SERVER" />
|
|
|
|
<bean id="requestServiceRouter" class="com.raytheon.uf.edex.requestsrv.router.ServerRequestRouter">
|
|
<!-- This bean will cause all RequestRouter.route(request) calls
|
|
to be processed internally to EDEX -->
|
|
</bean>
|
|
|
|
<bean id="registerRequestServiceRouter" factory-bean="requestRouterRegistry"
|
|
factory-method="register">
|
|
<constructor-arg ref="requestServerKey" />
|
|
<constructor-arg ref="requestServiceRouter" />
|
|
</bean>
|
|
|
|
<!-- quartz component configuration.
|
|
Single scheduler used by all endpoints so there is only one threadpool.
|
|
Thread pool configured in edex/config/resources/quartz.properties.
|
|
Requires work around in ContextManager.postProcessBeanFactory when JMX is disabled -->
|
|
<bean id="quartzSchedulerFactory" class="org.quartz.impl.StdSchedulerFactory">
|
|
<constructor-arg value="quartz.properties" />
|
|
</bean>
|
|
|
|
<bean id="quartzScheduler" factory-bean="quartzSchedulerFactory"
|
|
factory-method="getScheduler" />
|
|
|
|
<bean id="quartz" class="org.apache.camel.component.quartz.QuartzComponent">
|
|
<property name="scheduler" ref="quartzScheduler" />
|
|
</bean>
|
|
|
|
<bean id="clusteredquartz"
|
|
class="com.raytheon.uf.edex.esb.camel.cluster.quartz.ClusteredQuartzComponent">
|
|
<property name="scheduler" ref="quartzScheduler" />
|
|
</bean>
|
|
|
|
</beans>
|