Advertisement
Guest User

Untitled

a guest
Apr 7th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
  3. xmlns:camel="http://camel.apache.org/schema/blueprint"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
  5. <!-- this is the JDBC data source Config for postgresql database -->
  6. <bean class="org.apache.commons.dbcp.BasicDataSource"
  7. destroy-method="close" id="dataSource">
  8. <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  9. <property name="url" value="jdbc:mysql://localhost:3306/demo"/>
  10. <property name="username" value="root"/>
  11. <property name="password" value="root"/>
  12. </bean>
  13. <!-- configure the Camel SQL component to use the JDBC data source -->
  14. <bean class="org.apache.camel.component.sql.SqlComponent" id="sql">
  15. <property name="dataSource" ref="dataSource"/>
  16. </bean>
  17. <camelContext id="CustInfoContext" trace="false" xmlns="http://camel.apache.org/schema/blueprint">
  18. <propertyPlaceholder id="properties" location="classpath:sql.properties"/>
  19. <route customId="true" id="custinfoRoute">
  20. <from id="_from1" uri="activemq:queue:customer"/>
  21. <unmarshal id="_unmarshal1">
  22. <jaxb contextPath="org.blogdemo.homeloan.model"
  23. partClass="org.blogdemo.homeloan.model.CustInfo" prettyPrint="true"/>
  24. </unmarshal>
  25. <setHeader headerName="custNationalID" id="_setHeader1">
  26. <simple>${body.nationalID}</simple>
  27. </setHeader>
  28. <setHeader headerName="firstName" id="_setHeader2">
  29. <simple>${body.firstName}</simple>
  30. </setHeader>
  31. <setHeader headerName="lastName" id="_setHeader3">
  32. <simple>${body.lastName}</simple>
  33. </setHeader>
  34. <setHeader headerName="age" id="_setHeader4">
  35. <simple>${body.age}</simple>
  36. </setHeader>
  37. <setHeader headerName="occupation" id="_setHeader5">
  38. <simple>${body.occupation}</simple>
  39. </setHeader>
  40. <to id="_to1" uri="sql:{{sql.insertCustInfo}}"/>
  41. </route>
  42. </camelContext>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement