Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 16254 invoked from network); 3 May 2007 14:18:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 May 2007 14:18:29 -0000 Received: (qmail 26463 invoked by uid 500); 3 May 2007 14:18:34 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 26445 invoked by uid 500); 3 May 2007 14:18:34 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 26435 invoked by uid 99); 3 May 2007 14:18:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2007 07:18:34 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jignesh_shah@persistent.co.in designates 202.54.11.87 as permitted sender) Received: from [202.54.11.87] (HELO bmapps.persistent.co.in) (202.54.11.87) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2007 07:18:27 -0700 Received: from bmapps.persistent.co.in (unknown [127.0.0.1]) by bmapps.persistent.co.in (Symantec Mail Security) with ESMTP id 6CF8D5283FA for ; Thu, 3 May 2007 19:46:49 +0530 (IST) X-AuditID: 0a4e0006-ac5f3bb000002e5b-57-4639eed11de4 Received: from mail.persistent.co.in (unknown [10.78.0.1]) by bmapps.persistent.co.in (Symantec Mail Security) with ESMTP id 262CC4E4002 for ; Thu, 3 May 2007 19:46:49 +0530 (IST) Received: from ps2237 ([10.77.201.87]) by mail.persistent.co.in (MOS 3.8.3-GA) with ESMTP id BFR69602 (AUTH jignesh_shah); Thu, 3 May 2007 19:48:04 +0530 (IST) From: "Jignesh ShaH" To: References: <002f01c78d8b$56f8e070$57c94d0a@persistent.co.in> Subject: RE: facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent Date: Thu, 3 May 2007 19:48:25 +0530 Message-ID: <003e01c78d8d$ea0f60d0$57c94d0a@persistent.co.in> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: AceNjU+ts1CdlKvlRFO+AedkuQkp2gAAFAsw X-Junkmail-Whitelist: YES (by domain whitelist at mail6.persistent.co.in) X-Brightmail-Tracker: AAAAAA== X-Virus-Checked: Checked by ClamAV on apache.org This is the code of the producer with the explicit Broker running as service on the same machine as the producer : ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616"); System.out.println(connectionFactory.toString()); String str = null ; SimpleMessageConverter convertor = new SimpleMessageConverter(); connectionFactory.setUseAsyncSend(true); connectionFactory.setDispatchAsync(true); connectionFactory.setOptimizeAcknowledge(true); connectionFactory.setOptimizedMessageDispatch(true); ActiveMQPrefetchPolicy prefetchpolicy = new ActiveMQPrefetchPolicy(); prefetchpolicy.setQueuePrefetch(32766); connectionFactory.setPrefetchPolicy(prefetchpolicy); try { QueueConnection connection = connectionFactory.createQueueConnection(); Session session = connection.createQueueSession(false,Session.DUPS_OK_ACKNOWLEDGE); Destination destination = session.createQueue("Xdrqueue"); MessageProducer producer = session.createProducer(destination); BufferedReader reader = new BufferedReader(new FileReader(new File("C://Documents and Settings//jignesh_shah//Desktop//XDR.xml"))); str = reader.readLine(); while(true){ if(reader.readLine()==null) break; else str += reader.readLine(); } System.out.println("First Message sent at : -" + System.currentTimeMillis()); for (int i = 0; i < 10000; i++) { try { producer.send(convertor.toMessage(str+"\n", session)); } catch (MessageConversionException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (JMSException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (JMSException e) { e.printStackTrace(); } This is the code for consumer on different machine : package mqclient; import javax.jms.Destination; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.QueueConnection; import javax.jms.Session; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQPrefetchPolicy; import org.springframework.jms.support.converter.MessageConversionException; import org.springframework.jms.support.converter.SimpleMessageConverter; public class Client { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int cnt =0; ActiveMQConnectionFactory connectionfactory = new ActiveMQConnectionFactory("tcp://ps2237:61616"); System.out.println(connectionfactory); connectionfactory.setUseAsyncSend(true); connectionfactory.setDispatchAsync(true); connectionfactory.setOptimizeAcknowledge(true); connectionfactory.setOptimizedMessageDispatch(true); ActiveMQPrefetchPolicy prefetchpolicy = new ActiveMQPrefetchPolicy(); prefetchpolicy.setQueuePrefetch(32766); connectionfactory.setPrefetchPolicy(prefetchpolicy); try { System.out.println("try enetered"); QueueConnection connection = connectionfactory.createQueueConnection(); Session session = connection.createQueueSession(false,Session.DUPS_OK_ACKNOWLEDGE); Destination destination = session.createQueue("Xdrqueue"); MessageConsumer consumer = session.createConsumer(destination); SimpleMessageConverter convertor = new SimpleMessageConverter(); while(true) { System.out.println("loop enetered"); Message message = consumer.receive(); if(message.equals(null)) System.out.println("null message") ; try { String str = (String)convertor.fromMessage(message); } catch (MessageConversionException e) { e.printStackTrace(); } catch (JMSException e) { e.printStackTrace(); } if (cnt >=10000) { System.out.print("Last message received at :- "+ System.currentTimeMillis()); break; } ++cnt; } } catch (JMSException e) { e.printStackTrace(); } } } -----Original Message----- From: James Strachan [mailto:james.strachan@gmail.com] Sent: Thursday, May 03, 2007 7:44 PM To: users@activemq.apache.org Subject: Re: facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent What problems are you seeing? (You're not giving us much to go on)... http://activemq.apache.org/support.html On 5/3/07, Jignesh ShaH wrote: > facing problems with explicit as well as embedded broker on the same machine > with the producer and consumer on different machine ---- need help Urgent > > > > > > What I am doing is running the explicit broker and the producer on the same > machine > > And the consumer on other machine > > > > The connectionfactory references generated are different that's the only > thing I could find out > > > > > > Regards > > Jignesh shah > > > DISCLAIMER > ========== > This e-mail may contain privileged and confidential information which is the property of Persistent Systems Pvt. Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infected mails. > -- James ------- http://macstrac.blogspot.com/ DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Pvt. Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infected mails.