why happened with the authorization ?

mtod <mailto:m...@thetods.net>
13 March 2015 04:02
I was able to get this working except for authorization.

Thanks



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-11-Dynamic-Camel-Route-updates-tp4693120p4693136.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
mtod <mailto:m...@thetods.net>
12 March 2015 22:40
Thanks for the reply

I have the basic functionality working but I'm finding that I can't place
any beans in the route.xml and get it to work.

My existing route file is listed below.

I'm trying to duplicate that in the routes.xml and it just throws errors.
I have tried moving the beans to the activemq.xml no luck.

I cleaned it up by removing the camelcontext and replacing it with <routes>
etc but no luck.

My example:

<beans
xmlns="http://www.springframework.org/schema/beans";
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-2.0.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd";>


<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.conf}/credentials.properties</value>
</property>
</bean>

<bean id="myDeadLetterErrorHandler"
class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="deadLetterUri" value="jms:queue:dead"/>
<property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig"/>
</bean>

<bean id="myRedeliveryPolicyConfig"
class="org.apache.camel.processor.RedeliveryPolicy">
<property name="maximumRedeliveries" value="3"/>
<property name="redeliveryDelay" value="5000"/>
</bean>


<bean id="AppLogDS" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="url"
value="jdbc:sqlserver://xxxx:1433;DatabaseName=xxxxx" />
<property name="username" value="xxxxx" />
<property name="password" value="xxxxx" />
</bean>


<bean id="sql" class="org.apache.camel.component.sql.SqlComponent">
<property name="dataSource" ref="AppLogDS"/>
</bean>

<camelContext id="esbRoutes" trace="false" streamCache="true"
xmlns="http://camel.apache.org/schema/spring";
xmlns:km="http://xsdrepo.foundationmedicine.com/messaging/esb";>

<dataFormats>
<syslog id="mySyslog"/>
</dataFormats>

<route id="esbRoute1" errorHandlerRef="myDeadLetterErrorHandler">
<from uri="activemq:queue:esb.*"/>
<wireTap uri="activemq:queue:wire.tapped"/>
<doTry>
<to
uri="validator:http://xsd.xxxxx.com/messaging/esb/ESBMessageV3.xsd"/>
<setHeader headerName="Route1">
<xpath
resultType="String">/km:FMIMessage/km:Header/km:Route/text()</xpath>
</setHeader>
<recipientList delimiter="false">
<header>Route1</header>
</recipientList>
<doCatch>

<exception>org.apache.camel.ValidationException</exception>
<onWhen>
<simple>${exception.message}</simple>
</onWhen>
<to uri="activemq:queue:invalid.schema"/>
</doCatch>
</doTry>
</route>

<route id="syslogRoute">
<from uri="activemq:queue:syslogMessages"/>
<doTry>

<setHeader headerName="DateValue">
<xpath
resultType="String">//*[local-name()='EventTime']/text()</xpath>
</setHeader>
<setHeader headerName="LevelID">
<xpath
resultType="String">//*[local-name()='LevelID']/text()</xpath>
</setHeader>
<setHeader headerName="PRI">
<xpath
resultType="String">//*[local-name()='PRI']/text()</xpath>
</setHeader>
<setHeader headerName="Hostname">
<xpath
resultType="String">//*[local-name()='ServerName']/text()</xpath>
</setHeader>
<setHeader headerName="ApplicationName">
<xpath
resultType="String">//*[local-name()='ApplicationName']/text()</xpath>
</setHeader>
<setHeader headerName="Logger">
<xpath
resultType="String">//*[local-name()='Logger']/text()</xpath>
</setHeader>
<setHeader headerName="UniqueID">
<xpath
resultType="String">//*[local-name()='UniqueID']/text()</xpath>
</setHeader>
<setHeader headerName="Message">
<xpath
resultType="String">//*[local-name()='MessageText']/text()</xpath>
</setHeader>
<setHeader headerName="Exception">
<xpath
resultType="String">//*[local-name()='Exception']/text()</xpath>
</setHeader>
<setHeader headerName="Payload">
<xpath
resultType="String">//*[local-name()='Payload']/text()</xpath>
</setHeader>
<setHeader headerName="ActionID">
<xpath
resultType="String">//*[local-name()='ActionID']/text()</xpath>
</setHeader>
<setHeader headerName="MemberName">
<xpath
resultType="String">//*[local-name()='MemberName']/text()</xpath>
</setHeader>
<setHeader headerName="DebugLineNumber">
<xpath
resultType="String">//*[local-name()='DebugLineNumber']/text()</xpath>
</setHeader>
<setHeader headerName="DebugFilePath">
<xpath
resultType="String">//*[local-name()='DebugFilePath']/text()</xpath>
</setHeader>


<setBody>
<simple>&lt;${header.PRI}&gt;1 ${header.DateValue}
${header.Hostname} ${header.ApplicationName} ${header.Logger}
${header.UniqueID} ${header.Message}</simple>
</setBody>
<log message="${body}"/>
<marshal ref="mySyslog"/>
<to uri="mina:udp://INF-xxxxx:514?sync=false"/>


<doCatch>

<exception>org.apache.camel.ValidationException</exception>
<onWhen>
<simple>${exception.message}</simple>
</onWhen>
<to uri="activemq:queue:invalid.schema"/>
</doCatch>
</doTry>
</route>

</camelContext>
</beans>

Thanks

Mike



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-11-Dynamic-Camel-Route-updates-tp4693120p4693129.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Timothy Bish <mailto:tabish...@gmail.com>
12 March 2015 22:31

You can see the unit test that exercises this here:
https://github.com/apache/activemq/blob/5667e4ddcc44e1331cafea2c1537afeaa550a2cd/activemq-camel/src/test/java/org/apache/activemq/camel/camelplugin/CamelPluginConfigTest.java

And the configuration files it uses are here:
https://github.com/apache/activemq/tree/5667e4ddcc44e1331cafea2c1537afeaa550a2cd/activemq-camel/src/test/resources/org/apache/activemq/camel/camelplugin

The plugin is just refreshing its state based on the contents of the routes.xml file, change that and the broker would update after the configured refresh interval.

mtod <mailto:m...@thetods.net>
12 March 2015 21:51
Does anyone have an example of how to configure Activemq.xml to use dynamic
route updates?

https://issues.apache.org/jira/browse/AMQ-5351
<https://issues.apache.org/jira/browse/AMQ-5351>
I can't seem to find any information on this update.

Thanks

Mike




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-11-Dynamic-Camel-Route-updates-tp4693120.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to