Question

I have two applications (classic java program and a batch) that have to deal with each other. In order to decouple them as much as possible the communication, i'm thinking about using a queue between the applications.

The thing is that the first application is providing some java objects that the second one has to transform to another objects type (sort of DTO pattern) and do some business logic and web service call using the newly constructed objects. Is using a queue is the best solution in this case?

if it is, is there a performance issue on the queue (thinking espacially about size, and consumation time)? What is the best way to implement this queue?

thank you in advance :)

Was it helpful?

Solution

Queue is probably the best solution if the job is long running and resource intensive. For example if your batch application is sending out massive emails with the each content the classic application provides, then yes Queue is the right solution.

Drawbacks of queue includes it introduces management overhead like you have to worry about what if the queue gets too large, how to delivery response back to the classic application etc.

If the batch program can process each request from the classic application quickly then I would expose the batch program as web service so the classic application can get immediate response.

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