Компонент Camel Zookeeper не найден во встроенных ActiveMQ Camel Modul - PullRequest
0 голосов
/ 01 октября 2019

На 3 виртуальных машинах работает Zookeeper + ActiveMQ. ActiveMQ версии 5.15.9 с верблюдом версии 2.19.5

Теперь я использую встроенную платформу Camel EIP в ActiveMQ. Я хочу получить конкретный узел из Zookeeper на основе события.

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">

        <!-- You can use Spring XML syntax to define the routes here using the <route> element -->
        <route>
            <description>Read zookeeper variant 1</description>
            <from uri="activemq:example.zoo1"/>
            <pollEnrich>
               <constant>zookeeper://localhost:2182/some/node/99</constant>
            </pollEnrich>
            <to uri="activemq:example.zooRead1"/>
        </route>
        <route>
            <description>Read zookeeper variant 2</description>
            <from uri="activemq:example.zoo2"/>
            <pollEnrich>
               <constant>zookeeper:znode1:2182,znode2:2182,znode3:2182/some/node/99</constant>
            </pollEnrich>
            <to uri="activemq:example.zooRead2"/>
        </route>
</camelContext>

В файле журнала возникла следующая исключительная ситуация с вариантом 1

org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: zookeeper://localhost:2182/some/node/99 due to: No component found with scheme: zookeeper
    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:729)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:80)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:92)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.processor.PollEnricher.resolveEndpoint(PollEnricher.java:343)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.processor.PollEnricher.process(PollEnricher.java:201)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)[camel-core-2.19.5.jar:2.19.5]
    at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:112)[camel-jms-2.19.5.jar:2.19.5]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:719)[spring-jms-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:679)[spring-jms-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:649)[spring-jms-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317)[spring-jms-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)[spring-jms-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1168)[spring-jms-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1160)[spring-jms-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1057)[spring-jms-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_222]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_222]
    at java.lang.Thread.run(Thread.java:748)[:1.8.0_222]
2019-10-01 15:06:05,652 | DEBUG | Message exchange has failed: so breaking out of pipeline for exchange: Exchange[ID-Monkey-34387-1569942241018-0-1] Exception: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: zookeeper://localhost:2182/some/node/99 due to: No component found with scheme: zookeeper | org.apache.camel.processor.Pipeline | Camel (camel) thread #1 - JmsConsumer[example.zoo1]
2019-10-01 15:06:05,690 | WARN  | Execution of JMS message listener failed. Caused by: [org.apache.camel.ResolveEndpointFailedException - Failed to resolve endpoint: zookeeper://localhost:2182/some/node/99 due to: No component found with scheme: zookeeper] | org.apache.camel.component.jms.EndpointMessageListener | Camel (camel) thread #1 - JmsConsumer[example.zoo1]
org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: zookeeper://localhost:2182/some/node/99 due to: No component found with scheme: zookeeper

Camel Zookeeper Component

1 Ответ

0 голосов
/ 09 октября 2019

Решение работает как @ Bedla .

Скопируйте Jar-файл в папку ACTIVEMQ_HOME/lib и он работает как expceted.

...