| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one or more |
| ~ contributor license agreements. See the NOTICE file distributed with |
| ~ this work for additional information regarding copyright ownership. |
| ~ The ASF licenses this file to You under the Apache License, Version 2.0 |
| ~ (the "License"); you may not use this file except in compliance with |
| ~ the License. You may obtain a copy of the License at |
| ~ |
| ~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~ |
| ~ Unless required by applicable law or agreed to in writing, software |
| ~ distributed under the License is distributed on an "AS IS" BASIS, |
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| ~ See the License for the specific language governing permissions and |
| ~ limitations under the License. |
| --> |
| <blueprint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" |
| xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" |
| xmlns:camel="http://camel.apache.org/schema/blueprint" |
| xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd |
| http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd |
| http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd"> |
| |
| <cm:property-placeholder persistent-id="org.apache.unomi.router" update-strategy="reload"> |
| <cm:default-properties> |
| <cm:property name="config.type" value="nobroker"/> |
| <cm:property name="config.allowedEndpoints" value="file,ftp"/> |
| <cm:property name="config.internalPort" value="8233"/> |
| <cm:property name="kafka.host" value="localhost"/> |
| <cm:property name="kafka.port" value="9092"/> |
| <cm:property name="kafka.import.topic" value="camel-deposit"/> |
| <cm:property name="kafka.import.groupId" value="unomi-import-group"/> |
| <cm:property name="kafka.import.consumerCount" value="10"/> |
| <cm:property name="kafka.import.autoCommit" value="true"/> |
| <cm:property name="import.oneshot.uploadDir" value="/tmp/oneshot_import_configs/"/> |
| <cm:property name="import.executionsHistory.size" value="5"/> |
| </cm:default-properties> |
| </cm:property-placeholder> |
| |
| <bean id="unomiStorageProcessor" class="org.apache.unomi.router.core.processor.UnomiStorageProcessor"> |
| <property name="profileImportService" ref="profileImportService"/> |
| </bean> |
| |
| <bean id="routeCompletionProcessor" class="org.apache.unomi.router.core.processor.RouteCompletionProcessor"> |
| <property name="importConfigurationService" ref="importConfigurationService"/> |
| <property name="executionsHistorySize" value="${import.executionsHistory.size}"/> |
| </bean> |
| |
| <bean id="importConfigByFileNameProcessor" class="org.apache.unomi.router.core.processor.ImportConfigByFileNameProcessor"> |
| <property name="importConfigurationService" ref="importConfigurationService"/> |
| </bean> |
| |
| <bean id="jacksonDataFormat" class="org.apache.camel.component.jackson.JacksonDataFormat"> |
| <property name="unmarshalType" value="org.apache.unomi.router.api.ProfileToImport"/> |
| </bean> |
| |
| <bean id="jacksonDataFormatImportConfig" class="org.apache.camel.model.dataformat.JsonDataFormat"> |
| <property name="unmarshalType" value="org.apache.unomi.router.api.ImportConfiguration"/> |
| <property name="library" value="Jackson"/> |
| </bean> |
| |
| <bean id="jacksonDataFormatExportConfig" class="org.apache.camel.model.dataformat.JsonDataFormat"> |
| <property name="unmarshalType" value="org.apache.unomi.router.api.ExportConfiguration"/> |
| <property name="library" value="Jackson"/> |
| </bean> |
| |
| <bean id="jacksonDataFormatImportLineError" class="org.apache.camel.model.dataformat.JsonDataFormat"> |
| <property name="unmarshalType" value="org.apache.unomi.router.api.ImportLineError"/> |
| <property name="library" value="Jackson"/> |
| </bean> |
| |
| <bean class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer" |
| init-method="register" |
| destroy-method="unregister"> |
| <property name="alias" value="/configUpdate"/> |
| <property name="httpService" ref="httpService"/> |
| <property name="servlet" ref="camelServlet"/> |
| </bean> |
| |
| <bean id="camelServlet" class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/> |
| |
| |
| <bean id="camelContext" class="org.apache.unomi.router.core.context.RouterCamelContext" |
| init-method="initCamelContext" destroy-method="preDestroy"> |
| <property name="configType" value="${config.type}"/> |
| <property name="allowedEndpoints" value="${config.allowedEndpoints}"/> |
| <property name="kafkaProps"> |
| <map> |
| <entry key="kafkaHost" value="${kafka.host}"/> |
| <entry key="kafkaPort" value="${kafka.port}"/> |
| <entry key="kafkaImportTopic" value="${kafka.import.topic}"/> |
| <entry key="kafkaImportGroupId" value="${kafka.import.groupId}"/> |
| <entry key="kafkaImportConsumerCount" value="${kafka.import.consumerCount}"/> |
| <entry key="kafkaImportAutoCommit" value="${kafka.import.autoCommit}"/> |
| </map> |
| </property> |
| <property name="uploadDir" value="${import.oneshot.uploadDir}"/> |
| <property name="unomiStorageProcessor" ref="unomiStorageProcessor"/> |
| <property name="routeCompletionProcessor" ref="routeCompletionProcessor"/> |
| <property name="importConfigByFileNameProcessor" ref="importConfigByFileNameProcessor"/> |
| <property name="importConfigurationService" ref="importConfigurationService"/> |
| <property name="exportConfigurationService" ref="exportConfigurationService"/> |
| <property name="persistenceService" ref="persistenceService"/> |
| <property name="jacksonDataFormat" ref="jacksonDataFormat"/> |
| <property name="bundleContext" ref="blueprintBundleContext"/> |
| <property name="configSharingService" ref="configSharingService" /> |
| </bean> |
| |
| <camel:camelContext id="httpEndpoint" xmlns="http://camel.apache.org/schema/blueprint"> |
| <camel:routeBuilder ref="configUpdateRouteBuilder" /> |
| </camel:camelContext> |
| |
| <bean id="configUpdateRouteBuilder" class="org.apache.unomi.router.core.route.ConfigUpdateRouteBuilder"> |
| <property name="routerCamelContext" ref="camelContext"/> |
| </bean> |
| |
| <reference id="configSharingService" interface="org.apache.unomi.api.services.ConfigSharingService" /> |
| <reference id="httpService" interface="org.osgi.service.http.HttpService"/> |
| <reference id="profileImportService" interface="org.apache.unomi.router.api.services.ProfileImportService"/> |
| <reference id="persistenceService" interface="org.apache.unomi.persistence.spi.PersistenceService"/> |
| <reference id="importConfigurationService" interface="org.apache.unomi.router.api.services.ImportExportConfigurationService" filter="(configDiscriminator=IMPORT)"/> |
| <reference id="exportConfigurationService" interface="org.apache.unomi.router.api.services.ImportExportConfigurationService" filter="(configDiscriminator=EXPORT)"/> |
| |
| </blueprint> |