You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jignesh ShaH <ji...@persistent.co.in> on 2007/05/03 16:00:00 UTC

facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent

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.

Re: facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent

Posted by James Strachan <ja...@gmail.com>.
On 5/4/07, Jignesh ShaH <ji...@persistent.co.in> wrote:
> Hi James
>
> The problem is resolved as I missed connection.start()

Its definitely worth checking the FAQ as there's lots of common
gotchas in there...
http://activemq.apache.org/faq.html


> But can u let me know about deleting the Queue contents as even I m setting the Delivery mode to Non Persistent I am having a dispatch count of 6181

More faq entries of interest...
http://activemq.apache.org/what-is-the-difference-between-persistent-and-non-persistent-delivery.html
http://activemq.apache.org/how-do-i-purge-a-queue.html

-- 
James
-------
http://macstrac.blogspot.com/

RE: facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent

Posted by Jignesh ShaH <ji...@persistent.co.in>.
Hi James 

The problem is resolved as I missed connection.start()

I could not connect either ways 

 

 

But can u let me know about deleting the Queue contents as even I m setting
the Delivery mode to Non Persistent I am having a dispatch count of 6181

 



 

-----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 <ji...@persistent.co.in> 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.

RE: facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent

Posted by Jignesh ShaH <ji...@persistent.co.in>.
Even if I send only 5 messages once every time the consumer fires a receive
consumer get the 5 messages even if I am using the non persistent delivery
mode  and have set the connectionFactory.setDispatchAsync(false); also
connectionFactory.setOptimizedMessageDispatch(false); 

Please let me know how to purge programmatically.


-----Original Message-----
From: James Strachan [mailto:james.strachan@gmail.com] 
Sent: Friday, May 04, 2007 3:23 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

On 5/4/07, Jignesh ShaH <ji...@persistent.co.in> wrote:
> Yup I came to know that later
>
> I wanna delete the contents of the Queue even if I am restarting the
broker
> the dispatch count just increases everytime

Dispatch count starts at zero and keeps growing as you run a broker.

If you use non-persistent delivery mode, restarting the broker will
remove all messages from the queue.

http://activemq.apache.org/what-is-the-difference-between-persistent-and-non
-persistent-delivery.html

-- 
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.

Re: facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent

Posted by James Strachan <ja...@gmail.com>.
On 5/4/07, Jignesh ShaH <ji...@persistent.co.in> wrote:
> Yup I came to know that later
>
> I wanna delete the contents of the Queue even if I am restarting the broker
> the dispatch count just increases everytime

Dispatch count starts at zero and keeps growing as you run a broker.

If you use non-persistent delivery mode, restarting the broker will
remove all messages from the queue.

http://activemq.apache.org/what-is-the-difference-between-persistent-and-non-persistent-delivery.html

-- 
James
-------
http://macstrac.blogspot.com/

RE: facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent

Posted by Jignesh ShaH <ji...@persistent.co.in>.
Yup I came to know that later 

I wanna delete the contents of the Queue even if I am restarting the broker
the dispatch count just increases everytime



Regards
 Jignesh


-----Original Message-----
From: James Strachan [mailto:james.strachan@gmail.com] 
Sent: Friday, May 04, 2007 3:02 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

BTW your previous issue was in the FAQ too...
http://activemq.apache.org/i-am-not-receiving-any-messages-what-is-wrong.htm
l

On 5/3/07, Jignesh ShaH <ji...@persistent.co.in> wrote:
> 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 <ji...@persistent.co.in> 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.
>


-- 
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.

Re: facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent

Posted by James Strachan <ja...@gmail.com>.
BTW your previous issue was in the FAQ too...
http://activemq.apache.org/i-am-not-receiving-any-messages-what-is-wrong.html

On 5/3/07, Jignesh ShaH <ji...@persistent.co.in> wrote:
> 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 <ji...@persistent.co.in> 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.
>


-- 
James
-------
http://macstrac.blogspot.com/

RE: facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent

Posted by Jignesh ShaH <ji...@persistent.co.in>.
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 <ji...@persistent.co.in> 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.

Re: facing problems with explicitas well as embedded broker on the same machine with the producer and consumer on different machine ---- need help Urgent

Posted by James Strachan <ja...@gmail.com>.
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 <ji...@persistent.co.in> 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/