xml route pop3 uri throws exception - syntax question
airber Feb 18, 2009 8:58 AMHi all,
I tried to poll some pop3 messages from an emailserver. If I configure then endpoint in a routebuilder-bean with the method configure()
it works fine with several options. The code snippet shows the method:
import org.apache.camel.builder.RouteBuilder;
public class MessageRouter extends RouteBuilder {
public void configure() {
from("pop3://myname@myserver?password=mysecret"
+ "&deleteProcessedMessages=true&consumer.delay=60000").to("activemq:fromExchange");
}
}
ok that works fine.
Now we want to configure the pop3 endpoint in the activemq.xml to avoid everytime to recompile a new bean, if emailpoint are added or whathever.
We took the example from the active camel website and tried this route:
<route>
<from uri="pop3://myname@myserver?password=mysecret&deleteProcessedMessages=true&consumer.delay=60000" />
<to uri="activemq:fromExchange" />
</route>
But this throws the following exception
DEBUG XBeanBrokerFactory - Now attempting to figure out the type of resource: activemq.xml
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 126 in XML document from class path resource [activ
emq.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The reference to entity "deleteProcessedMessages" must end with the ';' delimiter.
java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 126 in XML document from class path resource [activemq.xml
] is invalid; nested exception is org.xml.sax.SAXParseException: The reference to entity "deleteProcessedMessages" must end with the ';' delimiter.
We tried several examples like the following, but nothing works:
<from uri="pop3://myname@myserver?password=mysecret&deleteProcessedMessages=true&consumer.delay=60000;" />
<from uri="pop3://myname@myserver?password=mysecret&deleteProcessedMessages=true;&consumer.delay=60000" />
<from uri="pop3://myname@myserver?password=mysecret;&deleteProcessedMessages=true&consumer.delay=60000" />
Any idea how to solve this?
Thanks in advance
airber