activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lzr <>
Subject Re:One session for more consumers
Date Tue, 11 Oct 2011 06:14:30 GMT

Hello all, 

>From time to time I need to make huge transactions(say 40KB per message and 10000 messages
per transaction) to ActiveMQ, after trying all kinds of the configuration mode I found ActiveMQ
couldn't meets this need(Memory limit reached and ActiveMQ Broker doesn't work, and then socket
exception occurred). 

It's much appreciated if any suggestions!

At 2011-10-08 15:45:18,LFS <> wrote:
>I have question whether more Consumers can use one session? or I have create
>for each consumer new session? And one more question. Can I use one instance
>of MyMessageListener for each consumer? or I have create for each consumer
>new instance of MyMessageListener?
>For better idea this is segment of my code:
>     ..............
>     session = (ActiveMQSession) connection.createSession(transacted,
>    // Create the destinations and consumers
>            consumersFromTopic=new
>            for(int i=0; i<user.getUserfriends().size();i++){
>                User u=user.getUserfriends().get(i);
>                String subject = u.getName()+"sFriendsTopic";
>                Destination d=session.createTopic(subject);
>                MessageConsumer c=session.createConsumer(d);
>                consumersFromTopic[i]=c;
>            }
>            //Create messages listeners
>            MyListener = new MyMessageListener(session, user);
>            //Set messages listener to consumers
>            for(MessageConsumer consumer: consumersFromTopic){
>               consumer.setMessageListener(RQMListener);
>            }  
>View this message in context:
>Sent from the ActiveMQ - User mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message