Как зарегистрировать маршрут Java DSL с Blueprint?
Попытка: в проекте, но он зарегистрировал маршрут.
Ошибка: org.apache.camel.component.direct.DirectConsumerNotAvailableException: Нетпотребители доступны в конечной точке: direct: //getPersonAddress.
Вот маршрут Java:
package sms.person.address.routes;
import org.apache.camel.builder.RouteBuilder;
public class PersonAddressGetRoute extends RouteBuilder {
public final static String ROUTE_ID = "getPersonAddrRoute";
@Override
public void configure() throws Exception {
// TODO Auto-generated method stub
from("direct:getPersonAddress").routeId("ROUTE_ID")
.routeDescription("Return address for given personId")
.log("Getting person address")
.setBody().simple("Get Person Address")
.to("mock:end");
}
}
blueprint.xml
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://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">
<cm:property-placeholder id="defaultProp"
persistent-id="sms.psn.service">
<cm:default-properties>
<!-- Default value -->
<cm:property name="app.http.host" value="0.0.0.0"/>
<cm:property name="app.http.portNumber" value="9000"/>
<cm:property name="app.url.contextPath" value="/sms/person/v1"/>
<cm:property name="app.url.address" value="/address"/>
</cm:default-properties>
</cm:property-placeholder>
<camelContext id="sms.psn.address.service" useMDCLogging="true"
xmlns="http://camel.apache.org/schema/blueprint">
<camel:packageScan>
<package>sms.psn.address.routes</package>
</camel:packageScan>
<restConfiguration component="jetty" host="{{app.http.host}}" port="{{app.http.portNumber}}"/>
<rest id="restPersonAddress" path="{{app.url.contextPath}}">
<get id="getPersonAddress" uri="{{app.url.address}}">
<to uri="direct:getPersonAddress"/>
</get>
</rest>
</camelContext>
</blueprint>
Я что-то пропустил?