-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblueprint-bean.xml
103 lines (97 loc) · 5.49 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
<?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-service-metrics-props"
persistent-id="org.jeannyil.fuse.restful-service-metrics"
placeholder-prefix="${" placeholder-suffix="}" update-strategy="reload">
<cm:default-properties>
<cm:property name="camel.name.route" value="restful-service-metrics-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.metrics.processor.BuildErrorBeanProcessor" id="buildErrorBeanProcessor"/>
<bean
class="org.jeannyil.fuse.cxfrs.metrics.processor.GenerateRandomNumbersProcessor" id="generateRandomNumbersProcessor"/>
<bean
class="org.jeannyil.fuse.cxfrs.metrics.processor.PrepareRestResponseProcessor" id="prepareRestResponseProcessor"/>
<!-- Camel Metrics policy definition to group business metrics -->
<bean
class="org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicyFactory" id="metricsRoutePolicy">
<property name="useJmx" value="true"/>
<property name="jmxDomain" value="org.jeannyil.fuse.cxfrs.metrics"/>
<property name="prettyPrint" value="true"/>
</bean>
<!-- Routes -->
<bean
class="org.jeannyil.fuse.cxfrs.metrics.route.RestfulServiceMainRoute" id="restfulServiceMainRoute"/>
<bean
class="org.jeannyil.fuse.cxfrs.metrics.route.RestfulServiceGenerateNumbersRoute" id="restfulServiceGenerateNumbersRoute"/>
<!-- Camel context -->
<camelContext allowUseOriginalMessage="false"
id="restful-service-metrics-context" xmlns="http://camel.apache.org/schema/blueprint">
<routeBuilder ref="restfulServiceMainRoute"/>
<routeBuilder ref="restfulServiceGenerateNumbersRoute"/>
</camelContext>
<!-- CxfRs endpoints -->
<cxf:rsServer id="restfulService" address="/rest2"
serviceClass="org.jeannyil.fuse.cxfrs.metrics.resource.RestfulService"
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/rest2"/>
<property name="usePathBasedConfig" value="true" />
<property name="title" value="RESTful Service Metrics (swagger v2.0) :: Usage of the camel-metrics on service requests"/>
<property name="description" value="Returns a randomly generated numbers list according to input count and range parameters"/>
<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>