Andy.
If you implement the qpid.jms.ConnectionListener then you will get
notified of the exception.
If you don't then there will be an error level event logged:

ERROR Throwable Received but no listener set
org.apache.qpid.client.AMQNoRouteException: Error: Topic.....

That is if you are using the current M2/M2.1 branch, if you are using
anything else you are quite right the exception swallowing is not very
helpful.

The reason you are getting this is also an out standing issue:
https://issues.apache.org/jira/browse/QPID-509
Qpid defaults to setting the Mandatory flag to be true for all
messages. This means that the route must exist when the message is
sent. For topics that means there _must_ be a subscriber or the
message is returned.

To get round this when you create your producer you must use the
qpid.jms.Session interface rather than the Java jms interface.

createProducer(Destination destination, boolean mandatory, boolean immediate)

Will allow you to change the mandatory flag to false. The default for
immediate is also false, immediate means that the message will be
returned if none of the current subscribers are able to process the
message. i.e. the message will not be queued.


HTH


On 26/10/2007, Andy Grove <[EMAIL PROTECTED]> wrote:
> Hi,
>
> If I attempt to send messages to a topic that has no listeners I notice this
> in the logging output. If I set the logging threshold to INFO, WARN or ERROR
> I do not see the problem and no exception is thrown to the client
> application. Shouldn''t the log output at least be WARN or ERROR?
>
> 26 Oct 2007 10:44:42,790 [pool-2-thread-1] DEBUG
> org.apache.qpid.client.AMQConnection - exceptionReceived done
> by:pool-2-thread-1
> org.apache.qpid.client.AMQNoRouteException: Error: Topic MYTOPICNAME is not
> known to org.apache.qpid.server.exchange.DestWildExchange[amq.topic] [error
> code 312: no route]
>     at org.apache.qpid.client.AMQSession$9.run(AMQSession.java:2312)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> ThreadPoolExecutor.java:650)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:675)
>     at java.lang.Thread.run(Thread.java:595)
>
>
> Thanks,
>
> Andy.
>


-- 
Martin Ritchie

Reply via email to