我们可以在spring XML配置文件中用apache camel设置Kafka属性吗

ef1yzkbh  于 2022-11-07  发布在  Apache
关注(0)|答案(1)|浏览(138)

※ XML配置可以访问apache camel中的Kafka属性

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.

提前致谢

dsf9zpds

dsf9zpds1#

由于您使用的是XML,因此不能像使用Java DSL那样在路由URI中使用'&',请执行以下操作:

&amp;zookeeperHost=localhost:2181

相关问题