You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by teapot <ji...@oracle.com> on 2011/04/18 20:36:27 UTC

How to catch javax.jms.InvalidClientIDException from AMQ

Hi:

I am using ActiveMQ 5.4.2. I used spring bean to configure ActiveMQ broker
and run the application on Tomcat. Is there any way to plug in an exception
handler for javax.jms.InvalidClientIDException from the broker? The handler
is to deal with the exception the broker output to the Tomcat server log. I
want to filter out that exception so that it did not show up on the server
log. 

Thanks.

--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-catch-javax-jms-InvalidClientIDException-from-AMQ-tp3458347p3458347.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to catch javax.jms.InvalidClientIDException from AMQ

Posted by Gary Tully <ga...@gmail.com>.
Have a peek at http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/plugin/DiscardingDLQBrokerPlugin.java?view=markup

or at some of the plugins in
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/

On 20 May 2011 20:25, teapot <ji...@oracle.com> wrote:
> Gary:
>
> Is there any code example I can reference to add a plugin with overridden
> addConnection() method? Thanks.
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-to-catch-javax-jms-InvalidClientIDException-from-AMQ-tp3458347p3539348.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com
http://fusesource.com

Re: How to catch javax.jms.InvalidClientIDException from AMQ

Posted by teapot <ji...@oracle.com>.
Gary:

Is there any code example I can reference to add a plugin with overridden
addConnection() method? Thanks.

--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-catch-javax-jms-InvalidClientIDException-from-AMQ-tp3458347p3539348.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to catch javax.jms.InvalidClientIDException from AMQ

Posted by Gary Tully <ga...@gmail.com>.
You could use a broker plugin nd override the addconnection method, to do a
different check.
That exception implements part of the jms spec so it may be better to
understand nd tackle the root cause.
If you really need to change behaviour the broker plugin is the way to go.
On 21 Apr 2011 19:43, "teapot" <ji...@oracle.com> wrote:
> Gary:
>
> We already have code on the client site(where connection is initiated) to
> handle the exception. But the same message also showed up on server log
and
> we would like to filter it out.
>
> Our AMQ broker is configured and started via spring
> bean(org.apache.activemq.xbean.BrokerFactoryBean). Is there any place to
add
> a plugin exception handler for javax.jms.InvalidClientIDException. The
> http://activemq.apache.org/configurable-ioexception-handling.html only
deals
> with IOException.
>
> Thanks.
>
> --
> View this message in context:
http://activemq.2283324.n4.nabble.com/How-to-catch-javax-jms-InvalidClientIDException-from-AMQ-tp3458347p3466613.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to catch javax.jms.InvalidClientIDException from AMQ

Posted by teapot <ji...@oracle.com>.
Gary:

We already have code on the client site(where connection is initiated) to
handle the exception. But the same message also showed up on server log and
we would like to filter it out. 

Our AMQ broker is configured and started via spring
bean(org.apache.activemq.xbean.BrokerFactoryBean). Is there any place to add
a plugin exception handler for javax.jms.InvalidClientIDException. The
http://activemq.apache.org/configurable-ioexception-handling.html only deals
with IOException.

Thanks.

--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-catch-javax-jms-InvalidClientIDException-from-AMQ-tp3458347p3466613.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to catch javax.jms.InvalidClientIDException from AMQ

Posted by Gary Tully <ga...@gmail.com>.
There is org.apache.activemq.ActiveMQConnection#setExceptionListener

You may be better dealing with the root cause of the exception. Either
properly close a connection or use the failover transport such that
that exception is avoided b/c a new connection with the same id is
treated as a reconnect and overwrites.

On 18 April 2011 19:36, teapot <ji...@oracle.com> wrote:
> Hi:
>
> I am using ActiveMQ 5.4.2. I used spring bean to configure ActiveMQ broker
> and run the application on Tomcat. Is there any way to plug in an exception
> handler for javax.jms.InvalidClientIDException from the broker? The handler
> is to deal with the exception the broker output to the Tomcat server log. I
> want to filter out that exception so that it did not show up on the server
> log.
>
> Thanks.
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-to-catch-javax-jms-InvalidClientIDException-from-AMQ-tp3458347p3458347.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com
http://fusesource.com