activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naveen Rawat" <nav...@in.effectsoft.com>
Subject Re: Queue hogging by a single consumer.
Date Fri, 18 Aug 2006 11:32:51 GMT
 

Hi James, 


Arshad started it here, so I think follow it here only. 

Thanks for those pseudo directives. 

I followed those to find out that for once server receives the requests, it 
does not sends response back to the client.
After receiving the first request, the server goes napping. 

I think you missed "session::createProducer" at server side, without which 
it is giving SIGSEGV fault. Correct me? 


I have done it like this - 

	[..................Client side........................... 

	p<IDestination>Tqueue = session->createTemporaryQueue() ;
	consumer = session->createConsumer(Tqueue, "JMSCorrelationID = 'butter'") ;
	consumer->setMessageListener( smartify(this) ) ;	 

	//sending request
	reqmessage = session->createBytesMessage() ;
	reqmessage->setJMSReplyTo(Tqueue);
	reqmessage->setJMSCorrelationID("butter");
	reqmessage->writeString(MsgStr) ; 

 	producer->send(reqmessage);
	................................................................] 


	[.....................Server side .............................
	
	// server side
	public void onMessage(message) {
	
		p<string> NCid;
		p<IDestination> NDest;	
		NCid = message->getJMSCorrelationID();
		NDest = message->getJMSReplyTo();
	 

		producer = session->createProducer(NDest) ;
		reqMessage = session->createBytesMessage() ;
		reqMessage->setJMSCorrelationID(NCid->c_str() );
		reqMessage->writeString(respMSG) ;  //respMSG a variable 

		producer->send(NDest ,reqMessage);
	}
	................................................................] 


Am I missing/overdoing anything here?
Please guide me error through. 


		THANKS IN ADVANCE 


Regards,
Navin

Mime
View raw message