[ 
https://issues.apache.org/jira/browse/ARTEMIS-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16116708#comment-16116708
 ] 

ASF GitHub Bot commented on ARTEMIS-1327:
-----------------------------------------

Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1445#discussion_r131678813
  
    --- Diff: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
 ---
    @@ -514,8 +514,11 @@ public void connectionCreated(final ActiveMQComponent 
component,
           }
     
           ConnectionEntry entry = protocol.createConnectionEntry((Acceptor) 
component, connection);
    -      server.callBrokerPlugins(server.hasBrokerPlugins() ? plugin -> 
plugin.afterCreateConnection(entry.connection) : null);
    -
    +      try {
    +         server.callBrokerPlugins(server.hasBrokerPlugins() ? plugin -> 
plugin.afterCreateConnection(entry.connection) : null);
    +      } catch (Exception e) {
    +         throw new IllegalStateException("Error executing 
afterCreateConnection plugin method: " + e.getMessage(), e);
    --- End diff --
    
    shouldn't you just log on this case...
    
    I would expect any failures on the broker plugin to just be logged.


> Support checked exceptions from ActiveMQServerPlugin
> ----------------------------------------------------
>
>                 Key: ARTEMIS-1327
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1327
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>            Reporter: Christopher L. Shannon
>            Assignee: Christopher L. Shannon
>             Fix For: 2.3.0
>
>
> After I was writing a couple custom plugins I realized it would be beneficial 
> to support checked exceptions.  This makes error handling simpler for plugin 
> writers as they can throw various exceptions and not have to always wrap them 
> in a RuntimeException.  Almost every place in the broker where plugin methods 
> are currently called already support handling checked Exceptions so this is 
> pretty simple and mostly we just need to add a "throws Exception" to each of 
> the methods in the ActiveMQServerPlugin interface and make sure the methods 
> used to execute the plugin methods also support it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to