簡體   English   中英

駱駝使用額外的參數連接到RabbitMQ隊列

[英]Camel connect to RabbitMQ queue with extra params

我想通過xml配置將Camel路由與RabbitMQ集成。

我需要收聽來自Rabbiit中已經存在的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示例都顯示使用'&'是傳遞參數的正確方法。 任何幫助表示贊賞

 you should replace & to &amp;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM