Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable existing transaction counter #3016

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/workflows/transaction-tests.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ public boolean invoke(Object object, String name) throws SynapseException {
}
axis2MsgCtx.setProperty(MessageContext.TRANSPORT_HEADERS, transportHeaders);

// set transaction property
axis2MsgCtx.setProperty(BaseConstants.INTERNAL_TRANSACTION_COUNTED,
msg.getBooleanProperty(BaseConstants.INTERNAL_TRANSACTION_COUNTED));
// set the JMS Message ID as the Message ID of the MessageContext
try {
if (msg.getJMSMessageID() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,6 @@ public static Map<String, Object> getTransportHeaders(Message message, MessageCo
log.error("Error while reading the Transport Headers from JMS Message", e);
}

// remove "INTERNAL_TRANSACTION_COUNTED" header from the transport level headers map.
// this property will be maintained in the message context. Therefore, no need to set this in the transport
// headers.
map.remove(BaseConstants.INTERNAL_TRANSACTION_COUNTED);
return map;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ public ManagementInternalApi() {
resourcesList.add(new ApiResourceAdapter(PREFIX_LOGOUT, new LogoutResource()));
resourcesList.add(new ApiResourceAdapter(PREFIX_SERVER_DATA, new MetaDataResource()));
resourcesList.add(new LogFilesResource(PREFIX_LOG_FILES));
resourcesList.add(new ApiResourceAdapter(PREFIX_TRANSACTION + PATH_PARAM_TRANSACTION,
new RequestCountResource()));

// Disabling this API as this version of transaction counter is deprecated.
IsuruMaduranga marked this conversation as resolved.
Show resolved Hide resolved
// resourcesList.add(new ApiResourceAdapter(PREFIX_TRANSACTION + PATH_PARAM_TRANSACTION, new RequestCountResource()));

resourcesList.add(new ExternalVaultResource(PREFIX_EXTERNAL_VAULTS
+ PATH_PARAM_EXTERNAL_VAULT_NAME));
resourcesList.add(new ApiResourceAdapter(PREFIX_DATA_SOURCES, new DataSourceResource()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@


/**
* This feature is deprecated and will be removed in a future release.
* @deprecated
*
* Resource for a retrieving aggregated transaction count.
* <p>
* Handles resources in the form "management/transactions/{param}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
import org.wso2.micro.integrator.initializer.deployment.application.deployer.CappDeployer;
import org.wso2.micro.integrator.initializer.handler.ProxyLogHandler;
import org.wso2.micro.integrator.initializer.handler.SynapseExternalPropertyConfigurator;
import org.wso2.micro.integrator.initializer.handler.transaction.TransactionCountHandler;
import org.wso2.micro.integrator.initializer.handler.transaction.TransactionCountHandlerComponent;
import org.wso2.micro.integrator.initializer.persistence.MediationPersistenceManager;
import org.wso2.micro.integrator.initializer.services.SynapseConfigurationService;
import org.wso2.micro.integrator.initializer.services.SynapseConfigurationServiceImpl;
Expand All @@ -80,10 +78,7 @@
import java.nio.file.Paths;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

Expand Down Expand Up @@ -111,10 +106,6 @@ public class ServiceBusInitializer {

private DataSourceService dataSourceService;

private TransactionCountHandlerComponent transactionCountHandlerComponent;

private ExecutorService transactionCountExecutor;

@Activate
protected void activate(ComponentContext ctxt) {

Expand Down Expand Up @@ -198,14 +189,6 @@ protected void activate(ComponentContext ctxt) {
synapseEnvironment.registerSynapseHandler(new SynapseExternalPropertyConfigurator());
synapseEnvironment.registerSynapseHandler(new ProxyLogHandler());

// Register internal transaction synapse handler
boolean transactionPropertyEnabled = TransactionCountHandlerComponent.isTransactionPropertyEnabled();
if (transactionPropertyEnabled) {
transactionCountHandlerComponent = new TransactionCountHandlerComponent();
transactionCountHandlerComponent.start(dataSourceService);
transactionCountExecutor = Executors.newFixedThreadPool(100);
synapseEnvironment.registerSynapseHandler(new TransactionCountHandler(transactionCountExecutor));
}
if (log.isDebugEnabled()) {
log.debug("SynapseEnvironmentService Registered");
}
Expand Down Expand Up @@ -260,12 +243,6 @@ private String getMainSequenceName(String cappName) {

@Deactivate
protected void deactivate(ComponentContext ctxt) {
if (Objects.nonNull(transactionCountHandlerComponent)) {
transactionCountHandlerComponent.cleanup();
}
if (Objects.nonNull(transactionCountExecutor)) {
transactionCountExecutor.shutdownNow();
}
List handlers = serverManager.getServerContextInformation().getSynapseEnvironment().getSynapseHandlers();
Iterator<SynapseHandler> iterator = handlers.iterator();
while (iterator.hasNext()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import org.wso2.micro.integrator.initializer.handler.transaction.store.TransactionStore;

/**
* DataHolder class for transaction count component.
* This feature is deprecated and will be removed in a future release.
*
* @deprecated
*/
public class DataHolder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

import java.io.File;

/**
* This feature is deprecated and will be removed in a future release.
* @deprecated
*/
public class TransactionConstants {

public static final String PUBLIC_KEY = System.getProperty(ServerConstants.CARBON_HOME) + File.separator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.RejectedExecutionException;

/**
* This feature is deprecated and will be removed in a future release.
* @deprecated
*/
public class TransactionCountHandler extends AbstractSynapseHandler {

private static final Log LOG = LogFactory.getLog(TransactionCountHandler.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
import javax.sql.DataSource;

/**
* This class represents the internal transaction count handler component.
* This feature is deprecated and will be removed in a future release.
* @deprecated
*/
public class TransactionCountHandlerComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

package org.wso2.micro.integrator.initializer.handler.transaction.exception;

/**
* This feature is deprecated and will be removed in a future release.
* @deprecated
*/
public class TransactionCounterException extends Exception {

public TransactionCounterException(String msg, Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

package org.wso2.micro.integrator.initializer.handler.transaction.exception;

/**
* This feature is deprecated and will be removed in a future release.
* @deprecated
*/
public class TransactionCounterInitializationException extends Exception {

public TransactionCounterInitializationException(String msg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
import javax.xml.bind.DatatypeConverter;

/**
* This feature is deprecated and will be removed in a future release.
* @deprecated
*
* This class will provide the required methods to encrypt a given value.
*/
public class CryptoUtil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import javax.sql.DataSource;

/**
* This feature is deprecated and will be removed in a future release.
* @deprecated
*
* The layer which connects to the transaction data.
*/
public class TransactionStore {
Expand Down
1 change: 1 addition & 0 deletions distribution/src/dbscripts/db2/db2_transaction_count.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- Related to the deprecated transaction counter feature
CREATE TABLE IF NOT EXISTS CURRENT_STATS (
TIME_STAMP DATE NOT NULL,
NODE_ID VARCHAR(40) NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- Related to the deprecated transaction counter feature
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CURRENT_STATS]') AND TYPE IN (N'U'))
CREATE TABLE CURRENT_STATS (
TIME_STAMP DATE NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- Related to the deprecated transaction counter feature
CREATE TABLE IF NOT EXISTS CURRENT_STATS (
TIME_STAMP DATE NOT NULL,
NODE_ID VARCHAR(40) NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- Related to the deprecated transaction counter feature
CREATE TABLE CURRENT_STATS (
TIME_STAMP DATE NOT NULL,
NODE_ID VARCHAR(40) NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- Related to the deprecated transaction counter feature
CREATE TABLE CURRENT_STATS (
TIME_STAMP DATE NOT NULL,
NODE_ID VARCHAR(40) NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- Related to the deprecated transaction counter feature
CREATE TABLE IF NOT EXISTS CURRENT_STATS (
TIME_STAMP DATE NOT NULL,
NODE_ID VARCHAR(40) NOT NULL,
Expand Down
7 changes: 0 additions & 7 deletions distribution/src/resources/config-tool/deployment-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1098,13 +1098,6 @@ user.password = "pwd-2"
[internal_apis.file_user_store]
enable = false

#################### Transaction Counter Handler ############################
[transaction_counter]
enable = true
data_source = "WSO2_COORDINATION_DB"
update_interval = 2


#################### Service Catalog #######################################
[[service_catalog]]
apim_host = "https://127.0.0.1:9443"
Expand Down
7 changes: 5 additions & 2 deletions integration/mediation-tests/tests-platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@
<module>tests-rabbitmq</module>
<module>tests-coordination</module>
<module>tests-userstore</module>
<module>tests-transaction</module>
<!-- <module>tests-wso2mb</module>-->

<!-- This implementation of transaction counter is deprecated -->
IsuruMaduranga marked this conversation as resolved.
Show resolved Hide resolved
<!--<module>tests-transaction</module>-->

<!--<module>tests-wso2mb</module>-->
<!--<module>tests-sap</module>-->
</modules>

Expand Down
Loading