activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: InvalidDestinationException not throw in C++ connector
Date Wed, 19 Aug 2009 17:27:03 GMT
On Wed, 2009-08-19 at 08:53 -0700, Edison Melo wrote:
> Hi, I'm following 
> http://activemq.apache.org/how-should-i-implement-request-response-with-jms.html
> this  to implement request-response. So far so good. I'm trying to find when
> a response cannot be delivered to the temporary queue (e.g. the producer
> disconnects), so I can deliver the response to another queue. I tried the
> following:
>                        ....
> 			//Send the response to the Destination specified by the JMSReplyTo field
> of the received message,
> 			//this is presumably a temporary queue created by the client
> 			this.replyProducer.send(message.getJMSReplyTo(), response);
> 		} catch (InvalidDestinationException i) {
> 			try {
> 			    TextMessage response = this.session.createTextMessage();
> 		        response.setText("this is the response to this request: " +
> messageText);
> 	            Destination clientQueue =
> session.createQueue(message.getStringProperty("ServiceQueue"));
> 				this.replyProducer.send(clientQueue, response);
> 			} catch (Exception e) {
> 		    	e.printStackTrace();
> 		    }
> 		} catch (Exception e) {
>                ...
> 
> And works fine in Java, but in the C++ client, the same code (I believe...)
> doesn't throw anything:
> 
>                        ...  
> 			this->replyProducer->send(message->getCMSReplyTo(), response);
> 		} catch (InvalidDestinationException& e) {
> 			try {
> 			    TextMessage* response = this->session->createTextMessage();
> 		        response->setText("this is the response to this request: " +
> messageText);
> 	            Destination* clientQueue =
> session->createQueue(message->getStringProperty("ServiceQueue"));
> 				this->replyProducer->send(clientQueue, response);
> 			} catch (CMSException e) {
> 		    	e.printStackTrace();
> 		    }
>         } catch (CMSException& e) {
>         ...
> 
> So, I cannot find when the temp queue is valid (or the producer is
> connected...). Any clues or ideas ? I can try a different approach if
> someone suggest me how to implement "redundant" request - response. 

The C++ client doesn't currently have the ability to internally monitor
advisory messages from the broker and track deleted temp destinations so
it cannot know when to throw the InvalidDestinationException in this
case.  We always welcome code contributions for missing features.

Regards
Tim.




-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Mime
View raw message