我想通过xml配置将Camel路由与RabbitMQ集成。
我需要听听拉比已经存在的MYPRETTYQ的信息。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext id="camelId" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="rabbitmq://localhost:5672/direct?queue=MYPRETTYQ&autoDelete=false&skipQueueDeclare=true"/>
<log message="File: ${body}"/>
</route>
</camelContext>
参数取自
https://camel.apache.org/rabbitmq.html
然而,“&”未在uri字符串中分析符号,我得到以下异常:
Caused by: org.xml.sax.SAXParseException; lineNumber: 27; columnNumber: 91; The reference to entity "autoDelete" must end with the ';' delimiter.
我尝试更改(&)至“;”但是,它会导致无效行为。而不是解析为参数行
queue=MYPRETTYQ;autoDelete=false;skipQueueDeclare=true
创建具有此名称的新队列。
我不知所措,因为所有URI示例都显示使用“&”是传递参数的正确方法。感谢您的帮助