processing messages in order we receive from MQ with multithreading using spring integration -


we trades various exchanges , need load trades in same order receive mq, reason retain in same order times exchange may send change , delete record type of same trade, in case need process change before delete. noticed each message taking 21 milli secs (xml -> jaxb object-->pojo-->db) load in our system. exchanges drops xml messages in mq. spring integration how can improve trade load taking of 21 milli seconds/msg around 10 millisecs, @ same time need retain same order , should grace terminate process.

i have jaxb converter convert xml jaxb object , other converter convert nested jaxb objects single java entity object , hibernate using load java entity object databse.

gary,pls let me know if clear question.

does approach guarantees load db in same order receive mq

only if pollers use single thread.

does guarantee messages in queue channel process gracefully

no; , uss orderly shutdown mechanism before closing context, still risk message loss (e.g. due power failure). transaction commits message added queue.

if have retain order, safest configuration set concurrent-consumers 1 (the default).

edit:

since operations nature serial - 2 convertions + store; there no possibility parallelize flow each trade. so, if need retain order, out of luck.

one way improve flow performance somehow partition data , use multiple inbound channel adapters different message selectors, stock ticker, or stock ticker first letter.

of course, require exchange set ticker symbol in header; said not possible.

so might have put intermediate partitioning flow - write other set of mq queues (partitioned) , consume real business flow queues.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -