87 lines
3.5 KiB
Plaintext
87 lines
3.5 KiB
Plaintext
[#ftl attributes={"generated.type":"blueprint"}]
|
|
[#--
|
|
|
|
~~~~~~licensing~~~~~~
|
|
amqp-adapter
|
|
==========
|
|
Copyright (C) 2020 - 2023 EmDev LLC
|
|
==========
|
|
You may not use this file except in accordance with the License Terms of
|
|
the Copyright
|
|
Holder located at: https://entaxy.ru/eula . All copyrights, all
|
|
intellectual property
|
|
rights to the Software and any copies are the property of the Copyright
|
|
Holder. Unless
|
|
it is explicitly allowed the Copyright Holder, the User is prohibited
|
|
from using the
|
|
Software for commercial purposes to provide services to third parties.
|
|
|
|
The Copyright Holder hereby declares that the Software is provided on an
|
|
"AS IS".
|
|
Under no circumstances does the Copyright Holder guarantee or promise
|
|
that the
|
|
Software provided by him will be suitable or not suitable for the
|
|
specific purposes
|
|
of the User, that the Software will meet all commercial and personal
|
|
subjective
|
|
expectations of the User, that the Software will work properly, without
|
|
technical
|
|
errors, quickly and uninterruptedly.
|
|
|
|
Under no circumstances shall the Copyright Holder or its Affiliates is
|
|
not liable
|
|
to the User for any direct or indirect losses of the User, his expenses
|
|
or actual
|
|
damage, including, downtime; loss of bussines; lost profit; lost
|
|
earnings; loss
|
|
or damage to data, property, etc.
|
|
~~~~~~/licensing~~~~~~
|
|
|
|
--]
|
|
[#assign factoryProperties = ["url", "username", "password"]]
|
|
[#function exceptFactoryProperties(propertyName)]
|
|
[#return !factoryProperties?seq_contains(propertyName)]
|
|
[/#function]
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
|
|
xsi:schemaLocation="
|
|
http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"
|
|
>
|
|
|
|
<cm:property-placeholder persistent-id="[=connection.configurationPid]"
|
|
update-strategy="reload">
|
|
[#if connection.properties??]
|
|
<cm:default-properties>
|
|
[#list connection.properties as key, value]
|
|
<cm:property name="[=connection.configurationPid].[=key]" value="[=value]"/>
|
|
[/#list]
|
|
</cm:default-properties>
|
|
[/#if]
|
|
</cm:property-placeholder>
|
|
|
|
<service interface="org.apache.camel.Component" ref="[=connection.name]">
|
|
<service-properties>
|
|
<entry key="connection.name" value="[=connection.name]"/>
|
|
</service-properties>
|
|
</service>
|
|
|
|
<bean id="[=connection.name]" class="org.apache.camel.component.amqp.AMQPComponent">
|
|
[#-- //TODO change template for property reference usage instead of text value --]
|
|
<property name="connectionFactory" ref="connectionFactory"/>
|
|
[#if connection.properties??]
|
|
[#list connection.properties?keys?filter(exceptFactoryProperties) as key]
|
|
<property name="[=key]" value="[='$']{[=connection.configurationPid].[=key]}"/>
|
|
[/#list]
|
|
[/#if]
|
|
</bean>
|
|
|
|
<bean id="connectionFactory" class="org.apache.qpid.jms.JmsConnectionFactory">
|
|
<argument index="0" value="[='$']{[=connection.configurationPid].username}"/>
|
|
<argument index="1" value="[='$']{[=connection.configurationPid].password}"/>
|
|
<argument index="2" value="[='$']{[=connection.configurationPid].url}"/>
|
|
</bean>
|
|
|
|
</blueprint>
|