My application needs to work as middleware where it has got orders(in form of xml) from various customers which contains the supplier id. Once it get the order, it needs to send order request to different suppliers in the form of xml.i am double minded about three aspects of it. Here they are:-
Questions:
What i am planning at high level is as soon as request come, put it on jms queue.(Now i am not sure should i create queue for each supplier or one queue should be sufficient. I think one queue will be sufficient. as maintaining large number of queues will be overhead.). Advantage of maintaining separate queue per supplier is message can be processed faster as there will be separate producer on each queue.
Before putting the object on queue i need to do some business validations. Also the structure of input xml i am receiving and output xml i need to send to supplier is different. For this i am planning to convert the input xml to java object then put on queue so that validation can be done with ease at consumer side. Another thought is dont convert the xml into java object, just get all elements value thru xpath/xstream api and validate them and put xml string as it is on queue because. Then at consumer side convert xml to java object then to different xml format. Is there a way of doing it?
Now my requirement is consumer on queue process the messages on queue after every 5 hours and send the xml request to suppliers. I am planning to use quartz scheduler here which will pick the job one by one and send to corresponding supplier based on supplierId. Here is my question is if my job pick the message one by one and then send it to supplier. it will be too slow . I am planning to handle it where quartz job create ThreadPool with size of say ten threads at time which concurrently process the messages from queue(So here will be multiple consumers on queue. I think thats not valid for queue. Do i need topic here instead of queue?). Is second approach is better or there is some better than this?
i am expecting a load of 50k request per hour which mean around 15 request per second