Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 68236 invoked from network); 17 Feb 2007 15:32:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Feb 2007 15:32:26 -0000 Received: (qmail 28202 invoked by uid 500); 17 Feb 2007 15:32:34 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 28170 invoked by uid 500); 17 Feb 2007 15:32:33 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 28161 invoked by uid 99); 17 Feb 2007 15:32:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Feb 2007 07:32:33 -0800 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,SUBJECT_ENCODED_TWICE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Feb 2007 07:32:22 -0800 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HIRXd-0003xI-Dc for dev@activemq.apache.org; Sat, 17 Feb 2007 07:32:01 -0800 Message-ID: <9020869.post@talk.nabble.com> Date: Sat, 17 Feb 2007 07:32:01 -0800 (PST) From: cafe To: dev@activemq.apache.org Subject: =?UTF-8?Q?I_can=E2=80=99t_receive_more_than_2_messages_simulta?= =?UTF-8?Q?neously_with_DefaultMessageListenerContainer?= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: rmilian@estudiantes.uci.cu X-Virus-Checked: Checked by ClamAV on apache.org I have a listener (in the server side) who receive request for send files (Streams): public class RequestUpdateListener implements SessionAwareMessageListener { private JmsTemplate jmsTemplate; private String fileUpdateLocation; public void onMessage(Message request, Session session) throws JMSException { ActiveMQConnectionFactory connectionFactory = ((PooledConnectionFactory) jmsTemplate .getConnectionFactory()).getConnectionFactory(); FileInputStream fis = null; try { fis = new FileInputStream(new File(fileUpdateLocation)); StreamSender ss = new StreamSender(); ss.send(connectionFactory, fis,uuid); } catch (Exception e) { e.printStackTrace(); } } ............. and a class: public class StreamSender { public void send(ConnectionFactory connectionFactory, FileInputStream fis, String uuid) { try { connection = (ActiveMQConnection) connectionFactory.createConnection(); session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE); Destination destination = session.createQueue("TransferQueue"); int deliveryMode = DeliveryMode.NON_PERSISTENT; int priority = 1; long timeToLive = 0; outputStreamMQ = connection.createOutputStream(destination, prop, deliveryMode, priority, timeToLive); int total = 0; int reads; byte[] array = new byte[8 * 1024]; while ((reads = fis.read(array)) != -1) { outputStreamMQ.write(array, 0, reads); } JmsUtils.commitIfNecessary(session); ...... and again the spring container: and in the client side I have a listener who receive the Stream: public class NotificationListener implements SessionAwareMessageListener { public void onMessage(Message response, Session session) throws JMSException { String message = "xml descriptor"; jmsTemplate.convertAndSend(requestUpdateQueue, message, new MessagePostProcessor() { public Message postProcessMessage(Message message) throws JMSException { .... return message; } }); StreamReceiver receiver = new StreamReceiver(); receiver.setConnectionFactory(connectionFactory); receiver.receive(); } public class StreamReceiver { public void receive() { ... try { connection = (ActiveMQConnection) connectionFactory.createConnection(); session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE); Destination destination = session.createQueue("TransferQueue"); fisMQ = connection.createInputStream(destination, selector); fos = new FileOutputStream("..."); int reads; int total = 0; byte[] array = new byte[8 * 1024]; while ((reads = fisMQ.read(array)) != -1) { fos.write(array, 0, reads); total += reads; } JmsUtils.commitIfNecessary(session); ......... Now the problem arise when more than 2 client running in different machines does a request simultaneously, the server (StreamSender) stop the transfer without any exception what could be this? -- View this message in context: http://www.nabble.com/I-can%E2%80%99t-receive-more-than-2-messages-simultaneously-with-DefaultMessageListenerContainer-tf3245123s2354.html#a9020869 Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.