activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuconic <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1960: ARTEMIS-406 STOMP acknowledgements shou...
Date Wed, 21 Mar 2018 13:29:59 GMT
Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1960#discussion_r176080114
  
    --- Diff: artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/CommandType.java
---
    @@ -0,0 +1,84 @@
    +/*
    + * 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.core.protocol.stomp;
    +
    +public enum CommandType {
    +
    +   CONNECT(Stomp.Commands.CONNECT),
    +   SEND(Stomp.Commands.SEND),
    +   DISCONNECT(Stomp.Commands.DISCONNECT),
    +   SUBSCRIBE(Stomp.Commands.SUBSCRIBE),
    +   UNSUBSCRIBE(Stomp.Commands.UNSUBSCRIBE),
    +   BEGIN(Stomp.Commands.BEGIN),
    +   COMMIT(Stomp.Commands.COMMIT),
    +   ABORT(Stomp.Commands.ABORT),
    +   ACK(Stomp.Commands.ACK),
    +   NACK(Stomp.Commands.NACK),
    +   STOMP(Stomp.Commands.STOMP),
    +   CONNECTED(Stomp.Responses.CONNECTED),
    +   ERROR(Stomp.Responses.ERROR),
    +   MESSAGE(Stomp.Responses.MESSAGE),
    +   RECEIPT(Stomp.Responses.RECEIPT);
    +
    +   private String type;
    +
    +   CommandType(String command) {
    +      type = command;
    +   }
    +
    +   @Override
    +   public String toString() {
    +      return type;
    +   }
    +
    +   public static CommandType getType(String command) {
    +      switch (command) {
    --- End diff --
    
    There are serious performance implications on this, right?
    
    you're using getType on the hot path... (on Every frame creation). What happened to that
code that would inspect just a few bytes of the frame and create the StompFrame fast... this
is a major regression here.


---

Mime
View raw message