I'm trying to create an application that gets information from a browser and drops it in a queue. That data is then picked up from the queue and sent through an application for security. The security app should drop it in a different queue when it is done to be picked up by a separate action application.
Could anyone help me along with the routing? Basically, the route I'm looking for is:
Browser/UI -> Qnonsecure -> security app -> QSecure -> action app
What I understand now is the following:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="jms:queue:QnonSecure"/>
<to uri="jms:queue:QSecure"/>
</route>
</camelContext>
How Can I change this to route to and from applications. How do I send the input from the browser into QnonSecure? Also, where in my code do I call the security app between the QnonSecure and QSecure?
There is more than one possible solution. Take the following route as a starting point:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="restlet:http://localhost:8081/myApp?restletMethod=post"/>
<to uri="jms:queue:QnonSecure" pattern="InOut" />
<enrich uri="direct:securityApp"/>
<choice>
<when>
<simple>${header.myHeader} == "SECURE"</simple>
<to uri="jms:queue:QSecure" pattern="InOut" />
<to uri="direct:actionApp" />
</when>
<otherwise>
<!-- handle non valid requests -->
</otherwise>
</choice>
</route>
</camelContext>
Steps:
restlet component. This could be done via JavaScript, a link and/or just a ordinary submit button.jms:queue:QnonSecure. As we use the InOut pattern, this is done in a synchronous manner and the response is fetched.jms:queue:QnonSecure is sent to direct:securityApp where the credentials are tested. If they are correct, the header myHeader is set to SECURE (or any other value).choice statement, myHeader is tested. In the secure case, jms:queue:QSecure and finally direct:actionApp is invoked.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With