-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblueprint-bean.xml
executable file
·106 lines (99 loc) · 5.56 KB
/
blueprint-bean.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBoss, Home of Professional Open Source
Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual
contributors by the @authors tag. See the copyright.txt in the
distribution for a full listing of individual contributors.
Licensed 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.
-->
<!--
This is the OSGi Blueprint XML file defining the Camel context and routes. Because the file is in the
OSGI-INF/blueprint directory inside our JAR, it will be automatically activated as soon as the bundle is installed.
The root element for any OSGi Blueprint file is 'blueprint' - you also see the namespace definitions for both the Blueprint
and the Camel namespaces.
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-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">
<!-- PID -->
<cm:property-placeholder id="restful-ipservice-props"
persistent-id="org.jeannyil.fuse.restful-ipservice"
placeholder-prefix="${" placeholder-suffix="}" update-strategy="reload">
<cm:default-properties>
<cm:property name="camel.name.route" value="restful-ipservice-route"/>
<cm:property name="exposed.service.gateway.host" value="fuse-standalone.lab.com"/>
<cm:property name="exposed.service.gateway.port" value="8181"/>
</cm:default-properties>
</cm:property-placeholder>
<!-- Processors -->
<bean
class="org.jeannyil.fuse.cxfrs.ipservice.processor.BuildErrorBeanProcessor" id="buildErrorBeanProcessor"/>
<bean
class="org.jeannyil.fuse.cxfrs.ipservice.processor.FreeGeoIpRequestProcessor" id="freeGeoIpRequestProcessor"/>
<bean
class="org.jeannyil.fuse.cxfrs.ipservice.processor.PrepareRestResponseProcessor" id="prepareRestResponseProcessor"/>
<bean
class="org.jeannyil.fuse.cxfrs.ipservice.processor.ValidateRequestProcessor" id="validateRequestProcessor"/>
<!-- Routes -->
<bean
class="org.jeannyil.fuse.cxfrs.ipservice.route.IpServiceCxfRsServerMainRoute" id="ipServiceCxfRsServerMainRoute"/>
<bean
class="org.jeannyil.fuse.cxfrs.ipservice.route.IpServiceGeoLocationRoute" id="ipServiceGeoLocationRoute"/>
<!-- Camel context -->
<camelContext allowUseOriginalMessage="false"
id="restful-ipservice-context" xmlns="http://camel.apache.org/schema/blueprint">
<routeBuilder ref="ipServiceCxfRsServerMainRoute"/>
<routeBuilder ref="ipServiceGeoLocationRoute"/>
</camelContext>
<!-- CxfRs endpoints -->
<cxf:rsClient id="freeGeoIpRsClient" address="http://freegeoip.net/"
serviceClass="org.jeannyil.fuse.cxfrs.ipservice.endpoint.FreeGeoIp"
loggingFeatureEnabled="true">
<cxf:providers>
<bean id="clientJsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
</cxf:providers>
</cxf:rsClient>
<cxf:rsServer id="ipRsService" address="/rest1"
serviceClass="org.jeannyil.fuse.cxfrs.ipservice.resource.IpService"
loggingFeatureEnabled="true">
<cxf:providers>
<bean id="serverJsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
</cxf:providers>
<!-- Enable Swagger -->
<cxf:features>
<bean class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
<property name="runAsFilter" value="true" />
<property name="host" value="${exposed.service.gateway.host}:${exposed.service.gateway.port}"/>
<property name="basePath" value="/cxf/rest1"/>
<property name="usePathBasedConfig" value="true" />
<property name="title" value="RESTful Service (swagger v2.0) :: IP GeoLocation Service"/>
<property name="description" value="Leverages the FreeGeoIP RESTful service in order to get the geo-location of an IP address or a hostname"/>
<property name="version" value="${project.version}"/>
<property name="contact" value="jean.nyilimbibi@redhat.com"/>
<property name="prettyPrint" value="true"/>
<property name="schemes">
<array value-type="java.lang.String">
<value>http</value>
<value>https</value>
</array>
</property>
</bean>
</cxf:features>
</cxf:rsServer>
</blueprint>