Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/1960#discussion_r176109013
--- Diff:
artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompTransaction.java
---
@@ -0,0 +1,82 @@
+/*
+ * 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;
+
+import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.core.server.ServerSession;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Control's stomp transaction processing
+ * it goes with stomp connections.
+ * it stores acks, sends, nacks
+ * during commit it applies those to core sessions.
+ * because each stomp connection uses only one session
+ * we can't rely on core session to manage multiple
+ * tx's.
+ */
+public class StompTransaction {
+
+ private List<StompAck> acks = new ArrayList<>();
--- End diff --
Transactions in Artemis are usually done right away...
The operation on the journal is stored right away... then a pending commit
is in place.
the thing that if you duplicate Transaction functionality from the session,
you won't inherit other features such as timeouts.. etc...
If you need to support this, I would do it properly.. even if it requires
some light refactoring on how transactions are stored. (I believe you could use
the XID to get the transaction.. as a matter of fact the previous version had
some code before such as manager.getTransactionI()).
later on when users complain about a timed out transactions, you will have
a better chance of implementing through the ResourceManager that is already in
place.
---