Question

My application needs to work as middleware(MW) where it has got orders(in form of XML) from various customers which contains the --------------Priority 1 supplier id where custmers can send the XML to one of these components

1)JMS queue
2)File system
3)HTTP
4)Web service request(rest/soap)

This MW will first validate the incoming request and send the acknowledgement to customers who requested order over their preferred channels. Channel and customer end point info exists in the incoming XML.

Once it gets the order, it needs to send order requests to different suppliers over their preffered channels in the form of xml. I have the supplier and their preferred channel info in my db.

So its a Enterprise Integration usecase.

I was planning to do it using core java technologies. here is the approach i was planning.

Will have four listener/entry endpoint for each type of incoming request (JMS queue, File system, HTTP, Web service request(rest/soap)). These listeners will put the will put the xml string on jms queue. This it will work as receptionist and make the process asynchronous.

Now i will have jms consumer which will listen on queue.(Consumer can be on same system or different as producer depending on load on producer machine). This consumer will parse the xml string to java objects. Perform the validation. Send the acknowledgement to customers(acknowledgement needs to be send based on customer preference. I will be using acknowledgement processor factory which will send the acknowledgement based on preference). Once validation is done, convert this pojo to another pojo format so xstream/jaxb further marshal it to xml format and send to suppliers on their preferred channel(supplier preference is stored in db) like thru soap,jms,file request etc.

Some i came across this CAMEL link http://java.dzone.com/articles/open-source-integration-apache and looks like its provides the perfect solution and found this is the Enterprise Integration usecase.

Experts please advise is Camel the right solution for this. Or some other Enterprise integration fraework like Spring integration, ESB will be more benefecial in this case.If somebody can point me to the resource where ESB solves this kind of usecase. It would be really helpful.

I could not explore all solution as because of time constraint so looking for expert suggestion so that can concentrate on one.

Was it helpful?

Solution

Something like Camel is completely appropriate for this task.

Things like Camel provide toolsets and components that make stitching together workflows like you describer easier, with the caveat that you must learn the overall tool (i.e. Camel, in this case), first.

For a skilled, experience developer, and simple use cases, you can see where they might take the approach that you're taking. Provisioning the workflow with tools at hand, including, perhaps, custom code, rather than taking the time to learn a new tool.

Recall while tools can be a great benefit (features, testing, quality, documentation), they also bring a burden (support, resources, complexity). A key aspect of bringing tool sets in to your environment is that while you may not have written the code, you are still ultimately responsible for it's behavior in your environment.

So, all that said, you need to ascertain whether the time investment of incorporating a tool like Camel is worth the benefit to your current project. Odds are that if you intend to continue and do more integrations in the future, investing in such a tool would be a good idea, as the tool will make those integration easier.

But be conscious that something like Camel, which is quite flexible, also brings along with it inherent complexity. But for simple stuff like what you're talking about, I think it's a solid fit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top