activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franz1981 <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #2371: ARTEMIS-2097 Pause and Block Producers
Date Mon, 15 Oct 2018 09:20:10 GMT
Github user franz1981 commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2371#discussion_r225093373
  
    --- Diff: artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQAddressBlockedException.java
---
    @@ -0,0 +1,24 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements. See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License. You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.activemq.artemis.api.core;
    +
    +public class ActiveMQAddressBlockedException extends ActiveMQException {
    +
    +   public ActiveMQAddressBlockedException(String address) {
    --- End diff --
    
    To help the JVM to handle this exception like a "common" case (and not exceptional): i
suggest to disable the stack trace generation for this exception by adding:
    ```
        @Override
        public Throwable fillInStackTrace() {
            return this;
        } 
    ```
    That would allow to create `ActiveMQAddressBlockedException` as a singleton and just reusing
it a signal.
    
    I'm assuming that the use case for pause/block producers is making intensive use of this
exception as an event that allow recovering and deciding what to do next in the common execution
path.


---

Mime
View raw message