grails - listener that groups jms messages then sends to next queue / batching messages -


i need implement listener receives multiple messages groups them base on criteria send grouped messages next queue. in other words batching them in logical way.

i'm using grails , jms integration plugin.

in mind, can implemented in listener runs single thread runs infinite loop forever consume messages queue grouping logic there.

runnable runnable = new runnable() {    @override    public void run() {       while(true) {          def obj = consumer.receive()          //group messages , store on list send them in groups next queue          producer.send(groupedobjlist)       }    } } def thread = new thread(runnable); thread.start(); 

i'm not sure if clean way it. i'm looking alternatives on how implement this.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -