Можем ли мы установить свойства Kafka с помощью Apache Camel, в весеннем XML-файле конфигурации - PullRequest
0 голосов
/ 20 мая 2019

Может ли конфигурация XML иметь доступ к свойствам kafka в apache camel

There is no kafka and spring XML configuration is available anywhere

<camelContext xmlns="http://camel.apache.org/schema/spring">
		<route>
			<from uri="direct:SpringXMLRouteStart" />
			<setHeader headerName="CamelHttpMethod">
			    <constant>GET</constant>
			</setHeader>
			<!-- To printout the routing message on the IDE console -->
			<to uri="http://localhost:8080/v1/get/WGS/inboundCMMessage1" />
		</route>
		<route>
			<from uri="http://localhost:8080/v1/get/WGS/inboundCMMessage1" />
			<to uri="kafka://localhost:9092?topic=customtopic&zookeeperHost=localhost:2181" />
		</route>
	</camelContext>

..................... Моя ошибка ...............

org.xml.sax.SAXParseException: The reference to entity "zookeeperHost" must end with the ';' delimiter.

Заранее спасибо

1 Ответ

0 голосов
/ 20 мая 2019

Поскольку вы используете XML, вы не можете использовать '&' в URI маршрутизации, как это было бы с Java DSL, поэтому сделайте:

&amp;zookeeperHost=localhost:2181
...